Links I checked before asking this question:
I have an image img
. I want to visualize the pixel values in a matrix (after some manipulation) in MATLAB. R1, R2 and R3 are the three matrices I created to store pixel values of R, G and B respectively.
for i=1:30
R1(:,1:30:) = toeplitz(img(i,:,1));
R2(:,1:30,:) = toeplitz(img(i,:,2));
R3(:,1:30,:) = toeplitz(img(i,:,3));
R = (R1+ R2+ R3)/3 ; %%I know this part is incorrect
end
However, imshow(R)
shows grayscale image but I want to visualize in RGB. What I can understand it is taking the pixel values from 0 to 255 as 0:Black and 255:White. What I am trying to achieve is that it averages the pixel value of the 3rd dimension in R1, R2 and R3 and show me the pixel in the color.
Any help will be appreciated.
Reference: https://www.mathworks.com/help/matlab/ref/toeplitz.html