# How to trace the edges on matlab

I am doing my Bachelor's project on Road extraction. I have detected the line segments(edges) in the image using hough transform. I need to detect the curved lines in the road and link them(edge linking). help me with matlab coding.

• have you tried sobel edge detector with some morphological operations such as dilation? Feb 5 '14 at 16:13
• I have tried canny edge detector and hough transform so far. Feb 6 '14 at 10:03

One possible pre-processing apporach is to use imdilate(I,strel('disk',5)) to thicken the road lines a little bit.
If you are trying houghlines, probably one parameter that you need to tune is the 'FillGap' which will connect the very short segments (you can try to change this parameter yourself to observe the effect, along with the MinLength value):
lines = houghlines(BW,T,R,P,'FillGap',30,'MinLength',15);

However, the road curves are not straight lines, so I won't recommend you to use hough transform. You may try bwmorph(bw,'skel',N); after you thicken the binarized road image. N is the iteration number that you need to tune.