影像科学与光化学 ›› 2019, Vol. 37 ›› Issue (2): 146-155.DOI: 10.7517/issn.1674-0475.181205

• 综述与论文 • 上一篇    下一篇

基于分通道自适应匹配的梯度保持色彩迁移算法

于艺铭, 王琪, 张琪, 陈茜, 王小菊   

  1. 南京林业大学 轻工与食品学院, 江苏 南京 210037
  • 收稿日期:2018-12-15 修回日期:2019-01-09 出版日期:2019-03-15 发布日期:2019-03-15
  • 通讯作者: 王琪
  • 基金资助:
    国家自然科学基金项目(31270629)资助

Gradient-preserving Color Transfer Algorithm Based on Multi-channel Adaptive Matching

YU Yiming, WANG Qi, ZHANG Qi, CHEN Xi, WANG Xiaoju   

  1. College of Light Industry and Food Engineering, Nanjing Forestry University, Nanjing 210037, Jiangsu, P. R. China
  • Received:2018-12-15 Revised:2019-01-09 Online:2019-03-15 Published:2019-03-15

摘要: 本文针对经典Welsh与Reinhard算法进行改进,提出一种基于分通道自适应匹配的梯度保持色彩迁移算法。引入L、a、b三通道作为匹配依据,因通道间的序列不相关,对单一通道进行处理时不会影响到另外两通道,消除了RGB颜色模式中单一目标区域易受多通道影响的弊端;对整体灰度值相近的图像,将色度均值差异最大的待处理区与背景区通道及参考图像对应通道进行自适应匹配,解决了Welsh算法对灰度差异小或灰度范围重叠的彩色源图像分级易造成误判的问题。然后引入梯度因子,同参考图像与源图像标准差比值作加权运算,将结果作为本文改进迁移算法的缩放比例系数,对匹配到的每组像素采用保持梯度的色彩迁移算法进行着色,避免了Reinhard算法易出现色彩细节信息丢失、阶调间过渡不自然等问题。实验证明,本文改进算法所得目标图像的彩色化效果均优于经典Welsh与Reinhard算法,极大提升了色彩迁移算法的灵活性与适用性。

关键词: 图像处理, 序列不相关性, 分通道自适应匹配法, 保持梯度的色彩迁移法, 改进的结构相似度指数法

Abstract: In this paper, a gradient-preserving color transfer algorithm based on multi-channel adaptive matching is proposed to improve the classical Welsh algorithm and Reinhard algorithm. L, a and b channels are introduced as matching criteria, the processing of a single channel will not affect the other two channels because of the sequence irrelevance between channels, eliminating the drawbacks of single target region in RGB color mode that is vulnerable to multi-channel influence. For images with similar gray values, the channel with the largest difference in the mean chromaticity between the processing area and the background area is adaptively matched with the corresponding channel of the reference image, which solves the problem that Welsh algorithm can easily misjudge the grading of color source images with small gray differences or overlapping gray ranges. Then, gradient factor is introduced and weighted with the standard deviation ratio of reference image to source image. The result is taken as the scaling ratio coefficient of the improved transfer algorithm in this paper. Gradient-preserving color transfer algorithm is used to color each group of matched pixels to avoid the problems of loss of color detail information and unnatural transition between tones in Reinhard algorithm. Experiments show that the color effect of the improved algorithm is better than that of the classical Welsh algorithm and Reinhard algorithm, which greatly improves the flexibility and applicability of the color transfer algorithm.

Key words: image processing, sequence irrelevance, multi-channel adaptive matching algorithm, gradient-preserving color transfer algorithm, improved structural similarity index algorithm