Problems with syntax and implementation of houghlines

조회 수: 1(최근 30일)
SS
SS 2021년 3월 29일
편집: SS 2021년 5월 18일
Hello everyone. This question is to continue with one of my previous queries
I have 2048 binarized tif images which has some lines that intersect or collapse on one another. I have a MATLAB code with regionprops and it works fine when the lines are not collapsing or intersect. I want to replace regionprops with houghlines, and measure the the following properties of the lines in the images:
'centroid', 'Extrema', 'Orientation', 'MajorAxislength' that regionprops measures in general.
  댓글 수: 2
SS
SS 2021년 3월 31일
Hi, thanks for your prompt response. I have attached the screenshots of the images. As you can see in Pic1, the line elements in the yellow ellipse is actually one entity but there is some unfilled gap which makes them look like 2 different lines. I want to treat such cases as one line if the distance between the centroids is less than 100 pixels.
Thanks again.

댓글을 달려면 로그인하십시오.

채택된 답변

Pratyush Roy
Pratyush Roy 2021년 4월 1일
Hi,
The lines generated by the houghlines method has several properties.Here point1 and point2 represent the coordinates of the extrema points of the line segment and theta represent the orientation of the line. To obtain the centroid, one can take the mean of the point vectors point1 and point2. The axis length for the line can be assumed to the length of the line segment hich is equal to the absolute value of the difference between the point coordinates. To reduce the unfilled gap between the two filled lines, the "FillGap" Name-Value parameter can be changed with the minumum distance between the two lines so that they can be merged.
Hope this helps!

추가 답변(0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by