Image enhancement algorithm to the dithering algorithm

                               Image enhancement algorithm to the dithering algorithm

Color display capability of LCD panel, is usually used in each color channel, the liquid crystal display panel can be used to describe the number of gradation bits. Each point of the LCD by R, G, B three-channel display, first of all affect the color bits are different LCD drive IC used, 6bit driving IC capable of displaying 64 gradations, and the driver IC can be displayed 8bit 256 shades of gray. The more gray, indicating that the panel can display color of the more, the more expressive detail and level. If to be displayed on each color channel 256 ( 2^{8}= 256) gray scale levels, 16.7M displayable colors, it is called 8bit panel, which is the true color panel; For most applications, such as portable device dummy TFT panel equipped with small size and low-end desktop LCD LCD, is employed 6bit or less bits. While, the dummy TFT panel may reduce cost, and can reduce the maximum driver IC driving the large ones, thereby reducing the design difficulty in viewing angle and contrast, and other aspects, however, due to a substantial reduction in the number of the color display (panel physically 6bit colors can be displayed 8bit 2% less than the panel), in the performance of the image is often associated with significant gradients stepped stripes, great impact on the display. Dither processing commonly used in the image output device can simultaneously display a gray level limited occasions, it can increase the number of true color and pseudo-color gray scale panel monochrome panel, it has been proved to quantized color image enhanced very effective.

For a more intuitive understand why only false-color image display in many display applications, the bitmap conceptual cut incorporated herein be interpreted in the application bit planes of the image display. Generally provided for each pixel in the image represented by 8bit, i.e., true color image, assuming that the image plane is composed of eight 1bit, ranging from a least significant bit plane of bit 0 to the most significant bit 7 bit plane. In 8bit byte, the least significant bit plane 0 contains pixels in the image, and contains the most significant bit plane 7. Figure 4-1 illustrate these concepts, Figure 4-3 shows the various bit plane 4-2 depicted in FIG. Note that the higher order bits (especially the top four) contains the most important data visually. Other bit planes have an effect on the image for more minute details. The digital image is decomposed into bit planes, it is useful for the relative importance of each bit in the image analysis, which is a pixel of a secondary decision quantization bits adequacy process. Thus, in many cases less demanding on the show, just use a higher bit-planes can show most of the information in an image, and thus lose some image detail, therefore, appear 65536 ( 2^{16}) and 262144 colors ( ) 2^{20}color display and other common applications. 

4.1 halftone processing algorithm theory

Halftone technology used in the printing industry for more than a century, used in digital output device also has more than 40 years, is now widely used to print, print, display devices, and a compressed digital image storage, image transmission and other fields.

The basic functions of the halftone processing to be achieved is to eliminate the stepped fringes due to non-continuous tone output image caused, so as to achieve the effect of color-enhanced images, and effectively eliminate block effects inherent defect image, image smoother, soft, to further improve image quality. Employing algorithms largely determines the quality of the output image, the system configuration can be achieved to realize the size and cost. Color image enhancement algorithms and techniques more, substantially suitable algorithms may be selected according to the user's design requirements.

Digital halftoning techniques are based on visual characteristics and image characteristics of the coupler of the human eye, using a computer and other mathematical tools to achieve an image reproduction technology on the binary or multi binary equipment device, the continuous tone image is processed then outputting basic research to achieve tone reproduction of an image.

纵览数字半色调技术的研究,总的趋势是:对灰度图像而言,都是对已有的方法进行改进和整合;对彩色图像而言,多数是结合彩色图像的特点将处理灰度图像的方法用于彩色图像的再现。

从规则抖动(ordered dithering)、误差扩散(error diffusion)、蓝噪声半色调(blue noise halftoning)、点扩散(dot diffusion)、DBS(direct binary search)、LUT(look-up-table)半色调到AM/FM 半色调等方法,可以看出,数字半色调技术的原理并没有改变,主要是将量化后的误差尽可能地扩散到与之相邻的像素上,使得再现图像与原图像的误差尽可能的小,它将随着计算机技术、数字图像处理技术以及数学算法的灵活运用而不断地提高。

目前工业上应用最广泛和成熟的半色调算法就是抖动算法和误差扩散法,以下将详细给出这两类算法的分析和比较。

4.1.1 规则抖动

规则抖动是指在抖动过程中使用一个周期性的、确定的抖动矩阵,而这里所指的抖动矩阵也可以称为抖动模板。规则抖动中应用较为广泛的是Bayer 抖动、Clustered-dot 半色调和Dispersed-dot 半色调。而后两种主要由于算法的自身特性,主要应用于打印设备,而本文我们主要研究的是可用于LCD 显示的Bayer 抖动。

Bayer 抖动实质上就是像素值与其抖动矩阵中的相应的阈值比较。具体来说,就是把根据不同抖动位数选定的抖动矩阵置于目标图像的子区域内,使得该区域内的每一个像素与抖动矩阵中的每一个阈值一一对应起来。

下面以一个简单的2bit 抖动为例,对Bayer 抖动算法进行阐述,并最终给出针对不同抖动位数的Bayer 抖动矩阵。

对于一个2×2 像素块的颜色,如果只有两种选择,假设要么所有像素全为红色,要么像素值全为0,这样在视觉效果上也就仅有上述的两种情况。但是如果在这四个像素中有两个值为红色,另两个值为0,这样将会产生一种红色一半亮度的视觉效果,同理,共可产生5 级灰度,如图4-5 所示。

这个过程可用图4-6来说明。假定在2×2 像素块中每一个像素对应一个8bit 的数据,但输出设备只能使用高6位,因此如果没有抖动过程的支持,低两位将会被丢失。考虑任意的8bit 像素值A8h(1010_1000),其高6 位用16 进制数“2A”表示,如果不用抖动,像素值A9h(1010_1001)、AAh(1010_1010)、ABh(1010_1011)将显示和A8h 同样的像素值“2Ah”。而像素值ACh(1010_1100)有不同的高六位,所以ACh 比A8h 有更高的亮度。因此如果不加抖动处理,仅能精确显示A8h 和ACh。移除低两位,这些值将分别为“2Ah”或“2Bh”。

抖动处理为“丢失”的像素值A9h、AAh、ABh 提供了显示的方法,通过显示合并的2×2 的像素块的值来加以实现,该像素块内的平均强度就是“丢失”的值,如图4-6 所示。为了给最大强度值留有余地,ABh 不作任何变换,A8h、A9h、AAh 则通过抖动算法进行修改。

低2 位的抖动只有四种矩阵供选择,如图4-6 的“情况 1”至“情况4”。抖动矩阵中“0”表示对应位置的输入值不作任何改变,“1”表示对应位置的输入值将减弱到下一个可以显示的值。可将上述四种情况综合为图4-7 中“2bit 抖动矩阵”的抖动矩阵,其中像素位置的数字表示低2 位:00 = blank,01 =“1”,10 =“2”,11 =“3”。

如果输入像素值低2 位为“00”,只有与抖动矩阵中空白处对应的像素强度值不变,其余3 个都减弱到下一个可显示的像素值;

若输入像素值低2 位为“01”,与抖动矩阵中空白及标有“1”的位置的像素点值保持不变,其余2 个都减弱到下一个可显示的像素值;

若输入像素值低2 位为“11”,四个像素点都保持输入值不变。以上过程是2bit 抖动的算法,对于1bit,3bit,4bit 抖动的抖动矩阵见图4,其算法与2bit 抖动算法类似。

4.1.2 误差扩散

误差扩散技术主要思想是,一旦一个像素点被量化后,它就存在误差,这些误差将影响到它周围的像素点。这种由误差而影响其周围的量化的像素点就被称作为扩散,这意味着这个误差被分成很多组分从而加到了临近像素的灰度值上。通过误差的扩散,系统处于自我修正状态的负反馈系统。

误差扩散的数字半色调算法,最先由Floyd 等人提出。这种算法是一种邻域处理过程,它将当前像素的量化误差按一定比例扩散到相邻的像素上。因此,局部的量化误差对相邻像素点而言是一种补偿,使得误差扩散系统具有自校正的能力。而且,能够保证在总体上,在处理前后图像的总灰度或总色彩数相一致。

误差扩散算法的核心是一个对量化误差进行频谱整形的数字滤波器,目前最具代表性的是Floyd 和Steinberg 所设计的滤波器(以下简称为FS 滤波器),该滤波器在量化误差为白噪声时的应用效果最为理想。由于对彩色图像进行颜色量化属于多值量化过程(即所谓的多色调处理),上述FS 滤波器的理想应用条件—量化噪声为白噪声无法满足,因此,直接使用FS 滤波器进行多色调误差扩散虽可以在一定程度上提高量化图像的质量,但处理后的彩色图像在某种程度上仍然存在图案化、颗粒噪声以及伪轮廓等影响图像质量的问题。

FS filter structure shown in Figure 4-9, n-currently processed pixel, 0 pixel processed g1, g2, g3, g4 for the unprocessed pixel, the filter impulse response g1 = 7/16, g2 = 1/16, g3 = 5/16, g4 = 3/16, to which the filtering process is currently processed pixel quantization error of the above-described transmission weight to an unprocessed pixel. Firstly, comparing the dot gradation value x with a threshold value, referred to as the dot 1 or 0, i.e., white or black, then the calculation error, the error distribution point to the surrounding, the modification gray values ​​of the surrounding points. The filtering algorithm is applied to the error of x to the right of 7/16 as a first point, the first error is 3/16 on a left of the dot applied to the next row, 5/16 of the error is added to the next line of the positive like point, the first point of the next 1/16 applied to the right row error, so the error distributed to the image point x on the image surrounding points. This process is repeated for each image point in the image is thus a halftone gradation of the correction values ​​and, finally to obtain a half-tone picture reflects the hierarchy.

In addition to the Floyd-Steinberg filter, many scholars have also been proposed other types of filters. Its filter matrix shown in Figure 4-10. As it can be seen from Fig. 4-10, similar to other forms of filter structure and filter FS, except that a different number of diffusion points involved. In general the more error diffusion points, the display image may be possible, but the calculation speed and the greater the hardware overhead.

 

Published 49 original articles · won praise 138 · Views 300,000 +

Guess you like

Origin blog.csdn.net/lz0499/article/details/101622016