MATLAB: RGB values in a YUV colorspace image

image processingimshow

I have an image in YUV colorspace and when i preview it using imshow() function,the image shows RGB values at each pixel but when i type img_name(x,y,:) in the workspace,it shows some other values. So how do i get those RGB values which are shown in the figure using the imshow() function in the workspace or use them for further processing.

Best Answer

How did you get that image in that color space? Was it from a camera?
Also, the value is different from workspace (variable editor) to what you type in because you typed in the wrong thing. You typed in img_name(x,y,:) instead of img_name(y, x, :). Remember, with matrices the ROW is the first index, not the column.