imfill or other function to make a donut from contours?

조회 수: 7 (최근 30일)
James
James 2014년 3월 4일
편집: James 2014년 3월 5일
Hello,
I am trying to make a donut from two concentric sets of contours. When I use imfill, it completely fills in the outer contour. I was wondering if there is function that will fill in the space between the two concentric contours, and leave the center of the inner contour empty. It needs to generalize to be able to handle multiple inner contours (think Swiss cheese rather than a donut) but does not necessarily need to be able to handle more than 2 nested contours. I know a way to accomplish this, but don't want to write the code if MATLAB has a function that can already do it. Any help would be appreciated. thanks!

답변 (2개)

James
James 2014년 3월 5일
I realised I posted this late (after normal work hours). Bumping so it doesn't get buried...
  댓글 수: 1
Image Analyst
Image Analyst 2014년 3월 5일
They were probably waiting for you to post a diagram showing what you have and what you want, to make it easier to understand.

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


James
James 2014년 3월 5일
편집: James 2014년 3월 5일
I have attached a picture of what I am trying to accomplish. Top left is the contour set, top middle is how I want it to be filled in. Top right is what I get using imfill. Bottom set is the more general case with more holes (swiss chesse). Any help would be appreciated. Thanks

카테고리

Help CenterFile Exchange에서 Surfaces, Volumes, and Polygons에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by