How to adjust resolution in Hough transform?
4 views (last 30 days)
Show older comments
I'm trying to interpret potential linear trends in a map op volcanic centers using the Hough transform. Attached is the image used with hough lines on it. As you can see, the lines are only very short. How do I change the sensitivity so that more points are considered in the transform?
Code used:
RGB = imread('NVP_WP_ONLY.tif');
I = rgb2gray(RGB);
BW = edge(I,'canny');
[H,T,R] = hough(BW);
subplot(2,1,1);
imshow(RGB);
title('Newer Volcanic Province Eruption Points');
subplot(2,1,2);
imshow(imadjust(mat2gray(H)), 'XData',T,'YData',R,'InitialMagnification','fit');
title('Hough transform eruption points all Default settings');
xlabel('\theta'),ylabel('\rho');
axis on, axis normal, hold on;
colormap(hot)
P = houghpeaks(H,100);
imshow(H,[], 'XData',T,'YData',R,'InitialMagnification','fit');
xlabel('\theta'),ylabel('\rho');
axis on, axis normal, hold on;
plot(T(P(:,2)),R(P(:,1)),'s','color','white');
lines = houghlines(BW,T,R,P);
figure, imshow(RGB), hold on; %expect a figure size warning
max_len = 0;
for k = 1:length(lines) xy = [lines(k).point1; lines(k).point2];
plot(xy(:,1),xy(:,2),'LineWidth',2,'Color','green');
end
4 Comments
Walter Roberson
on 16 Sep 2015
It did not seem to get attached. Remember to click on "Attach File" after you select the file.
Answers (1)
Walter Roberson
on 19 Sep 2015
Perhaps in your hough() call you need to adjust your RhoResolution or ThetaResolution?
See Also
Categories
Find more on MATLAB Mobile in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!