Effacer les filtres
Effacer les filtres

We keep getting this error, how can we fix it?

1 vue (au cours des 30 derniers jours)
Hind Aljallaf
Hind Aljallaf le 12 Mai 2023
Modifié(e) : Image Analyst le 12 Mai 2023
We want to create an application using a flower file and whenever we run it, it shows this error. I am not sure why this occurs since I did put a colored image. I even checked the size per instructions, yet I don't understand how they can be related. Please help me solve this issue. Also, how can i put the file into the workspace?

Réponses (1)

Image Analyst
Image Analyst le 12 Mai 2023
Modifié(e) : Image Analyst le 12 Mai 2023
I am not aware of a strcmps() function. Try strcmpi or contains
and try
[rows, columns, numberOfColorChannels] = size(im1)
if numberOfColorChannels == 3
% Convert to grayscale ONLY if the image is color.
i1 = rgb2gray(im1);
else
i1 = im1;
end

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by