Search for line passing through a point in edge image
Hi all
I have an color image and I converted it to gray image then I do edge detection using ‘canny’. The edge image contains horizontal, vertical and inclined lines. For specific pixel (xp,yp) in the edge image, I want to search for a vertical line that pass through this point.
Can anyone help me to find to a method to search or detect a vertical line passing in this point. Your help is highly appreciated.
I started with:
I=imread(‘image.jpg’);
G=rgb2gray(I);
B=edge(G,’canny’);
I read about Hough transform and I found these functions but I could’t write the codes or the program to solve the problem. could you please help me for more details or a part of program. your help is greatly appreciated:
[H, theta, rho] = hough(BW)
[H, theta, rho] = hough(BW, ParameterName, ParameterValue)
peaks = houghpeaks(H, numpeaks)
peaks = houghpeaks(..., param1, val1, param2, val2)
lines = houghlines(BW, theta, rho, peaks)
lines = houghlines(..., param1, val1, param2, val2)
NOTE:-
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
doc hough
BW = diag(ones(1,100)); BW(:,[20 60])=1; BW(20:90,75)=1;
[H,T,R] = hough(BW);
P = houghpeaks(H,200);
It = T(P(:,2)) == 0; % index vector for theta == 0
lines = houghlines(BW,T,R,P(It,:));isvline = false(size(BW));
for k = 1:length(lines)
y = lines(k).point1(2) : lines(k).point2(2);
x = lines(k).point1(1) * ones(size(y));
isvline(y,x) = true;
end
SEE COMPLETE ANSWER CLICK THE LINK