problem with alternative way to do imcrop

조회 수: 3 (최근 30일)
joanna
joanna 2012년 11월 7일
i have a problem executing this set of statements. it sort of hangs when i execute it. is there any other alternative ways i could do it by manually assign a standard size to the images to crop all automatically?
[I1c rect] = imcrop(handles.axes2);
rect
axes(handles.axes2);
imshow(I1c);
guidata(hObject, handles);
I2c = imcrop(I2, rect);
axes(handles.axes3);
imshow(I2c);
guidata(hObject, handles);
  댓글 수: 1
Jan
Jan 2012년 11월 7일
The term "it sort of hangs" is not clear enough to be answered efficiently. Please explain exactly what happens (perhaps a complete error message?).

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

채택된 답변

Harshit
Harshit 2012년 11월 7일
Select the pixels you want say for image I a cropped region will be I = I(1:x,1:y)
  댓글 수: 4
joanna
joanna 2012년 11월 7일
thank you. it worked
Image Analyst
Image Analyst 2012년 11월 7일
Don't use i (the imaginary variable) for a variable name. Not only that, but it's not a very descriptive name anyway. Use something like grayImage, or croppedOriginalImage or something like that. That way when you do image processing and have a lot of intermediate images that you may need to inspect, you won't have a confusing alphabet soup of short cryptic variable names.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by