How to convert a binary image into lines only

11 ビュー (過去 30 日間)
Max
Max 2019 年 6 月 29 日
回答済み: Divya Gaddipati 2019 年 7 月 16 日
The image I have is on the left side and I am trying to turn in into lines only (possibly array of lines) as shown on the right image below.
a.jpg
Is it possible to achieve with hough transform and right settings?

回答 (1 件)

Divya Gaddipati
Divya Gaddipati 2019 年 7 月 16 日
Hi,
You can use the command “bwskel” for this purpose. It takes two parameters as input, the binary image and minimum branch length. For example,
result = bwskel(im, 'MinBranchLength', N);
where “im” is the binary image and the parameter “N” is the minimum branch length i.e., “bwskel” prunes branches shorter than the specified “N”.
For more information on “bwskel”, you can refer to the following documentation:

Community Treasure Hunt

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

Start Hunting!

Translated by