How to fit the multiple line on the image
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi I have a binary image below and I would like to fit lines on the images, but if I use Hough transformation, the result is not good, it cannot find all the lines in the middle of the image, does any one can help me solve this problem?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151262/image.jpeg)
댓글 수: 0
답변 (2개)
Eric Lin
2015년 6월 17일
Without more details regarding your use case or more sample images, it's difficult to give specific recommendations, but one possibility is to use morphological operations, such as "imdilate" or "imclose", to further process the image prior to applying the Hough transform.
댓글 수: 0
Image Analyst
2015년 6월 17일
편집: Image Analyst
2015년 6월 17일
You can label the image with bwlabel(), then use regionprops() to get PixelList, which is a list of the x,y coordinates for each separate region. Of course you need to make sure the lines aren't connected into a really long skinny U shape. But then, once you have PixelList, simply put that into polyfit() and you're pretty much done - you have your fits.
Other options would be to use RANSAC or the radon transform, but I don't think they're as promising or easy.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!