フィルターのクリア

How to Crop an Image

2 ビュー (過去 30 日間)
VIJENDRA
VIJENDRA 2014 年 1 月 22 日
回答済み: AJ von Alt 2014 年 1 月 22 日
I want to crop different parts from an image when i did for i=1:n crop(i)=imcrop(Image); end It shows an error message ??? Subscripted assignment dimension mismatch how can i do it.?

回答 (1 件)

AJ von Alt
AJ von Alt 2014 年 1 月 22 日
The function imcrop returns a matrix. You are trying to store this matrix as a single element of an array. This is not possible with normal arrays, but is possible with cell arrays. Change crop to a cell array to fix this problem.
Change:
crop(i)=imcrop(Image);
To:
crop{i}=imcrop(Image);
Relevant documentation: imcrop , cell arrays

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by