필터 지우기
필터 지우기

Position a resized matrix onto original matrix

조회 수: 1 (최근 30일)
Mike Rovan
Mike Rovan 2019년 10월 24일
편집: Mike Rovan 2019년 10월 24일
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?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by