I am converting RGB to YCBCR image but reverse is not working.

조회 수: 3 (최근 30일)
Balkar Singh
Balkar Singh 2021년 8월 16일
댓글: Walter Roberson 2021년 8월 16일
I want to convert RGB image to YCBCR by using rgb2ycbcr, it is working but when I am using ycbcr2rgb to get back image then it is now converting properly.
  댓글 수: 2
Simon Chan
Simon Chan 2021년 8월 16일
Do you mean the function is not working which cannot generate an image for you? Or the generated RGB image has pixel values which are not exactly the same as the original RGB image?
Balkar Singh
Balkar Singh 2021년 8월 16일
You are right, pixel value are not exactly the same as the orginal value.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2021년 8월 16일
The below images would show color if there was notable difference between the original image and the reconstructed image. But there isn't -- the maximum change during the reconstruction process is 2 out of 256.
imgrgb = imread('flamingos.jpg');
imgy = rgb2ycbcr(imgrgb);
imgrgb2 = ycbcr2rgb(imgy);
max(abs(double(imgrgb) - double(imgrgb2)),[],'all')
ans = 2
imshowpair(imgrgb(:,:,1), imgrgb2(:,:,1));
imshowpair(imgrgb(:,:,2), imgrgb2(:,:,2));
imshowpair(imgrgb(:,:,3), imgrgb2(:,:,3));
  댓글 수: 2
Balkar Singh
Balkar Singh 2021년 8월 16일
But due to some loss, I am not able to extract the watermark image properly.
Walter Roberson
Walter Roberson 2021년 8월 16일
Then you need to use a more robust watermark.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Balkar Singh
Balkar Singh 2021년 8월 16일
You are right, pixel value are not exactly the same as the orginal value.
  댓글 수: 2
Image Analyst
Image Analyst 2021년 8월 16일
Some rounding errors will occur during a round trip when you are converting integers to floating point and then back again.
Balkar Singh
Balkar Singh 2021년 8월 16일
Please consider the example given by Walter Roberson, what i have to add in that example.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by