RGB values in a YUV colorspace image
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (2)
imshow treats the image as an RGB image. If it is not, e.g., if some values are negative, these values are set to 0. Note that if you click on some point in the image shown by imshow, RGB values are shown. But these are just the YUV values from your original image mapped to whatever imshow considers to be an appropriate range, (e.g., negative values are mapped to 0). To use these values for further processing would mean that you want to process the data on the peculiar scalings done by the imshow function. I doubt that this is what you want. If you need rgb values, you have to convert the YUV image to RGB.
7 commentaires
nitin
le 30 Juin 2015
Thorsten
le 30 Juin 2015
I think you have to find out the operation that imshow applies to the data and then apply these operation on your data.
BTW, I do not understand why you use imshow for YUV. It should be displayed in false colors, and I do not understand why you want to apply the operation performed by imshow (which regard the image as if it were an RGB image) for your YUV image.
nitin
le 30 Juin 2015
Thorsten
le 30 Juin 2015
I see. I think it's best if you provide the image such that we can have a closer look.
nitin
le 30 Juin 2015
Thorsten
le 30 Juin 2015
Please also post the original image.
nitin
le 30 Juin 2015
Walter Roberson
le 30 Juin 2015
0 votes
The others have explained why what you ask is probably not what you need. The way to do as you ask is to get the File Exchange contribution freezeColors(), apply it to the the displayed image, and then get() the CData property of the image() object.
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!