what percentage of reduction in image size resulting from switching from the YCvCr colour space to RGB ?

1 次查看(过去 30 天)
what percentage of reduction in image size resulting from switching to the YCvCr colour space to RGB ?

回答(1 个)

DGM
DGM 2022-5-17
编辑:DGM 2022-5-17
If we're talking about "size" as in geometry (i.e. number of pixel elements), then if the YCbCr is not downsampled, then the image channels have the same number of elements before and after conversion. If the YCbCr image is subject to chroma subsampling, then there are fewer elements in the Cb and Cr channels. After conversion to RGB, the image will have more elements than it did when it was YCbCr.
If we're talking about "size" as in memory, then it depends on how it was converted, and again, whether chroma subsampling was used. If no subsampling is used and the same numeric class is used, then the two images will have the same size in memory.
Argb = imread('peppers.png');
Aycc = rgb2ycbcr(Argb); % this is uint8 with no subsampling
Argb2 = ycbcr2rgb(Aycc); % this is also uint8
whos Aycc
Name Size Bytes Class Attributes Aycc 384x512x3 589824 uint8
whos Argb2
Name Size Bytes Class Attributes Argb2 384x512x3 589824 uint8
If we're talking about images in files, I think it's safe to say that the most common numeric class for either type is uint8, though the varied methods of compression across different image formats kind of makes the comparison moot.
TL;DR: The channels of an RGB image are represented with equal spatial resolution, but the channels of a YCbCr image may have unequal spatial resolution.
If you're referring to some other aspect of the images, you'll have to clarify.
  3 个评论
Walter Roberson
Walter Roberson 2022-5-17
Sometimes when people talk about YCbCr, they are talking about formats that pack multiple fields at the bit level. For example, using 8 bits for Y and 4 bits for Cb and 4 bits for Cr, for a total of 16 bits (2 bytes). That would then be expected to expand to R G B at 8 bits each, total of 24 bits.
DGM
DGM 2022-5-18
编辑:DGM 2022-5-18
ITU-R BT601 discusses subsampling to some degree. MATLAB's rgb2ycbcr()/ycbcr2rgb() have no convenient options to support it directly, but that's probably just because it would be problematic in an environment where the common workflows center around images as rectangular arrays.
YCbCr is commonly subsampled. That possibility is one of the advantages of using a color model that allows you to separate brightness and color information. Every JPG image that MATLAB saves is 4:2:0 chroma subsampled. Digital video files encoded using "YUV" don't actually use YUV; they use YCbCr -- and it should be easy to find subsampled video.
I don't pretend to be familiar with the possible conventions for how the data is actually shoved into a file. There's a reason I was talking vaguely about "elements" instead of height and width. It doesn't really much make sense to talk about an image's height and width when its channels have different numbers of elements.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Import, Export, and Conversion 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by