Shuffling matrix regions while maintaining their shape

1 ビュー (過去 30 日間)
Neuropragmatist 2020 年 10 月 24 日
コメント済み: Neuropragmatist 2020 年 10 月 24 日
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,
  2 件のコメント
Neuropragmatist 2020 年 10 月 24 日
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?


回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by