정확한 호출로 인한 ROI를 저장하는 방법에 대해 혼란 스럽습니다.Matlab : 이미지 결과 저장 방법 IMRECT로 선택한 ROI의 실시간 플로팅
function Zoomer
figure();
highResImage = imread('E:\My Work\THESISQ\FIX\Koding\data coba\Image_3060.jpg');
lowResImage = imresize(highResImage,0.5);
a1 = subplot(2,1,1);
a2 = subplot(2,1,2);
imshow(lowResImage,'Parent',a1);
initialPosition = [10 10 100 100];
lowResRect = imrect(a1,initialPosition);
lowResRect.addNewPositionCallback(@(pos)Callback(pos,a2,highResImage));
Callback(initialPosition , a2, highResImage);
end
function Callback(position,axesHandle, highResImage)
position = position * 2;
x1 = position(1);
y1 = position(2);
x2 = position(1) + position(3);
y2 = position(2) + position(4);
highResThumbnail = highResImage(round(y1:y2),round(x1:x2),:);
if isempty(get(axesHandle,'Children'))
imshow(highResThumbnail,'Parent',axesHandle);
else
imHandle = get(axesHandle,'Children');
oldSize = size(get(imHandle,'CData'));
if ~isequal(oldSize, size(highResThumbnail))
imshow(highResThumbnail,'Parent',axesHandle);
else
set(imHandle,'CData', highResThumbnail);
end
end
end
이 내 사진을 내가 그 코드
을 사용하여이 그림에서 림프구 세포를 자르려 : 나는 subplot(2,1,2)
코드에 이미지를 저장하고 싶은 것은 코드를 실행 한 후 결과는
입니다.subplot(2,1,2)
에 이미지를 저장하려면 어떻게해야합니까?
코드 스크린 샷을 게시하지 마십시오. 이미지는 검색 할 수 없으며 테스트를 위해 복사 할 수 없으며 접근성을 방해합니다. 대신 관련 코드를 [형식화 된 텍스트]로 포함하십시오 (http://stackoverflow.com/help/formatting). – Meyer
귀하의 조언을 주셔서 감사합니다 @ 마이어 –
응? 'highResThumbnail'을 어떻게 저장할까요? save myfile.mat highResThumbnail'? –