Borrar filtros
Borrar filtros

Error - Error using im2double

7 visualizaciones (últimos 30 días)
Sara Kadam
Sara Kadam el 25 de Abr. de 2023
Editada: Walter Roberson el 25 de Abr. de 2023
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 comentario
Stephen23
Stephen23 el 25 de Abr. de 2023
Editada: Stephen23 el 25 de Abr. de 2023
"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:

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 25 de Abr. de 2023
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...

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by