Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(a) Hand calculation: Apply Hough transform to the following image to detect the straight line Assumption: use polar parameterization of lines and treat the lower
(a) Hand calculation: Apply Hough transform to the following image to detect the straight line Assumption: use polar parameterization of lines and treat the lower left pixel as (0,0) so the line is xcos? + ysin d, where d is the perpendicular distance from line to the origin and is angle the perpendicular makes with the horizontal axis. Algorithm for hand calculation: 1) Initialize matrix M (d, ) as zeros 2) For each non-zero point la,y) in the given image For in [0, 45, 90, 135] Compute d xcos? + ysin Update M (d, )-M (d,0) + 1 3) (d', *)-argmax(dB)(M (d,0)) 4) The detected line is xcose ysine*-d' Show two results: (1) our M (d, ), (2) The detected line (expression simplified). 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 (b) Write programs: Pixel classification / clustering is a powerful tool for image segmentation. Use the image: duck. ipg. Implement an image segmentation scheme as follows: (1) Flatten the image where each pixel is described by five features [R.G,B.X.Y] i.e. the red, green, blue, horizontal location and vertical location, denoted as F. In this case F should be 50,589 by 5. (2) Cluster F by classic k-means algorithm given k 2. Display two images in a subplot: (1) The original image. (2) The cluster index image. Notes: Make sure in [R.G,B.X,Y1 space each column is normalized to [0,1 Helpers: meshgrid, reshape, kmeans (a) Hand calculation: Apply Hough transform to the following image to detect the straight line Assumption: use polar parameterization of lines and treat the lower left pixel as (0,0) so the line is xcos? + ysin d, where d is the perpendicular distance from line to the origin and is angle the perpendicular makes with the horizontal axis. Algorithm for hand calculation: 1) Initialize matrix M (d, ) as zeros 2) For each non-zero point la,y) in the given image For in [0, 45, 90, 135] Compute d xcos? + ysin Update M (d, )-M (d,0) + 1 3) (d', *)-argmax(dB)(M (d,0)) 4) The detected line is xcose ysine*-d' Show two results: (1) our M (d, ), (2) The detected line (expression simplified). 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 (b) Write programs: Pixel classification / clustering is a powerful tool for image segmentation. Use the image: duck. ipg. Implement an image segmentation scheme as follows: (1) Flatten the image where each pixel is described by five features [R.G,B.X.Y] i.e. the red, green, blue, horizontal location and vertical location, denoted as F. In this case F should be 50,589 by 5. (2) Cluster F by classic k-means algorithm given k 2. Display two images in a subplot: (1) The original image. (2) The cluster index image. Notes: Make sure in [R.G,B.X,Y1 space each column is normalized to [0,1 Helpers: meshgrid, reshape, kmeans
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started