Borrar filtros
Borrar filtros

Position a resized matrix onto original matrix

1 visualización (últimos 30 días)
Mike Rovan
Mike Rovan el 24 de Oct. de 2019
Editada: Mike Rovan el 24 de Oct. de 2019
If I have an original matrix consisting of 1 or more irregular shaped binary blogs, I cropped it by removing leading and trailing zeros then resized the cropped image using:
i then cropped the resized image using the same previous technique
How do i now position the cropped resized image on top of the original image
i tried taking the Center of mass with regionprops(X,'centroid'); of the original image, the cropped image, and the cropped resized image
then positioning the cropped resized image to start at the location of the center of mass(original image,)-center of mass(cropped resized image,)+1
However, the problem is that the resized image doesnt match up completely with the original. I wanted it so that it is over the original in the exact correct position, but with my method there are some pixels where it doesnt overlap centered and you can see the pixels of the original image not being covering by the resized image
Is there another method that would work better?

Respuestas (0)


Más información sobre Resizing and Reshaping Matrices 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