Rearrange Binary regions based on centroids

조회 수: 2 (최근 30일)
John
John 2014년 9월 23일
답변: Image Analyst 2014년 10월 31일
I have a binary map, BW, and the Centroids for each region in BW. If I randomize the Centroids, how can I create another binary map with the same region shapes as BW but whose centers corresponds to the randomized Centroids?

채택된 답변

Image Analyst
Image Analyst 2014년 10월 31일
Get the blobs, use regionprops() to find their bounding box and then use indexing to extract out the bounding box as subimages. Then create a new, blank canvass (image) and paste the subimages in at random locations. See my copy and paste demo, attached.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by