Position a resized matrix onto original matrix

1 view (last 30 days)
Mike Rovan
Mike Rovan on 24 Oct 2019
Edited: Mike Rovan on 24 Oct 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:
imresize(cropped,1.5,'nearest');
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?

Answers (0)

Categories

Find more on Resizing and Reshaping Matrices 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!