While Downsampling 4:4:4 YCbCr image to 4:2:0 using imresize inbuilt function should we scale it by 0.5 or 0.25
Show older comments
I have converted RGB image into its YCbCr equivalent i.e. 4:4:4. And separated its Y, Cb and Cr components.
Now i need to downsample this 4:4:4 sample into 4:2:0 sample. For this i am using imresize inbuilt command.
Y component will be as it is in 4:2:0. The doubt i have is for Cb and Cr chroma components should i scale each component by 0.5 or 0.25.
Code:
%Load Image
RGB = imread('dbz.jpg');
%convert image to YCbCr color space
YCBCR = rgb2ycbcr(RGB);
%Extract Y and Cb, Cr components from the converted image it is in 4:4:4
Y=YCBCR(:,:,1);
Cb=YCBCR(:,:,2);
Cr=YCBCR(:,:,3);
Next which below code should i use 0.5 or 0.25 ?
%4:2:0 conversion of YCbCr using inbuilt command with bilinear
Cb_auto = imresize(Cb, 0.5, 'bilinear', 'Antialiasing', false);
Cr_auto = imresize(Cr, 0.5, 'bilinear', 'Antialiasing', false);
or
%4:2:0 conversion of YCbCr using inbuilt command with bilinear
Cb_auto = imresize(Cb, 0.25, 'bilinear', 'Antialiasing', false);
Cr_auto = imresize(Cr, 0.25, 'bilinear', 'Antialiasing', false);
Why i have this doubt is that i read like 4:2:2 samples chroma at 1/2th the luma samples.
Whereas 4:2:0 samples chroma at 1/4th the luma samples.
Help is appreciated!
Accepted Answer
More Answers (0)
Categories
Find more on Images in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!