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.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by