Position a resized matrix onto original matrix
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!