Matching Colors of Source Image to Target Image

5 ビュー (過去 30 日間)
cona mx
cona mx 2018 年 4 月 26 日
コメント済み: cona mx 2018 年 4 月 27 日
Hi. I want to match colors of source image to target image.
Source and reference images are identical with same resolution, aside from the color. (Actually, target image is a graded version of source image)
Here is the source image:
Here is the target image:
So far what I did is:
  • -Converted source and target images to LAB color space
Now, I'm not sure how to proceed from here.
  • -Shall I go with histogram matching in LAB (not sure how to do it)
  • -Calculate deltaE between each pixel, calculate mean etc (also not sure how to do it)
  • -Use any other Color Space such as LCH
Please help me regarding this...
  2 件のコメント
Walter Roberson
Walter Roberson 2018 年 4 月 26 日
What do you mean by matching colors in this case? Are you looking for a linear transform in rgb, or in LAB? Looking for a curve of hue correction? A look up table of original and target colours?
Is it assumed that any given source color is always matched to the same target color?
cona mx
cona mx 2018 年 4 月 27 日
Yes exactly, my aim is to create a look up table of original and target colours.

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

採用された回答

Walter Roberson
Walter Roberson 2018 年 4 月 27 日
[old_colors, old_idx] = unique(reshape(Original_Image, [], 3), 'rows');
reshaped_new = reshape(New_Image, [], 3);
new_colors = reshaped_new(old_idx, :);
The lookup table is then that each row of old_colors is matched to the corresponding row of new_colors .
This assumes that any given source color is always matched to the same target color.
  4 件のコメント
Walter Roberson
Walter Roberson 2018 年 4 月 27 日
Yes.
Note: rgb2lab() always produces double even for uint8 source, and lab2rgb() of that will produce double, with the round trip being equivalent to im2double(). Also I notice that the result of lab2rgb can be slightly negative due to round-off error such as for (0,242,65). However, if you im2uint8() the result of the round trip, then that will be identical to the original RGB.
cona mx
cona mx 2018 年 4 月 27 日
okay, thank you very much for your patience and support.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by