0
I = imread('data1.jpg')
[p3, p4] = size(I);
q1 = 50; % size of the crop box
i3_start = floor((p3-q1)/2); % or round instead of floor; using neither gives warning
i3_stop = i3_start + q1;
i4_start = floor((p4-q1)/2);
i4_stop = i4_start + q1;
I = I(i3_start:i3_stop, i4_start:i4_stop, :);
figure ,imshow(I);
我已經運行該代碼,並得到這個錯誤「指數超過矩陣尺寸im matlab中的新手。所以我需要幫助。 IM嘗試做到這一點的編碼,但有此錯誤
錯誤==> croptry在10 I = I(i3_start:i3_stop ,i4_start:i4_stop, :);「
有人能幫我解決這個錯誤嗎?我想在中心裁剪圖像
非常感謝你,因爲幫助我解決了這個錯誤。有用。謝謝你 – user5405704
不客氣!快樂我一直在使用你。也許您可能想要接受關閉問題的答案:-) –
@ user5405704考慮接受答案爲有效;)https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-工作 –