Error - Error using im2double
3 ビュー (過去 30 日間)
古いコメントを表示
I implemented the following code for non-overlapping patch and I'm getting this error. What does this mean?
Thank you.
*Code -*
YourImage = im2double('house.jpg');
[m,n] = size(YourImage);
Blocks = cell(m/16,n/16);
counti = 0;
for i = 1:16:m-15
counti = counti + 1;
countj = 0;
for j = 1:16:n-15
countj = countj + 1;
Blocks{counti,countj} = YourImage(i:i+15,j:j+15);
end
end
*Error Message -*
Error using im2double
Expected input number 1, Image, to be one of these types:
double, logical, uint8, uint16, int16, single
1 件のコメント
Stephen23
2023 年 4 月 25 日
編集済み: Stephen23
2023 年 4 月 25 日
"What does this mean?"
The IM2DOUBLE documentation states that its first input must be an "Input image, specified as a numeric scalar, vector, matrix, or multidimensional array." Instead of providing a numeric image, you have called IM2DOUBLE with some text.
I do not see anything in the IM2DOUBLE documentation to suggest that it accepts text as its first input.
If you are trying to import an image from a file try using an image importing function, e.g. IMREAD:
回答 (1 件)
Image Analyst
2023 年 4 月 25 日
Your code does not use im2double. And you did not post the entire error message (all the red text). I know because the line number and actual line of code is not included in what you post, and they are in the actual error message. We can't see what you really did So...

0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!