Shuffling matrix regions while maintaining their shape

1 visualización (últimos 30 días)
Neuropragmatist
Neuropragmatist el 24 de Oct. de 2020
Comentada: Neuropragmatist el 24 de Oct. de 2020
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 comentarios
Neuropragmatist
Neuropragmatist el 24 de Oct. de 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 el 24 de Oct. de 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?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by