Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotting Hough Transform MATLAB

I was trying to plot hough transform using hough(edge_detected_image). Then Im using the following commands:

imshow(h,[],'XData',theta,'YData',rho,'InitialMagnification','fit');
 axis on
 axis normal
 hold on

But Im getting the plot as:this

while i need something like this

How can this be achieved? Are there any settings to be done?

like image 213
Ravi Shankar Avatar asked Jun 16 '26 18:06

Ravi Shankar


1 Answers

You need to change the colour map. In addition, you may want to rescale the data so that it conforms within an acceptable range. Use imadjust on the output accumulator matrix prior to showing it. You will need to change the values of the accumulator matrix so that it's normalized. Simply dividing by the maximum value of h should work.

The colour map used in your figure is the hot colour map, so therefore:

imshow(imadjust(h / max(h(:))),'XData',theta,'YData',rho,'InitialMagnification','fit');
axis on; axis normal; hold on
colormap(gca,hot);
like image 150
rayryeng Avatar answered Jun 19 '26 13:06

rayryeng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!