How to adjust the brightness of an image in YCbCr color space

9 ビュー (過去 30 日間)
warnerchang
warnerchang 2022 年 4 月 8 日
コメント済み: warnerchang 2022 年 4 月 8 日
anyone know how to adjust the brightness of an image in YCbCr color space?

採用された回答

DGM
DGM 2022 年 4 月 8 日
編集済み: DGM 2022 年 4 月 8 日
You'd do it the same way you'd do it on any other image, only you'd operate on the Y component alone.
That said, "adjust the brightness" is a bit vague. Depending on what you want to accomplish, you should be able to start with imadjust(). There are other tools.
Again, depending on what you want to do, you may wind up pushing pixels out of gamut in the process. For severe cases, you may find parts of the image migrating toward saturated colors. Consider the example:
inpict = imread('peppers.png');
outpict = rgb2ycbcr(inpict); % convert to YCbCr
outpict(:,:,1) = outpict(:,:,1) + 33; % shift Y
outpict = ycbcr2rgb(outpict); % convert back to RGB
imshow(outpict)
This simple operation pushes colors out of gamut; the truncation upon conversion back to RGB ends up oversaturating certain areas (the yellow and orange regions). As a consequence, the luma in those regions is not increased by the specified amount. The same color adjustment would look like this if luma were actually preserved:
Which is appropriate depends on what your goals and your workflow are.
  1 件のコメント
warnerchang
warnerchang 2022 年 4 月 8 日
Thank you so much. And I tried this, it was really helpful!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by