フィルターのクリア

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 Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by