Downsampling a single RGB Channel

10 vues (au cours des 30 derniers jours)
stayfrosty
stayfrosty le 20 Avr 2016
Commenté : Image Analyst le 20 Avr 2016
How would you go about downsampling a single RGB Channel (R, G or B) and then re-forming the RGB image? I'm fairly new to image processing. I've looked at a few sources, but I haven't managed to find the answer to this in Matlab yet.
For example, if I split the image into its individual R, G and B channels, downsample the G and B channel with sample rate of 2, how would I recombine the R channel with the downsampled G and B channels? They are all now different matrix dimensions. I hope this isn't a silly question and that my example is clear enough to understand.

Réponses (1)

Image Analyst
Image Analyst le 20 Avr 2016
Use cat
smallRGB = cat(3, smallRedChannel, smallGreenChannel, smallBlueChannel);
Of course you can use use imresize(rgbImage, 0.5) on the original RGB image if you want, rather than splitting it up into separate color channels.
  4 commentaires
stayfrosty
stayfrosty le 20 Avr 2016
Modifié(e) : stayfrosty le 20 Avr 2016
Thank you very much for the reply and solution. I just want to elaborate on the problem a bit more. I'm actually trying to reproduce the methodology in the attached screenshot.
So, I've converted RGB to the YUV color space, then downsampled U and V. Performed DCT then quantization. The final steps to retrieve the processed image have been left out of the article and I'm kinda doing a bit of guesswork here.
So, now I'm guessing I would perform IDCT then use Matlab's built-in function of imresize() to replicate the missing pixels.
Do you think that's what the researchers in that article would have done? I've tried e-mailing the people who did that research but no reply at the moment.
Image Analyst
Image Analyst le 20 Avr 2016
Notice that they do not combine the different sized images into another image like you asked about. They probably save them separately in binary in some file, one after the other.
To reconstruct, yes, you'd read in the data, then reverse the process, including IDCT and resizing.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Processing and Computer Vision dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by