Error using Imread with 'PixelRegion' option

Hello,
I am having problems using imread.
Following code causes an error, imgName is full file address '/.../name.jpeg'
>> imread(imgName, 'PixelRegion',{[10, 20],[10, 20]})
Error using imagesci/private/readjpg
Too many input arguments.
Error in imread (line 438)
[X, map] = feval(fmt_s.read, filename, extraArgs{:});
I have tried to modify the input arguments according to few tutorials but I still receive this error. I am usnig Matlab R2011b.
Thanks for answer.

 採用された回答

Image Analyst
Image Analyst 2013 年 11 月 14 日

0 投票

That only works for JPEG 2000 format images. Are you sure your image is of that format? Otherwise read in the whole thing and extract:
grayImage = imread(fullFileName);
subImage = grayImage(10:20, 10:20);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

質問済み:

Jan
2013 年 11 月 14 日

回答済み:

2013 年 11 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by