How to stop image auto resize after using imcrop?

조회 수: 6 (최근 30일)
rupam baruah
rupam baruah 2015년 12월 10일
댓글: Image Analyst 2015년 12월 10일
In a GUI I load a rgb image in axes1. After that I cropped one portion of the image and showing that cropped portion in axes2. But after cropping the size of the cropped portion is changed. Its zoomed. How to show the cropped porition in its actual size in axes2? Is there any option to stop that auto zoom?

채택된 답변

Image Analyst
Image Analyst 2015년 12월 10일
In axes2, first display the original image, then put "hold on", and then display your cropped image. The axes will stay adjusted to what they were when you showed the first image.
  댓글 수: 2
rupam baruah
rupam baruah 2015년 12월 10일
I tried it. But then in axes2 both images are displayed at the same time. First the main image is displayed. And then in lefttop corner the cropped portion is displayed.
Image Analyst
Image Analyst 2015년 12월 10일
Then display zeros or some uniform image. Try this:
bigImage = imread('moon.tif');
subplot(1, 2, 1);
imshow(bigImage);
axis on;
smallImage = bigImage(250:300,50:300);
subplot(1, 2, 2);
imshow(zeros(size(bigImage)));
axis on;
hold on;
imshow(smallImage);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by