Shuffling matrix regions while maintaining their shape

조회 수: 1 (최근 30일)
Neuropragmatist
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,
M.
  댓글 수: 2
Neuropragmatist
Neuropragmatist 2020년 10월 24일
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 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개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by