problem with alternative way to do imcrop

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 日

0 投票

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 日
so my image size is 1060x1324
i = i(136:980,38:956);
is this statement correct?
Harshit
Harshit 2012 年 11 月 7 日
Yes it is given you are interested in this region. Why don't you just try it.
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 件)

カテゴリ

ヘルプ センター および File ExchangeData Import and Analysis についてさらに検索

質問済み:

2012 年 11 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by