图片中的颜色匹配

8
我有两张图片(切片),由两个相机传感器拍摄完成一张图片。然而,由于传感器性能的差异,它们的颜色/色调不同,我需要匹配它们以制作一个统一的图像。
我使用了Fiji(Image J)中包含的HistogramMatcher函数,如这里所解释的那样,将第二张图像的颜色与第一张匹配。它给出了一个可接受的结果,但仍需要进一步处理。
所以我的问题是,有哪些最好的方法来获得一个统一的图像呢?我应该从亮度、色调再到饱和度开始吗?还有除了“HistogramMatcher”函数之外的其他匹配颜色的方法吗?
下面是一张图片的示例。

enter image description here

2个回答

9
我把你的图片分成了两部分,然后使用了scikit-image的直方图匹配函数:

enter image description here enter image description here

#!/usr/bin/env python3

import numpy as np
from skimage.io import imread, imsave
from skimage import exposure
from skimage.transform import match_histograms

# Load left and right images
L = imread('rocksA.png')
R = imread('rocksB.png')

# Match using the right side as reference
matched = match_histograms(L, R, multichannel=True)

# Place side-by-side and save
result = np.hstack((matched,R))
imsave('result.png',result)

这将得到以下结果:

在此输入图像描述


5
为了对比,我有两个Imagemagick bash shell脚本,可以将一个图像的颜色转移到另一个图像。(请参见http://www.fmwconcepts.com/imagemagick/index.php)。其中一个是通过颜色直方图匹配进行颜色匹配,另一个是通过匹配均值和标准偏差(即亮度和对比度)进行颜色调整。
我将使用Mark Setchell的分离图像。 输入

enter image description here enter image description here

直方图匹配:

histmatch -c rgb right.png left.png newleft_histmatch.png

convert newleft_histmatch.png right.png +append result_histmatch.png


enter image description here

平均值/标准差匹配:

matchimage -c rgb left.png right.png newleft_matchimage.png

convert newleft_matchimage.png right.png +append result_matchimage.png


enter image description here

针对使用均值和标准差进行颜色转移的Python/OpenCV解决方案,请参见https://www.pyimagesearch.com/2014/06/30/super-fast-color-transfer-images/


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接