Shuffling matrix regions while maintaining their shape

1 view (last 30 days)
Hi all,
I want to segment a matrix into parts, then move those parts around while maintaining their shape as far as possible (but obviously reshaping them as much as necessary). The procedure would resemble something like this:
Where the segmented matrix on the left is transformed so the regions move to new positions on the right. Ideally pixels maintain their positions within the segments as far as possible, but I would expect pixels near the edge to change to accommodate the new shape.
My schematic is not precise at all, but I would want the coloured regions to retain the same size (i.e. the red zone might take up 1000 elements in both matrices).
I already find regional maxima then use watershed to create the matrix on the left. I can find centroids or points of interest for each region and find new positions for these in the matrix on the right. I just don't have a good algorithm for doing the movement, but this seems like something image processing may have solved already.
Thanks for any help,
M.
  2 Comments
Neuropragmatist
Neuropragmatist on 24 Oct 2020
I guess another way to think about it would be given X image regions that contain a total of 100x100 pixels, is there an algorithm that can be used to flexibly recombine them into a matrix that is 100x100?
Neuropragmatist
Neuropragmatist on 24 Oct 2020
Or even if someone knows how to segment a matrix into parts of a specific size that would help me:
i.e. given a 100x100 matrix, divide it into 4 parts, the 4 parts must have sizes: 1052, 2216, 2712, 4020 elements, they can be any shape but must be continguous...
How could I do that?

Sign in to comment.

Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!