Halcon Photoshop and how not to hurt its image sharpening color color

 

Sharpening an image is an important step in the photography operation.

Sharpening is purified by color sharpening purposes. Once the over-sharpening, photos can easily unnatural spots, color or overflow effect occurs.

 

We in Photoshop "USM sharpening filters" for example :( To make the effect is obvious, I use a larger value sharpening)

 

 

Sharpen result: can be found in the nose, brows, upper lip skin above all there is a clear yellow color. This is caused by excessive sharpening color stain or spill.

 

If we copy the layer of the original image, and then after sharpening layer blending mode to " lightness " and found sharpening results are as follows:

 

Can be found in the nose, brows, upper lip just above the skin of some brighter yellow color is gone. Look and feel better than the pictures on the map.

 

We know that the image's color space can be converted to each other, for example, can be converted from RGB mode Lab mode (color space), Lab channels a and b channels contain color information, but contains only the L-channel brightness (details) Information , so that a sharp image is particularly suitable for the L-channel .

We can first image converted from RGB mode Lab mode, the sharpening Lab L channel, and then back to RGB mode. Thus, the sharpening process is to minimize the damage to the color.

 

Photoshop can achieve this sharpening process, in fact, Halcon is also available. code show as below:

 1 *Image是待锐化图像
 2 read_image (Image, 'C:/Users/02/Desktop/ruihua.jpg')
 3 
 4 *将Image分解为R G B三个通道,并转化为LAB色彩空间
 5 decompose3 (Image, R, G, B)
 6 trans_from_rgb (R, G, B, L, A, B, 'cielab')
 7 
 8 *增强对比度,锐化边缘(锐化的是细节通道L,L通道只含细节,不含色彩 9 emphasize (L, Emphasize_L, 7, 7, 1.5)
10 
11 *将锐化以后的L通道,联同A、B通道,再重新合成一张RGB空间图像。
12 trans_to_rgb (Emphasize_L, A, B, ImageRed, ImageGreen, ImageBlue, 'cielab')
13 *ImageSharp即为最终锐化以后的图(色彩不受影响)
14 compose3 (ImageRed, ImageGreen, ImageBlue, ImageSharp)

 

锐化结果:

 

当然Halcon的锐化结果和Photoshop的锐化结果是不完全一致的,毕竟两者的锐化算法肯定不一样。本文旨在于让大家对图像的色彩空间有更深的了解,并且了解到一些锐化技巧。

 

 

参考资料:Lab颜色模型_百度百科

 

Guess you like

Origin www.cnblogs.com/xh6300/p/12103464.html