I am trying to read an image and convert it to grayscale. Originally, I thought the problem was with the rgb2gray function, but when I displayed the image i was trying to read, it was completely different. Here is my code (I got a part of it from another forum) as well as the picture i was trying to read and convert to grayscale.
RGB = imread('Cir1.png'); imshow(RGB); [rows columns numberOfColorChannels] = size(RGB); if numberOfColorChannels > 1 Igray = rgb2gray(RGB); else Igray = RGB; % It's already gray.
end imshow(Igray);
The image i am trying to read is show below.
Thanks!
Best Answer