im2gray not working
30 views (last 30 days)
I am trying to read my image and to make it as an array. I want to use im2gray command but it is not working. However the same code with same image is working in matlab online and other systems. I have image processing software insatlled in the system. Please help me with this.
DGM on 8 Jun 2022
Edited: DGM on 8 Jun 2022
im2gray() was introduced in R2020b. You're using R2020a.
Depending on what you need, you might be able to do it with rgb2gray() and some array size checks.
outpict = rgb2gray(inpict);
outpict = inpict;
% i'm assuming you don't want to support IA/RGBA images
error('a wild error message appears')
If you know all your images are RGB and aren't worried about running into ones that aren't, you can just use rgb2gray().