Rearrange Binary regions based on centroids

2 次查看(过去 30 天)
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