CN-121982119-A - Four-color electronic paper color high-contrast processing algorithm
Abstract
The invention discloses a four-color electronic paper color high contrast processing algorithm, which relates to the technical field of electronic paper display technology and image processing, and comprises the specific steps of firstly extracting features, transferring an original RGB image to an HSV space, counting the pixel occupation ratio of a brightness interval, screening red and yellow pixels, and calculating the features and the four types of color occupation ratios; the method comprises the steps of generating a dynamic clustering center, generating an intermediate image through weighted clustering mapping, enhancing the saturation and boundary contrast of an adaptive image through linkage, outputting modularized adaptive data, converting optimal data of a scheme into a 2-bit format, and outputting the data after verification.
Inventors
- WANG WEIAN
- WEI GUOYING
Assignees
- 南京观海微电子有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260209
Claims (10)
- 1. The high-contrast processing algorithm for the four-color electronic paper is characterized by comprising the following specific steps of: s1, extracting characteristics, namely acquiring an original RGB image to be displayed, converting the original RGB image into an HSV color space, counting the pixel duty ratio of dark part, middle part and bright part in a brightness channel, screening red and yellow pixels in the image based on preset color judgment conditions, and calculating channel statistical characteristics of the red and yellow pixels; S2, generating a dynamic clustering center, namely generating a self-adaptive dynamic initial clustering center for black, white, red and yellow according to the brightness interval duty ratio, the red and yellow pixel channel characteristics and the four types of color duty ratios obtained in the step S1; s3, weighted clustering mapping, namely setting the clustering category number as 4, calculating the distance between each pixel in the original image and each dynamic initial clustering center by adopting a four-color dynamic visual weighted distance algorithm, classifying the pixels according to a minimum distance principle, and mapping each pixel into one of black, white, red and yellow four colors after iteratively updating the clustering center for fixed times to generate a four-color intermediate image; S4, linkage enhancement adaptation, namely generating a boundary mask based on the four-color intermediate image, adopting a four-color multi-factor linkage enhancement algorithm, and carrying out self-adaptive enhancement on the saturation and boundary contrast of the image by combining the brightness distribution data obtained in the step S1; And S5, modularly adapting and outputting, namely selecting a corresponding scheme from preset modularized processing schemes according to the computational power specification of target hardware, the use environment and the image characteristics extracted in the step S1, performing final optimization on the image data processed in the step S4, converting the image data into a 2-bit pixel data format compatible with an electronic paper driving chip, and outputting after verification.
- 2. The four-color electronic paper color high contrast processing algorithm according to claim 1, wherein in the feature extraction, the determination condition of the color pixels is that the red pixels satisfy And is also provided with And is also provided with Yellow pixels satisfying And is also provided with And is also provided with Black pixel satisfying And is also provided with And is also provided with White pixels satisfying And is also provided with And is also provided with Wherein, the method comprises the steps of, The intensity values of the pixels in the red, green and blue color channels are respectively represented, and the range of the values is 0 to 255.
- 3. The four-color electronic paper color high contrast processing algorithm according to claim 1, wherein in the step S2 of generating the dynamic clustering center, a generation rule of the dynamic clustering center is as follows: The black center is generated by extracting dark pixels with brightness value V satisfying V <0.3, and calculating RGB average value When the dark part pixel ratio is more than 50%, the black center When the dark part pixel ratio is less than 20 percent, then Taking the maximum value of each RGB channel of the bright part pixel, when the dark part pixel accounts for 20-50% ; The white center is generated by extracting the bright part pixels with brightness value V meeting V >0.7 and calculating the RGB average value When the brightness pixel ratio is more than 50%, the white center And each channel value is not more than 255, when the brightness pixel ratio is less than 20%, the brightness pixel ratio is less than Taking the maximum value of each RGB channel of the bright pixel, when the bright pixel accounts for 20-50% ; The red center is generated by calculating RGB average value of red pixel when red pixel is more than 30 percent Red center And R channel value is not greater than 255, when red pixel ratio is less than 5%, then When the red pixel ratio is between 5% and 30% ; The yellow center is generated by calculating RGB mean value of yellow pixel when yellow pixel ratio is >30% Yellow center When the yellow pixel ratio is less than 5%, then When the yellow pixel ratio is between 5% and 30% 。
- 4. The four-color electronic paper color high contrast processing algorithm according to claim 1, wherein in the S3, weighted clustering mapping, the mathematical expression of the four-color dynamic visual weighted distance algorithm is: , wherein, Is the weighted distance value between the target pixel and the cluster center, 、 、 For the RGB values of the target pixel, 、 、 For the RGB values of the cluster center, Is the HSV luminance value of the target pixel, Is the HSV brightness value of the cluster center, For the red color channel to be dynamically weighted, For the dynamic weights of the G/B channels, The weights are adapted for the luminance and, The term is modified for visual perception.
- 5. The four-color electronic paper color high contrast processing algorithm according to claim 1, wherein in the step S3, the fixed iteration number of the weighted cluster mapping is 3, when the cluster center is updated in each iteration, the average value of all RGB channels mapped to pixels in the category in the current iteration is calculated for any one of the four categories of black, white, red and yellow, and is used as a new cluster center of the category, and when any one of the four categories is not mapped in the current iteration, the cluster center of the category retains the center value of the previous iteration.
- 6. The four-color electronic paper color high contrast processing algorithm according to claim 1, wherein in the S4, linkage enhancement adaptation, the mathematical expression of the four-color multi-factor linkage enhancement algorithm is: wherein In order to enhance the target parameters, which are the original parameters, As a basis for the enhancement factor(s), The coefficients are adapted for the clustering and, As a factor of the characteristic of the color, For the purpose of the illumination adaptation factor, For the boundary mask coefficients, Is a pixel-by-pixel multiplication operation.
- 7. The four-color electronic paper color high contrast processing algorithm according to claim 1, wherein in the S4, linkage enhancement adaptation, the boundary mask coefficient The generation rule of (1) is that when black and white pixels exist in eight neighborhoods of one pixel at the same time, then Otherwise, the brightness interval ratio obtained based on the S1 is 0.9, the brightness interval ratio of the illumination scene is a weak light scene when the dark part ratio is more than 40% and the bright part ratio is less than 30%, the brightness interval ratio is a strong light scene when the bright part ratio is more than 40% and the dark part ratio is less than 30%, and the rest conditions are conventional illumination scenes.
- 8. The four-color electronic paper color high contrast processing algorithm according to claim 1, wherein in the S5, the selection of the modularized adaptive output is based on the following steps: When the hardware calculation power specification is 8-bit MCU and the calculation power is not more than 10MIPS, generating an initial clustering center by adopting a downsampling strategy, and using a group of predefined fixed enhancement parameters; when the hardware calculation power specification is 32-bit MCU and the calculation power is not lower than 50MIPS, adopting a dynamic iteration termination condition, and determining whether to start a complete illumination self-adaptive logic according to the fluctuation range of the ambient illumination intensity; The finally output 2-bit pixel data is encoded according to the rule that black is mapped into a two-bit binary code 00, white is mapped into a code 01, yellow is mapped into a code 10, and red is mapped into a code 11, and is packaged into a byte stream for output.
- 9. An image processing apparatus comprising at least one processor and a memory storing a computer program which, when executed by the processor, implements the four-color electronic paper color high contrast processing algorithm of any one of claims 1 to 8.
- 10. A computer readable storage medium, wherein a computer program is stored on the storage medium, and when the computer program is executed by a processor, the computer program implements the four-color electronic paper color high contrast processing algorithm according to any one of claims 1 to 8.
Description
Four-color electronic paper color high-contrast processing algorithm Technical Field The invention relates to the technical field of electronic paper display technology and image processing, in particular to a four-color electronic paper color high-contrast processing algorithm. Background The electronic paper has been widely applied to fields such as electronic reading, intelligent terminal display, public information release and the like by virtue of core advantages such as low power consumption, paper-like visual experience, no blue light radiation and the like, along with continuous upgrading of display technology, single black-and-white display can not meet the requirements of users on rich information bearing and visual expression, four-color electronic paper gradually becomes an important direction of industry development because of being capable of presenting more color layers, improving information transmission efficiency, a color processing algorithm is used as a core support of the display effect of the four-color electronic paper, the color reduction degree, contrast and visual comfort of images are directly influenced, the performance quality of the four-color electronic paper determines the application experience of the four-color electronic paper in various scenes, the display quality requirements of the four-color electronic paper in the market are continuously improved at present, the algorithm is required to be accurately adapted to the display characteristics of the electronic paper, the environmental suitability and the hardware compatibility under different application scenes are required, and the relevant image processing technology is driven to be continuously and iteratively optimized. The traditional four-color electronic paper related image processing technology has various limitations, the high-requirement display requirement is difficult to meet, in a color clustering link, most technologies adopt a fixed clustering center, the self-adaptive adjustment cannot be carried out according to the brightness distribution, the color ratio and other self characteristics of an input image, the color classification accuracy is insufficient, the problems of color distortion, hierarchy ambiguity and the like are easy to occur, in the weighted calculation process, an equalization weight or simple fixed weight mode is often adopted, the differentiated influence of different color channels and brightness information on visual perception is ignored, the differentiation degree of visual key information is lower, in an enhancement processing stage, the optimization is carried out by a single factor, the multi-dimensional information linkage adjustment of image boundary characteristics, environment illumination conditions and the like is not combined, the display effect stability is poor, the boundary details are fuzzy, the saturation is unbalanced, meanwhile, the traditional algorithm lacks a flexible hardware adaptation mechanism, the compatibility of hardware platforms with different calculation specifications is difficult, or the operation efficiency is low on low-calculation-force equipment, or the application scene of four-color electronic paper is limited. Disclosure of Invention The invention aims to make up the defects of the prior art, provides a four-color electronic paper color high-contrast processing algorithm, firstly extracts the color and brightness characteristics of an original image, then generates a self-adaptive dynamic clustering center according to the characteristics, then completes pixel four-color mapping by adopting a dynamic visual weighted distance algorithm, combines multi-factor linkage to enhance the saturation and boundary contrast of the image, finally selects a modularized scheme according to hardware computing power and use environment, and outputs standardized data of a compatible driving chip. The algorithm greatly improves the color rendition degree and the visual contrast of the four-color electronic paper through multi-dimensional feature adaptation and dynamic optimization, simultaneously gives consideration to compatibility of different hardware platforms and complex environment adaptability, and provides a display solution with high quality and high suitability for various electronic paper terminals. The invention provides a four-color electronic paper color high contrast processing algorithm for solving the technical problems, which comprises the following specific steps: s1, extracting characteristics, namely acquiring an original RGB image to be displayed, converting the original RGB image into an HSV color space, counting the pixel duty ratio of dark part, middle part and bright part in a brightness channel, screening red and yellow pixels in the image based on preset color judgment conditions, and calculating channel statistical characteristics of the red and yellow pixels; S2, generating a dynamic clustering center, namely generating a self-adaptive