How to connect two objects based on least distance between them?

5 ビュー (過去 30 日間)
peyush
peyush 2015 年 7 月 1 日
コメント済み: peyush 2015 年 7 月 4 日
I have a binary image containing two separate objects...I want to connect them such that they are connected on basis where the distance between them is the least?

採用された回答

Image Analyst
Image Analyst 2015 年 7 月 1 日
Call bwboundaries. Then have some for loops where you check all the boundary coordinates to see which distance is least. Then you can use imline() to burn a connecting line into the image, like in the attached demo.
  7 件のコメント
peyush
peyush 2015 年 7 月 3 日
Sir please help me...
Image Analyst
Image Analyst 2015 年 7 月 3 日
Your code does not look like you adapted it at all? Did you?

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2015 年 7 月 3 日
peyush, your code didn't even seem to attempt to modify my code at all. It looks like I need to do it for you. See the attached demo which makes the connection.
  1 件のコメント
peyush
peyush 2015 年 7 月 4 日
thank-you so much for helping me out :-)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by