An electronic price tag text image pixel processing method, device, equipment and medium

By extracting and processing the brightness values ​​of pixels at the edges of text in electronic price tags, determining the blending direction and search distance, the jagged edge problem under the resolution limitations of electronic paper is solved, achieving a smoother and more natural font display effect.

CN118115380BActive Publication Date: 2026-07-07HANSHOW TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANSHOW TECH CO LTD
Filing Date
2024-03-01
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

In existing technologies, the resolution limitations of electronic paper mean that the jagged edge processing methods for text cannot meet the usage requirements, affecting the aesthetics and readability of the text.

Method used

By extracting font edge pixels from the text image of the electronic price tag to be processed, selecting reference pixels, determining the edge direction, and determining the brightness mixing direction based on the brightness value and the brightness value of auxiliary pixels, a search is performed to obtain the mixing factor and brightness value, and the pixel processing result is obtained by mapping, thereby improving the display clarity and smoothness.

Benefits of technology

It achieves a smooth transition effect on the font edges of text images on electronic price tags, improving display clarity and smoothness, eliminating jagged edges, and enhancing the natural aesthetics of the text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118115380B_ABST
    Figure CN118115380B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an electronic price tag text image pixel processing method, device, equipment and medium. The method comprises: extracting font edge pixel points from the electronic price tag text image to be processed, selecting reference pixel points from adjacent pixel points, and determining the edge direction and brightness mixing direction of the font edge pixel points; performing negative direction and positive direction search according to the position and brightness mixing direction of the font edge pixel points, determining the mixing factor of the font edge pixel points according to the obtained negative search distance, positive search distance and preset balance factor, determining the mixed brightness value of the font edge pixel points according to the mixing factor, the brightness value of the font edge pixel points and the brightness value in the brightness mixing direction, and mapping the pixel processing result of the electronic price tag text image to be processed according to the mixed brightness value and the gray scale color supported by the electronic price tag image. The pixel is processed in gray scale according to the mixed brightness value in the brightness mixing direction, so as to improve the display clarity and smoothness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, apparatus, device and medium for processing text image pixels on electronic price tags. Background Technology

[0002] Compared to traditional LCD screens, e-ink displays use microcapsules suspended in a liquid to display images and text. E-ink displays consume less power, better reproduce the display effect of paper, remain clearly visible even in sunlight, and cause less eye strain. They are widely used in devices such as e-readers, smartwatches, smart tags, and electronic shelf labels. However, due to the resolution limitations of e-paper, fonts often exhibit jagged edges, affecting the aesthetics and readability of the text.

[0003] In existing technologies, the jagged edges of text are processed by adjusting each initial pixel to its corresponding target pixel based on the initial pixels in the jagged layer data and the grayscale mapping relationship determined by visual configuration parameters. However, the existing technology still cannot meet the usage requirements for processing jagged edges of text. Summary of the Invention

[0004] This invention provides a method, apparatus, device, and medium for processing the pixels of text images on electronic price tags, thereby improving display clarity and smoothness, making the edges of the text images on electronic price tags exhibit a smooth transition effect, making the displayed text smoother and more natural, and achieving an anti-aliasing effect.

[0005] In a first aspect, embodiments of the present invention provide a method for processing pixel images of text on electronic price tags, the method comprising:

[0006] Extract font edge pixels from the text image of the electronic price tag to be processed, select reference pixels from the adjacent pixels for the font edge pixels, and use the brightness values ​​of the font edge pixels and the reference pixels to determine the edge direction of the font edge pixels; wherein, the edge direction of the font edge pixels is either vertical or horizontal.

[0007] Based on the edge direction of the font edge pixels, negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction are selected from the adjacent pixels. The brightness blending direction of the font edge pixels is determined by the brightness values ​​of the negative auxiliary pixels, the positive auxiliary pixels, and the font edge pixels. The brightness blending direction can be either negative or positive.

[0008] The negative and positive search directions are performed by using the position and brightness mixing direction of the pixels at the edge of the font, respectively, to obtain the negative search pixels and the positive search pixels, until the search stops, and the negative search distance and the positive search distance are obtained respectively.

[0009] The blending factor of the font edge pixels is determined based on the negative search distance, positive search distance, and preset balance factor. The blending brightness value of the font edge pixels is determined based on the blending factor, brightness value, and brightness value in the brightness blending direction of the font edge pixels. The pixel processing result of the electronic price tag text image is obtained by mapping the blending brightness value and the grayscale colors supported by the electronic price tag image.

[0010] Secondly, embodiments of the present invention also provide an electronic price tag text image pixel processing device, the device comprising:

[0011] The edge direction determination module is used to extract font edge pixels from the text image of the electronic price tag to be processed, select reference pixels from adjacent pixels for the font edge pixels, and determine the edge direction of the font edge pixels using the brightness value of the font edge pixels and the brightness value of the reference pixels; wherein, the edge direction of the font edge pixels is either vertical or horizontal.

[0012] The blending direction determination module is used to select negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction from adjacent pixels based on the edge direction of the font edge pixels. The brightness blending direction of the font edge pixels is determined by using the brightness values ​​of the negative auxiliary pixels, the brightness values ​​of the positive auxiliary pixels, and the brightness values ​​of the font edge pixels. The brightness blending direction can be either negative or positive.

[0013] The search distance determination module is used to perform negative and positive searches based on the position and brightness mixing direction of the font edge pixels, respectively, to obtain negative search pixels and positive search pixels until the search stops, and to obtain negative search distance and positive search distance respectively.

[0014] The blending result mapping module is used to determine the blending factor of the font edge pixels based on the negative search distance, the positive search distance, and the preset balance factor. It also determines the blended brightness value of the font edge pixels based on the blending factor, the brightness value of the font edge pixels, and the brightness value in the brightness blending direction of the font edge pixels. Based on the blended brightness value and the grayscale colors supported by the electronic price tag image, it maps the pixel processing result of the electronic price tag text image to be processed.

[0015] Thirdly, embodiments of the present invention also provide an electronic device, comprising:

[0016] At least one processor; and

[0017] A memory that is communicatively connected to at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform an electronic price tag text image pixel processing method according to any embodiment of the present invention.

[0019] Fourthly, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, enable the computer processor to execute any of the electronic price tag text image pixel processing methods provided in the embodiments of the present invention.

[0020] This invention extracts font edge pixels from an electronic price tag text image, selects reference pixels from adjacent pixels for the font edge pixels, and determines the edge direction of the font edge pixels using the brightness values ​​of the font edge pixels and the reference pixels; wherein the edge direction of the font edge pixels is either vertical or horizontal; based on the edge direction of the font edge pixels, negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction are selected from adjacent pixels, and the brightness mixing direction of the font edge pixels is determined using the brightness values ​​of the negative auxiliary pixels, the positive auxiliary pixels, and the font edge pixels; wherein... The brightness blending direction is either negative or positive. Searches are performed in both negative and positive directions using the position of the font edge pixels and the brightness blending direction, respectively, to obtain negative and positive search pixels until the search stops, yielding negative and positive search distances. The blending factor of the font edge pixels is determined based on the negative and positive search distances and a preset balance factor. The blended brightness value of the font edge pixels is then determined based on the blending factor, brightness value, and brightness value along the brightness blending direction. The pixel processing result of the electronic price tag text image is mapped using the blended brightness value and the grayscale colors supported by the electronic price tag image. The technical solution provided by this invention, based on the determined blended brightness value of the font edge pixels and performing grayscale processing on the pixels of the electronic price tag text image along its brightness blending direction, improves display clarity and smoothness, resulting in a smooth transition effect for the font edges of the electronic price tag text image, making the displayed font smoother and more natural, and achieving an anti-aliasing effect.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a method for processing text image pixels on an electronic price tag according to Embodiment 1 of the present invention;

[0024] Figure 2A This is a flowchart of another method for processing text image pixels on an electronic price tag according to Embodiment 2 of the present invention;

[0025] Figure 2B This is an effect diagram of a method for processing text images pixels on an electronic price tag according to Embodiment 2 of the present invention;

[0026] Figure 2C This is an effect diagram of a method for processing text images pixels on an electronic price tag according to Embodiment 2 of the present invention;

[0027] Figure 3 This is a schematic diagram of the structure of an electronic price tag text image pixel processing device according to Embodiment 3 of the present invention;

[0028] Figure 4 This is a schematic diagram of the structure of an electronic device for processing text image pixels of an electronic price tag according to Embodiment 4 of the present invention. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0031] Furthermore, it should be noted that the collection, storage, use, processing, transmission, provision, and disclosure of relevant data involved in the technical solution of this invention all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0032] Example 1

[0033] Figure 1 This is a flowchart of a method for processing the pixel of text images on electronic price tags according to Embodiment 1 of the present invention. This embodiment is applicable to the processing of pixels of text images on electronic price tags. The method can be executed by an electronic price tag text image pixel processing device, which can be implemented in hardware and / or software. The electronic price tag text image pixel processing device can be configured in an electronic device, such as a terminal device or a server, etc. The present invention does not limit this.

[0034] like Figure 1 As shown in the figure, an embodiment of the present invention provides a method for processing the pixel dimensions of text images on electronic price tags, which specifically includes the following steps:

[0035] S110. Extract font edge pixels from the text image of the electronic price tag to be processed, select reference pixels from adjacent pixels for font edge pixels, and determine the edge direction of font edge pixels by using the brightness value of font edge pixels and the brightness value of reference pixels; wherein, the edge direction of font edge pixels is either vertical or horizontal.

[0036] Specifically, in response to the need to determine the edge direction of font edge pixels from the text image of the electronic price tag to be processed, font edge pixels can be pre-extracted from the text image of the electronic price tag to be processed. Then, for any font edge pixel among the extracted font edge pixels, a corresponding reference pixel can be selected from the adjacent pixels of the font edge pixel. The brightness value of the font edge pixel and the brightness value of the corresponding reference pixel are used to determine the edge direction of the font edge pixel. The edge direction of the font edge pixel can be a vertical direction or a horizontal direction.

[0037] In determining the brightness value of a pixel, an exemplary method could be to establish a two-dimensional coordinate system for the electronic price tag text image to be processed. Since the method for determining the brightness value of any pixel is the same, for clarity and conciseness, the following example only illustrates the method for determining the brightness value of a single pixel. First, determine the coordinate position (x, y) of the pixel in the two-dimensional coordinate system, and obtain the values ​​of the pixel in the R, G, and B channels. Then, determine the brightness value of the pixel according to the following formula:

[0038] luma (x,y) =a·R (x,y) +β·G (x,y) +γ·B (x,y) ;

[0039] Wherein, α, β, and γ are the weighting factors of the pixel on the R, G, and B channels, respectively. It should be noted that when determining the brightness value of any pixel, the weighting factors α, β, and γ are all fixed values; that is, the values ​​of weighting factors α, β, and γ are empirical values. For example, the values ​​of α, β, and γ are 0.299, 0.587, and 0.114, respectively. Furthermore, the values ​​of weighting factors α, β, and γ can be empirical values ​​or dynamically changed; that is, the corresponding weighting factor values ​​are different for different pixels. This embodiment of the invention does not limit the values ​​of weighting factors α, β, and γ. In particular, the above method for determining the brightness value of a pixel is only one exemplary scheme, and this embodiment of the invention does not limit the method for determining the brightness value of a pixel.

[0040] It should be noted that when extracting font edge pixels from the text image of the electronic price tag to be processed, the extraction method can be to use a deep learning algorithm to determine the pixels in the electronic price tag text image that meet the edge pixel determination criteria as font edge pixels in the text image to be processed. Specifically, this embodiment of the invention does not limit the extraction method selected when extracting font edge pixels from the text image of the electronic price tag to be processed. Furthermore, when selecting a reference pixel from adjacent pixels based on any extracted font edge pixel, the selected reference pixel can be at least one of the nine adjacent pixels centered on the font edge pixel. This embodiment of the invention does not limit the number of reference pixels selected when selecting reference pixels based on adjacent pixels. It is understood that this embodiment of the invention does not limit the determination method selected when using the brightness value of the font edge pixel and the brightness value of the reference pixel to determine the edge direction of the font edge pixel.

[0041] By extracting font edge pixels from the text image of the electronic price tag to be processed, selecting reference pixels from adjacent pixels for the font edge pixels, and using the brightness values ​​of the font edge pixels and the reference pixels to determine the edge direction of the font edge pixels, the edge direction of the font edge pixels can be determined. The edge direction of the font edge pixels can be either vertical or horizontal, so that subsequent work can be carried out based on the extracted font edge pixels. That is, selecting reference pixels for the font edge pixels, and then using the brightness values ​​of the font edge pixels and the reference pixels to determine the edge direction of the font edge pixels, and then carrying out subsequent work after determining the edge direction of the font edge pixels.

[0042] S120. Based on the edge direction of the font edge pixels, select negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction from the adjacent pixels. Use the brightness values ​​of the negative auxiliary pixels, the brightness values ​​of the positive auxiliary pixels, and the brightness values ​​of the font edge pixels to determine the brightness blending direction of the font edge pixels; wherein, the brightness blending direction is either the negative direction or the positive direction.

[0043] Specifically, based on the edge direction of the font edge pixels, auxiliary pixels can be selected from adjacent pixels for the font edge pixels. That is, negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction are selected for the font edge pixels. Then, the brightness mixing direction of the font edge pixels is determined by the brightness values ​​of the negative auxiliary pixels, the brightness values ​​of the positive auxiliary pixels, and the brightness values ​​of the font edge pixels. The brightness mixing direction is either negative or positive.

[0044] It should be noted that, continuing from the example in S110, when selecting negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction from adjacent pixels based on the edge direction of the font edge pixels, the described negative and positive directions can be manually specified. For example, they can be determined based on the positive and negative directions of the x and y axes of the established two-dimensional coordinate system. That is, upward and leftward directions can be defined as negative directions in the two-dimensional coordinate system, while downward and rightward directions are positive directions. Therefore, for any font edge pixel in the two-dimensional coordinate system, the positive and negative directions of that font edge pixel are the positive and negative directions defined in the two-dimensional coordinate system. To facilitate understanding, the following examples illustrate this: If the edge direction of a font edge pixel is horizontal, selecting a negative auxiliary pixel from its adjacent pixels in the negative direction means that the pixel directly to the left of the font edge pixel is its negative auxiliary pixel; similarly, selecting a positive auxiliary pixel from its adjacent pixels in the positive direction means that the pixel directly to the right of the font edge pixel is its positive auxiliary pixel. If the edge direction of a font edge pixel is vertical, selecting a negative auxiliary pixel from its adjacent pixels in the negative direction means that the pixel directly above the font edge pixel is its negative auxiliary pixel; similarly, selecting a positive auxiliary pixel from its adjacent pixels in the positive direction means that the pixel directly below the font edge pixel is its positive auxiliary pixel.

[0045] In summary, for any font edge pixel, based on its edge direction, the negative and positive auxiliary pixels can be determined. Then, based on the brightness values ​​of the negative and positive auxiliary pixels and the font edge pixel, the brightness blending direction can be determined. It can be understood that the brightness blending direction can be either negative or positive. Specifically, when determining the brightness blending direction based on the brightness values ​​of the negative and positive auxiliary pixels and the font edge pixel, this embodiment of the invention does not limit the method for determining the selected brightness blending direction.

[0046] Based on the edge direction of the font edge pixels, negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction are selected from adjacent pixels. The brightness blending direction of the font edge pixels is then determined using the brightness values ​​of the negative auxiliary pixels, the positive auxiliary pixels, and the font edge pixels. The brightness blending direction can be either negative or positive. This determined brightness blending direction facilitates subsequent processing.

[0047] S130. Search in the negative and positive directions respectively using the position and brightness mixing direction of the font edge pixels to obtain negative search pixels and positive search pixels until the search stops, and obtain the negative search distance and positive search distance respectively.

[0048] S140. Determine the blending factor of the font edge pixels based on the negative search distance, positive search distance, and preset balance factor. Determine the blended brightness value of the font edge pixels based on the blending factor, brightness value, and brightness value in the brightness blending direction of the font edge pixels. Map the pixel processing result of the electronic price tag text image to be processed based on the blended brightness value and the grayscale colors supported by the electronic price tag image.

[0049] Specifically, based on the position and brightness mixing direction of the font edge pixels, searches are performed in both negative and positive directions to obtain corresponding search results, namely, negative search pixels and positive search pixels. The search stops when the search stopping condition is met, at which point the corresponding negative and positive search distances are determined. Based on the determined negative and positive search distances and a preset balance factor, the mixing factor of the font edge pixels is determined. Then, based on the determined mixing factor, brightness value, and brightness value of the font edge pixels in the brightness mixing direction, the mixed brightness value of the font edge pixels is determined. Finally, based on the mixed brightness value and the grayscale colors supported by the electronic price tag image, the pixel processing result of the electronic price tag text image to be processed is obtained. In particular, in this embodiment of the invention, the processing method selected when processing the pixels of the electronic price tag text image based on the determined information is not limited.

[0050] The search is performed in both negative and positive directions based on the position and brightness blending direction of the font edge pixels, until the search stops, yielding the negative and positive search distances respectively. The blending factor of the font edge pixels is determined based on the negative and positive search distances and a preset balance factor. The blended brightness value of the font edge pixels is then determined based on the blending factor, brightness value, and brightness value along the brightness blending direction. Finally, the pixel processing result of the electronic price tag text image is mapped using the blended brightness value and the grayscale colors supported by the electronic price tag image, thereby improving the display clarity and smoothness of the electronic price tag text image.

[0051] Optionally, extract font edge pixels from the text image of the electronic price tag to be processed, select reference pixels from adjacent pixels for the font edge pixels, and determine the edge direction of the font edge pixels using the brightness values ​​of the font edge pixels and the reference pixels. This includes: obtaining the brightness values ​​of the original pixels in the text image of the electronic price tag to be processed; taking the pixels at the top, bottom, left, and right positions of the adjacent pixels as positive reference pixels; for any pixel in the original pixels, determining the brightness contrast value of the pixel based on the brightness value of the pixel and the brightness value of the positive reference pixels; and selecting a brightness value from the brightness contrast value of the pixel and the brightness value of the positive reference pixels. The maximum value is determined by using the preset minimum brightness threshold, maximum brightness threshold, and maximum brightness value to determine the edge brightness threshold of the pixel. The edge brightness threshold of the pixel and the brightness comparison value of the pixel are used to determine whether the pixel belongs to the font edge pixel. For any font edge pixel, the adjacent pixels located at the top left, bottom left, top right, and bottom right of the font edge pixel are used as diagonal reference pixels. The brightness value of the font edge pixel and the brightness value of the diagonal reference pixels are used to determine the horizontal edge tendency coefficient and vertical edge tendency coefficient of the font edge pixel, respectively. The edge direction of the font edge pixel is determined by the horizontal edge tendency coefficient and the vertical edge tendency coefficient.

[0052] Specifically, when determining the edge direction of the pixels at the edge of the font, one possible implementation method is to obtain the brightness values ​​of the original pixels in the text image of the electronic price tag to be processed, and take the pixels at the top, bottom, left, and right positions adjacent to each other as positive reference pixels. For any pixel in the original pixels, the brightness contrast value C of the pixel can be determined based on the brightness value of the pixel and the brightness value of the positive reference pixels. The brightness contrast value can be determined by selecting the maximum and minimum brightness values ​​of the pixel and the positive reference pixels, and taking the difference between the maximum and minimum brightness values ​​as the brightness contrast value C of the pixel. This embodiment of the invention does not limit the method of determining the brightness contrast value C of the pixel.

[0053] When determining the edge brightness threshold of a pixel, an exemplary method is to first calculate the product between the maximum selected brightness value and a preset maximum brightness threshold, then compare the calculated product with a minimum brightness threshold, and select the maximum value as the edge brightness threshold of the pixel. The edge brightness threshold and the brightness comparison value C of the pixel are used to determine whether the pixel belongs to the font edge pixel. This embodiment of the invention does not limit the method for determining whether a pixel belongs to the font edge pixel. For any font edge pixel luma... (x,y) Specifically, the top-left, bottom-left, top-right, and bottom-right adjacent pixels of the font edge pixel are used as diagonal reference pixels. These diagonal reference pixels can be lumaLeftCorners, lumaRightCorners, lumaUpCorners, and lumaDownCorners. The horizontal edge tendency coefficient (edge) of the font edge pixel is determined using the brightness values ​​of the font edge pixel and the diagonal reference pixels. h and vertical edge tendency coefficient edge v When this is the case, you can refer to the following formula:

[0054]

[0055]

[0056] Specifically, the diagonal reference pixels lumaLeftCorners are obtained by summing the top-left and bottom-left adjacent pixels of the font edge pixels; the diagonal reference pixels lumaRightCorners are obtained by summing the top-right and bottom-right adjacent pixels of the font edge pixels; the diagonal reference pixels lumaUpCorners are obtained by summing the top-left and bottom-right adjacent pixels of the font edge pixels; and the diagonal reference pixels lumaDownCorners are obtained by summing the bottom-left and top-right adjacent pixels of the font edge pixels.

[0057] When determining the edge direction of font edge pixels using horizontal and vertical edge tendency coefficients, one could specifically compare the horizontal edge tendency coefficients. h and vertical edge tendency coefficient edge v The larger of the two edge tendency coefficients is selected as the edge direction of the font edge pixels. The edge direction of the font edge pixels can be either vertical or horizontal.

[0058] This invention extracts font edge pixels from an electronic price tag text image, selects reference pixels from adjacent pixels for the font edge pixels, and determines the edge direction of the font edge pixels using the brightness values ​​of the font edge pixels and the reference pixels; wherein the edge direction of the font edge pixels is either vertical or horizontal; based on the edge direction of the font edge pixels, negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction are selected from adjacent pixels, and the brightness mixing direction of the font edge pixels is determined using the brightness values ​​of the negative auxiliary pixels, the positive auxiliary pixels, and the font edge pixels; wherein... The brightness blending direction is either negative or positive. Searches are performed in both negative and positive directions using the position of the font edge pixels and the brightness blending direction, respectively, to obtain negative and positive search pixels until the search stops, yielding negative and positive search distances. The blending factor of the font edge pixels is determined based on the negative and positive search distances and a preset balance factor. The blended brightness value of the font edge pixels is then determined based on the blending factor, brightness value, and brightness value along the brightness blending direction. The pixel processing result of the electronic price tag text image is mapped using the blended brightness value and the grayscale colors supported by the electronic price tag image. The technical solution provided by this invention, based on the determined blended brightness value of the font edge pixels and performing grayscale processing on the pixels of the electronic price tag text image along its brightness blending direction, improves display clarity and smoothness, resulting in a smooth transition effect for the font edges of the electronic price tag text image, making the displayed font smoother and more natural, and achieving an anti-aliasing effect.

[0059] Example 2

[0060] Figure 2A This is a flowchart of another method for processing text image pixels on electronic price tags provided in Embodiment 2 of the present invention. The technical solution of the present invention is further optimized based on the above-mentioned optional technical solutions.

[0061] Furthermore, the process of "selecting negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction from adjacent pixels based on the edge direction of the font edge pixels, and determining the brightness mixing direction of the font edge pixels using the brightness values ​​of the negative auxiliary pixels, the positive auxiliary pixels, and the font edge pixels" is further refined to "For any horizontal font edge pixel, adjacent pixels located directly above and below are selected as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction, respectively; for any vertical font edge pixel, adjacent pixels located directly above and below are selected as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction, respectively." The left and right adjacent pixels are respectively designated as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction. The negative gradient value of the font edge pixel in the negative direction is determined using the brightness value of the negative auxiliary pixels in the negative direction and the brightness value of the font edge pixel. Similarly, the positive gradient value of the font edge pixel in the positive direction is determined using the brightness value of the positive auxiliary pixels in the positive direction and the brightness value of the font edge pixel. Finally, the brightness blending direction of the font edge pixel is determined using both the negative gradient value in the negative direction and the positive gradient value in the positive direction, thereby improving display clarity and smoothness. It should be noted that parts not described in this embodiment can be referred to in other embodiments, and will not be repeated here.

[0062] like Figure 2A As shown in the figure, another method for processing electronic price tag text image pixels provided by an embodiment of the present invention specifically includes the following steps:

[0063] S210. Extract font edge pixels from the text image of the electronic price tag to be processed, select reference pixels from adjacent pixels for font edge pixels, and determine the edge direction of font edge pixels by using the brightness value of font edge pixels and the brightness value of reference pixels; wherein, the edge direction of font edge pixels is either vertical or horizontal.

[0064] S220. For any horizontal font edge pixel, the adjacent pixels located above and below are respectively designated as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction.

[0065] S230. For any vertical font edge pixel, the adjacent pixels located to the left and right are respectively designated as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction.

[0066] Specifically, the process involves extracting font edge pixels from the text image of the electronic price tag, selecting reference pixels from adjacent pixels, and determining the edge direction of the font edge pixels using the brightness values ​​of the font edge pixels and the reference pixels. The edge direction of the font edge pixels can be either vertical or horizontal. For any font edge pixel with a horizontal edge direction, the reference pixels are the pixels directly above and below it. Specifically, the pixels directly above are defined as negative auxiliary pixels in a negative direction, and the pixels directly below are defined as positive auxiliary pixels in a positive direction. For any font edge pixel with a vertical edge direction, the reference pixels are the pixels directly to its left and right. Specifically, the pixels directly to its left are defined as negative auxiliary pixels in a negative direction, and the pixels directly to its right are defined as positive auxiliary pixels in a positive direction.

[0067] It should be noted that the determination of the negative and positive directions in the embodiments of the present invention is based on establishing a two-dimensional coordinate system with the pixel at the top left corner of the electronic price tag text image as the origin. Therefore, the positive direction of the x-axis is the positive right direction of the origin, and the positive direction of the y-axis is the positive downward direction of the origin. Thus, in the technical solutions described in the embodiments of the present invention, the negative and positive directions are based on this defined direction, and will not be elaborated further.

[0068] It is understandable that, for any horizontal font edge pixel, the adjacent pixel directly above the font edge pixel is the negative auxiliary pixel in the negative direction, and the adjacent pixel directly below the font edge pixel is the positive auxiliary pixel in the positive direction. For any vertical font edge pixel, the adjacent pixel directly to the left of the font edge pixel is the negative auxiliary pixel in the negative direction, and the adjacent pixel directly to the right of the font edge pixel is the positive auxiliary pixel in the positive direction.

[0069] The text image of the electronic price tag is used to extract the font edge pixels. Reference pixels are selected from adjacent pixels to represent the font edge pixels. The edge direction of the font edge pixels is determined using the brightness values ​​of the font edge pixels and the reference pixels; the edge direction can be vertical or horizontal. Therefore, for any font edge pixel in either a horizontal or vertical direction, negative and positive auxiliary pixels can be determined to facilitate subsequent processing based on the brightness values ​​of the font edge pixels and the determined negative and positive auxiliary pixels.

[0070] S240. Using the brightness values ​​of negative auxiliary pixels in the negative direction and the brightness values ​​of the font edge pixels, determine the negative gradient value of the font edge pixels in the negative direction, and using the brightness values ​​of positive auxiliary pixels in the positive direction and the brightness values ​​of the font edge pixels, determine the positive gradient value of the font edge pixels in the positive direction.

[0071] Specifically, by using the brightness values ​​of negative auxiliary pixels in the negative direction and the brightness values ​​of the font edge pixels, the negative gradient value of the font edge pixels in the negative direction can be determined. Similarly, by using the brightness values ​​of positive auxiliary pixels in the positive direction and the brightness values ​​of the font edge pixels, the positive gradient value of the font edge pixels in the positive direction can be determined. In particular, this embodiment of the invention does not limit the method for determining the negative and positive gradient values ​​of the font edge pixels.

[0072] Optionally, the negative gradient value of the font edge pixel in the negative direction is determined by using the brightness value of the negative auxiliary pixel in the negative direction and the brightness value of the font edge pixel in the positive direction, and the positive gradient value of the font edge pixel in the positive direction is determined by using the brightness value of the positive auxiliary pixel in the positive direction and the brightness value of the font edge pixel in the positive direction, including: taking the adjacent pixels directly to the left and directly above the font edge pixel as the negative auxiliary pixels in the negative direction, and taking the adjacent pixels directly to the right and directly below the font edge pixel as the positive auxiliary pixels in the positive direction; taking the difference between the brightness value of the negative auxiliary pixels in the negative direction and the brightness value of the font edge pixel as the negative gradient value in the negative direction; and taking the difference between the brightness value of the positive auxiliary pixels in the positive direction and the brightness value of the font edge pixel as the positive gradient value in the positive direction.

[0073] Specifically, for any font edge pixel, when determining the negative and positive gradient values ​​of the font edge pixel, the adjacent pixels directly to the left and above the font edge pixel can be used as negative auxiliary pixels in the negative direction, and the adjacent pixels directly to the right and below the font edge pixel can be used as positive auxiliary pixels in the positive direction. The difference between the brightness value of the negative auxiliary pixels in the negative direction and the brightness value of the font edge pixel can be used as the negative gradient value in the negative direction. The difference between the brightness value of the positive auxiliary pixels in the positive direction and the brightness value of the font edge pixel can be used as the positive gradient value in the positive direction.

[0074] In one specific implementation, the difference between the brightness value luma1 of the negative auxiliary pixel in the negative direction and the brightness value lumaCenter of the font edge pixel can be used as the negative gradient value gradient1 of the font edge pixel in the negative direction. Similarly, the difference between the brightness value luma2 of the positive auxiliary pixel in the positive direction and the brightness value lumaCenter of the font edge pixel can be used as the positive gradient value gradient2 of the font edge pixel in the positive direction, as detailed in the following formula.

[0075] gradient1=luma1-lumaCenter;

[0076] gradient2=luma2-lumaCenter;

[0077] Let the brightness value of the pixel at the edge of the font be lumaCenter, the pixel directly to the left of the pixel at the edge of the font be lumaLeft, the pixel directly to the right of the pixel at the edge of the font be lumaRight, the pixel directly above the pixel at the edge of the font be lumaUp, and the pixel directly below the pixel at the edge of the font be lumaDown. It can be understood that the negative auxiliary pixels of the pixel at the edge of the font in the negative direction are lumaLeft and lumaUp; similarly, the positive auxiliary pixels of the pixel at the edge of the font in the positive direction are lumaRight and lumaDown. Therefore, for the formulas used to determine the negative gradient value gradient1 and the positive gradient value gradient2, the values ​​of luma1 and luma2 should be determined by the edge direction of the pixel at the edge of the font. That is, if the edge direction of the pixel at the edge of the font is horizontal, then the value of luma1 when determining the negative gradient value of the pixel at the edge of the font should be lumaUp, and the value of luma2 when determining the positive gradient value of the pixel at the edge of the font should be lumaDown. Similarly, if the edge direction of the font edge pixel is a vertical edge, then the value of luma1 for determining the negative gradient value of the font edge pixel should be lumaLeft, and the value of luma2 for determining the positive gradient value of the font edge pixel should be lumaRight. See Table 1 below for details on the values ​​of luma1 and luma2 in different positive and negative directions, as well as in different edge directions.

[0078] Table 1 shows the possible values ​​for luma1 and luma2:

[0079] Different values ​​of luma1 and luma2 Horizontal edge Vertical edge In the negative direction, luma1 lumaUp lumaLeft In the positive direction, luma2 lumaDown lumaRight

[0080] By using the brightness values ​​of negative auxiliary pixels in the negative direction and the brightness values ​​of the pixels at the edge of the font, the negative gradient value of the pixels at the edge of the font in the negative direction is determined. By using the brightness values ​​of positive auxiliary pixels in the positive direction and the brightness values ​​of the pixels at the edge of the font, the positive gradient value of the pixels at the edge of the font in the positive direction is determined, so that subsequent work can be carried out based on the negative gradient value and the positive gradient value determined at this time.

[0081] S250. Using the negative gradient value of the font edge pixel in the negative direction and the positive gradient value of the font edge pixel in the positive direction, determine the brightness mixing direction of the font edge pixel.

[0082] Among them, the direction of brightness mixing is either negative or positive.

[0083] Specifically, when determining the brightness blending direction of the font edge pixels based on the negative gradient value in the negative direction and the positive gradient value in the positive direction, this embodiment of the invention does not limit the method of determining the selected brightness blending direction. The brightness blending direction can be either a negative or a positive direction.

[0084] In one optional implementation, when determining the brightness blending direction of a font edge pixel, the negative gradient value of the font edge pixel in the negative direction can be compared with the positive gradient value in the positive direction, and the direction with the larger gradient value can be taken as the brightness blending direction of the font edge pixel. That is, if the negative gradient value is greater than the positive gradient value, the brightness blending direction of the font edge pixel is the negative direction corresponding to the negative gradient value; conversely, the brightness blending direction of the font edge pixel can be determined accordingly. The brightness blending direction can be either negative or positive. Specifically, this embodiment of the invention does not limit the method for determining the brightness blending direction of font edge pixels.

[0085] The brightness blending direction of the font edge pixels is determined by using the negative gradient value in the negative direction and the positive gradient value in the positive direction. The brightness blending direction can be either negative or positive to facilitate subsequent processing based on the determined brightness blending direction of the font edge pixels.

[0086] S260. The negative and positive search directions are performed using the position and brightness mixing direction of the font edge pixels respectively to obtain the negative search pixels and the positive search pixels until the search stops, and the negative search distance and the positive search distance are obtained respectively.

[0087] Specifically, by using the position and brightness mixing direction of the font edge pixels to perform negative and positive searches respectively, the corresponding negative search pixels and positive search pixels can be obtained. When the search stopping condition is met, the search stops, and then the negative search distance and positive search distance can be obtained.

[0088] Optionally, the search is performed in the negative and positive directions using the position and brightness blending direction of the font edge pixels, respectively, to obtain negative search pixels and positive search pixels until the search stops, and the negative search distance and positive search distance are obtained respectively. This includes: determining the blending position of the font edge pixels using the coordinates of the font edge pixels and the unit pixel offset of the font edge pixels in the brightness blending direction; using the blending position of the font edge pixels as the starting point, searching along the negative direction of the font edge pixels with a preset step size to obtain negative search pixels until the negative search stopping condition is met, and obtaining the negative search distance of the font edge pixels; using the blending position of the font edge pixels as the starting point, searching along the positive direction of the font edge pixels with a preset step size to obtain positive search pixels until the positive search stopping condition is met, and obtaining the positive search distance of the font edge pixels.

[0089] Specifically, in response to the requirement to determine the negative and positive search distances of font edge pixels, the following example illustrates the specific method for determining the negative search distance of font edge pixels. The mixing position of the font edge pixel is determined using its coordinates and unit pixel offset in the brightness mixing direction. Then, using this mixing position as the starting point, a search is performed along the negative direction of the font edge pixel with a preset step size to obtain the corresponding negative search pixel. This continues until the search stop condition in the negative direction is met, at which point the corresponding negative search distance is obtained. In particular, this embodiment of the invention does not restrict the unit pixel offset in the brightness mixing direction selected when determining the mixing position of the font edge pixel. Furthermore, this embodiment of the invention does not restrict the preset step size value, nor does it restrict the content of the search stop condition in the negative direction. Similarly, the method for determining the positive search distance of font edge pixels can refer to the method for determining the negative search distance of font edge pixels described above, and will not be repeated here. In particular, this embodiment of the invention does not restrict the methods for determining either the negative or positive search distance.

[0090] The method involves using the blending position of font edge pixels as the starting point, and searching along the negative direction of font edge pixels with a preset step size to obtain negative search pixels until the search stops in the negative direction, thus obtaining the negative search distance of font edge pixels. This includes: using the brightness value of the font edge pixel and the average brightness value of the font edge pixel in its brightness blending direction as the brightness reference average value of the font edge pixel; determining the blending position of the font edge pixel using the coordinates of the font edge pixel and the unit pixel offset of the font edge pixel in the brightness blending direction; and using the blending position as the starting point, searching along the negative direction of font edge pixels with a preset step size to obtain negative search pixels. Using the brightness value of the negative search pixel and the brightness value of the auxiliary pixel in the brightness mixing direction, determine the brightness search mean of the negative search pixel in the negative direction; determine the brightness mean difference between the brightness reference mean and the brightness search mean of the negative search pixel; select the maximum gradient value from the negative gradient value of the font edge pixel in the negative direction and the positive gradient value of the font edge pixel in the positive direction, and use the maximum gradient value and gradient coefficient to determine the pixel region gradient; based on the brightness mean difference and pixel region gradient of the font edge pixel, determine whether the font edge pixel meets the search stopping condition, and if the search stopping condition is met, obtain the negative search distance of the pixel.

[0091] Specifically, taking the determination of the negative search distance for font edge pixels as an example, the method of determination can be understood as follows: the brightness value of the font edge pixel and the average brightness value of the font edge pixel in its brightness mixing direction are used as the brightness reference average value of the font edge pixel. That is, continuing the example in S240, if the brightness mixing direction of the font edge pixel is negative, then the brightness reference average value lumaLocalAverage of the font edge pixel is the average of luma1 and lumaCenter. Similarly, if the brightness mixing direction of the font edge pixel is positive, then the brightness reference average value lumaLocalAverage of the font edge pixel is the average of luma2 and lumaCenter.

[0092] The blending position of a font edge pixel is determined by its coordinates and unit pixel offset in the brightness blending direction. Starting from this blending position, a search is performed along the negative direction of the font edge pixel with a preset step size to obtain a negative search pixel. In other words, the coordinates of the font edge pixel and the pixel with a unit pixel offset in the brightness blending direction are selected, and the midpoint between these two selected pixels is taken as the blending position, i.e., the search starting point. The search is then performed along the negative direction of the font edge pixel with a preset step size, which can be 1. Specifically, an iteration upper limit threshold (ITERATION) can be set for the preset step size; that is, the search is performed with a specific search step size without exceeding the iteration upper limit threshold. This embodiment of the invention does not restrict the value of the iteration upper limit threshold.

[0093] By using the luminance values ​​of the obtained negative search pixels and the luminance values ​​of the auxiliary pixels of the font edge pixels in the luminance mixing direction, the luminance search mean of the font edge pixels in the negative direction can be determined. Then, the luminance mean difference between the luminance reference mean and the luminance search mean of the font edge pixels can be determined. By selecting the maximum gradient value from the negative gradient values ​​of the font edge pixels in the negative direction and the positive gradient values ​​of the font edge pixels in the positive direction, and using the maximum gradient value and gradient coefficient, the pixel region gradient can be determined. Based on the luminance mean difference of the font edge pixels and the pixel region gradient, it can be determined whether the font edge pixels meet the search stopping condition. If the search stopping condition is met, the negative search distance of the pixel is obtained.

[0094] For example, based on the coordinates of the font edge pixels, the pixel at the step size `step` of the font edge pixels is the obtained search pixel, and the brightness value of this search pixel is `lumaStep`. For the brightness value of the auxiliary pixels in the blending direction of this search pixel, `lumaStepGradient`, the average brightness search value `lumaEnd` of the font edge pixels in the brightness blending direction can be determined, as shown in the formula below. Therefore, if the brightness blending direction is negative, the average brightness search value can be recorded as `lumaEnd1`, meaning `lumaEnd = lumaEnd1`; if the brightness blending direction is positive, the average brightness search value can be recorded as `lumaEnd2`, meaning `lumaEnd = lumaEnd2`.

[0095]

[0096] Taking a negative brightness mixing direction as an example, the brightness search mean is lumaEnd1. The difference in brightness mean between the negative search pixel's brightness reference mean lumaLocalAverage and the brightness search mean lumaEnd1 can be calculated. The maximum gradient value is selected from the negative gradient value gradient1 of the font edge pixel in the negative direction and the positive gradient value gradient2 of the font edge pixel in the positive direction. Using the maximum gradient value and the gradient coefficient, the pixel region gradient g is determined, as detailed in the following formula.

[0097] g=0.25×max{|gradient1|,|gradient2|};

[0098] Where gradient1 is the negative gradient value of the edge pixels of the font in the negative direction; gradient2 is the positive gradient value of the edge pixels of the font in the positive direction; 0.25 is the gradient coefficient; and g is the gradient of the pixel region.

[0099] In summary, by comparing the difference in brightness mean between the brightness reference mean lumaLocalAverage and the brightness search mean lumaEnd1 of the negative search pixels obtained at this time with the pixel region gradient, see the following formula:

[0100]

[0101] Based on the difference in the mean brightness of the pixels at the font's edge and the gradient of the pixel region, it is determined whether the pixels at the font's edge meet the search stopping condition. If the search stopping condition is met, the negative search distance of that pixel is obtained. In other words, if the formula shown above holds true, it means that the pixels at the font's edge meet the search stopping condition, and the negative search distance of that pixel can be obtained. It should be noted that the above explanation only uses a negative brightness mixing direction as an example. Similarly, the above method also applies to determining the positive search distance when the brightness mixing direction is positive, and will not be elaborated further here.

[0102] S270. Determine the blending factor of the font edge pixels based on the negative search distance, positive search distance and preset balance factor, and determine the blended brightness value of the font edge pixels based on the blending factor, brightness value and brightness value in the brightness blending direction of the font edge pixels. Map the pixel processing result of the electronic price tag text image to be processed based on the blended brightness value and the grayscale colors supported by the electronic price tag image.

[0103] Specifically, by searching in the negative and positive directions using the position and brightness mixing direction of the font edge pixels, corresponding negative and positive search pixels can be obtained. Then, when the search stops, the negative and positive search distances can be obtained respectively. In particular, this embodiment of the invention does not restrict the search stopping condition, and also does not restrict the method of determining the negative and positive search distances when the search stops. The mixing factor of the font edge pixels is determined based on the obtained negative and positive search distances and a preset balance factor. The mixed brightness value of the font edge pixels is determined based on the mixing factor, the brightness value of the font edge pixels, and the brightness value in the brightness mixing direction. Then, the pixel processing result of the electronic price tag text image to be processed can be obtained by mapping the mixed brightness value and the grayscale colors supported by the electronic price tag image.

[0104] It should be noted that after obtaining the negative and positive search distances, they can be summed to obtain the total search distance. Specifically, the calculated total search distance is compared with a preset edge length mixing threshold L to determine whether processing of the pixel is necessary. If the total search distance is greater than L, processing of the next font edge pixel begins, and the current operation stops; otherwise, the mixed brightness value of the font edge pixel is calculated. This embodiment of the invention does not impose any limitations on this process.

[0105] Optionally, the blending factor of the font edge pixels is determined based on the negative search distance, the positive search distance, and a preset balance factor. The blended brightness value of the font edge pixels is determined based on the blending factor, the brightness value of the font edge pixels, and the brightness value in the brightness blending direction. The pixel processing result of the electronic price tag text image is mapped based on the blended brightness value and the grayscale colors supported by the electronic price tag image. This includes: using the difference between the brightness value of the font edge pixels and the brightness reference mean of the font edge pixels as a first parameter; selecting the end closest to the edge of the font edge pixel from the positive and negative search pixels based on the position, negative search distance, and positive search distance, and using the brightness value of the search pixel at that end and the brightness value of the pixel in the brightness blending direction... The difference between the means is used as the second parameter; the minimum value of the negative search distance and the minimum value of the positive search distance of the font edge pixel are determined, and the total distance between the negative search distance and the positive search distance of the font edge pixel is determined. The ratio between the minimum value and the total distance is used as the third parameter; if the product of the first parameter and the second parameter is less than or equal to zero, the mixing factor of the font edge pixel is determined according to the third parameter and the preset balance factor; the mixing brightness value of the font edge pixel is determined using the mixing factor of the font edge pixel, the brightness value of the font edge pixel, and the brightness value in the brightness mixing direction of the font edge pixel; based on the mixing brightness value and the channel brightness value of the font edge pixel, the target gray level value is selected for the font edge pixel from the candidate gray level values ​​to obtain the pixel processing result of the electronic price tag text image to be processed.

[0106] Specifically, the blending factor of the font edge pixels is determined based on the negative search distance, the positive search distance, and the preset balance factor. The blending brightness value of the font edge pixels is determined based on the blending factor, the brightness value of the font edge pixels, and the brightness value in the brightness blending direction of the font edge pixels. Based on the blending brightness value and the grayscale colors supported by the electronic price tag image, the pixel processing result of the electronic price tag text image to be processed is obtained. For example, the difference between the brightness value of the font edge pixel and the average brightness reference value of the font edge pixel can be used as a first parameter; based on the position, negative search distance, and positive search distance of the font edge pixel, the end closer to the edge of the font edge pixel is selected from the positive and negative search pixels, and the difference between the brightness value of the search pixel at that end and the average brightness value of the pixels in the brightness mixing direction is used as a second parameter; the minimum value of the negative and positive search distances of the font edge pixel is determined, and the total distance between the negative and positive search distances of the font edge pixel is determined, and the ratio between the minimum value and the total distance is used as a third parameter; by comparing the product of the first and second parameters with zero, and if the product is less than or equal to zero, the mixing factor of the font edge pixel is determined according to the third parameter and a preset balance factor, which can be obtained by referring to the following formula.

[0107]

[0108] Where, lumaCenter is the brightness value of the pixels at the font edge; lumaLocalAverage is the average brightness reference value of the pixels at the font edge; lumaEndNearest is the brightness value of the pixel searched from the positive and negative search pixels based on the position, negative search distance, and positive search distance of the pixel at the font edge, that is, the average brightness value of the pixel at the closest point to the edge and the brightness value of the pixel in the brightness mixing direction at both ends of the edge; d nearest is the ratio between the minimum of the negative search distance and the positive search distance and the total search distance; u is the blending factor of the pixels at the edge of the font; K is the preset balance factor, which is the balance factor of the brightness blending factors in the negative and positive directions. This value can be an empirical value between 0 and 1. The larger the value, the greater the brightness blending ratio of the pixels in the desired pixel blending direction, and the smaller the value, the smaller the brightness blending ratio of the pixels in the desired pixel blending direction.

[0109] When determining the blended brightness value of the font edge pixels using the blending factor, brightness value, and brightness value in the blending direction of the font edge pixels, the blended brightness value finalLuma can be obtained by referring to the following formula.

[0110] finalLuma=(1-u)×lumaCenter+u×lumaGradient;

[0111] Here, lumaGradient represents the pixel brightness value of adjacent pixels along the blending direction of the font edge pixels. Based on the blending brightness value and channel brightness value of the font edge pixels, a target grayscale value is selected from the candidate grayscale values ​​to obtain the pixel processing result of the electronic price tag text image to be processed.

[0112] It should be noted that when processing the pixels of the text image on the electronic shelf label, the target grayscale value can be selected from the candidate grayscale values ​​based on the mixed brightness value and channel brightness value of the pixels at the edge of the text. For example, since electronic shelf labels support a limited number of grayscale colors, the brightness value {luma} can be calculated based on the supported grayscale colors {gray1, gray2, gray3, ...}, which are the candidate grayscale values, and the color values ​​in the R, G, and B channels. gray1 luma gray2 luma gray3 ...}, see the following formula for details:

[0113]

[0114] Here, CurrColor is the target grayscale value selected from the candidate grayscale values. Specifically, it is the grayscale color {gray1, gray2, gray3, ...} and the lightness value {luma} calculated from the color values ​​in the R, G, and B channels. gray1 luma gray2 luma gray3 The grayscale colors can be preset, and this embodiment of the invention does not impose any limitations on them. It should be noted that the candidate grayscale colors are not limited to different levels of gray, but can also be other transitional colors between different levels of foreground and background colors.

[0115] The effect diagrams generated based on the technical solutions described in the above embodiments of the present invention are detailed in [the following text is missing]. Figure 2B and Figure 2C The left image shows the result before processing, and the right image shows the result after processing using the technical solution described in this embodiment. It can be seen that it's not simply adding gray blocks to the edges of the font; rather, based on the calculated pixel blending brightness value, different shades of gray blocks are added where blending is needed, or the original black blocks are changed to gray blocks. The technical solution described in this embodiment can also be applied to image pixel processing including but not limited to Chinese characters, English letters, Arabic script, Japanese, and Russian script, all of which can achieve the same results. Figure 2B and Figure 2C The effect shown is illustrated. Similarly, the technical solutions described in the embodiments of the present invention can also be applied to pixel processing of electronic price tag text images with other foreground and background color combinations. That is to say, the image pixel processing method shown in this technical solution can also be applied to electronic price tag text images including but not limited to white background with black text, black background with white text, white background with red text, and yellow background with red text. The embodiments of the present invention do not limit the application scenarios of the provided technical solutions or the background color of electronic price tag text images.

[0116] This invention first acquires the brightness values ​​of the original pixels in the text image of the electronic price tag to be processed, and selects a positive reference pixel. For any pixel in the original image and the brightness value of the positive reference pixel, the brightness contrast value and edge brightness threshold of that pixel are determined, and then it is determined whether that pixel is a font edge pixel. For any font edge pixel, an oblique reference pixel is selected, and the edge direction of the font edge pixel is determined by the horizontal edge tendency coefficient and the vertical edge tendency coefficient. Based on the edge direction of the font edge pixel, negative auxiliary pixels and positive auxiliary pixels are determined, and the corresponding negative gradient values ​​and positive gradient values ​​are determined, thereby determining the brightness mixing direction. The position of the font edge pixel and the brightness mixing direction are used to perform negative and positive direction searches respectively, obtaining negative search pixels and positive search pixels until the search stops, and the negative search distance and positive search distance are obtained respectively. The mixing factor of the font edge pixels is determined based on the negative search distance, positive search distance, and a preset balance factor. The mixed brightness value of the font edge pixels is then determined based on the mixing factor, brightness value, and brightness value along the brightness mixing direction. Finally, based on the mixed brightness value and channel brightness value, a target grayscale value is selected from candidate grayscale values ​​to obtain the pixel processing result of the electronic price tag text image. The technical solution provided by this invention, based on the determined mixed brightness value of the font edge pixels and performing grayscale processing on the pixels of the electronic price tag text image along its brightness mixing direction, improves display clarity and smoothness, resulting in a smooth transition effect for the font edges of the electronic price tag text image, making the displayed font smoother and more natural, and achieving an anti-aliasing effect.

[0117] Example 3

[0118] Figure 3 This is a schematic diagram of the structure of an electronic price tag text image pixel processing device provided in Embodiment 3 of the present invention. Figure 3 As shown, the electronic price tag text image pixel processing device includes: an edge direction determination module 310, a mixing direction determination module 320, a search distance determination module 330, and a mixing result mapping module 340. Wherein:

[0119] The edge direction determination module 310 is used to extract font edge pixels from the text image of the electronic price tag to be processed, select reference pixels from adjacent pixels for the font edge pixels, and determine the edge direction of the font edge pixels using the brightness value of the font edge pixels and the brightness value of the reference pixels; wherein, the edge direction of the font edge pixels is either vertical or horizontal.

[0120] The blending direction determination module 320 is used to select negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction from adjacent pixels based on the edge direction of the font edge pixels, and to determine the brightness blending direction of the font edge pixels using the brightness values ​​of the negative auxiliary pixels, the brightness values ​​of the positive auxiliary pixels, and the brightness values ​​of the font edge pixels; wherein the brightness blending direction is either negative or positive.

[0121] The search distance determination module 330 is used to perform negative and positive searches based on the position and brightness mixing direction of the font edge pixels, respectively, to obtain negative search pixels and positive search pixels until the search stops, and to obtain negative search distance and positive search distance respectively.

[0122] The blending result mapping module 340 is used to determine the blending factor of the font edge pixels based on the negative search distance, the positive search distance and the preset balance factor, and to determine the blended brightness value of the font edge pixels based on the blending factor, the brightness value of the font edge pixels and the brightness value in the brightness blending direction of the font edge pixels. Based on the blended brightness value and the grayscale colors supported by the electronic price tag image, the pixel processing result of the electronic price tag text image to be processed is obtained.

[0123] This invention extracts font edge pixels from an electronic price tag text image, selects reference pixels from adjacent pixels for the font edge pixels, and determines the edge direction of the font edge pixels using the brightness values ​​of the font edge pixels and the reference pixels; wherein the edge direction of the font edge pixels is either vertical or horizontal; based on the edge direction of the font edge pixels, negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction are selected from adjacent pixels, and the brightness mixing direction of the font edge pixels is determined using the brightness values ​​of the negative auxiliary pixels, the positive auxiliary pixels, and the font edge pixels; wherein... The brightness blending direction is either negative or positive. Searches are performed in both negative and positive directions using the position of the font edge pixels and the brightness blending direction, respectively, to obtain negative and positive search pixels until the search stops, yielding negative and positive search distances. The blending factor of the font edge pixels is determined based on the negative and positive search distances and a preset balance factor. The blended brightness value of the font edge pixels is then determined based on the blending factor, brightness value, and brightness value along the brightness blending direction. The pixel processing result of the electronic price tag text image is mapped using the blended brightness value and the grayscale colors supported by the electronic price tag image. The technical solution provided by this invention, based on the determined blended brightness value of the font edge pixels and performing grayscale processing on the pixels of the electronic price tag text image along its brightness blending direction, improves display clarity and smoothness, resulting in a smooth transition effect for the font edges of the electronic price tag text image, making the displayed font smoother and more natural, and achieving an anti-aliasing effect.

[0124] Optionally, the mixing direction determination module 320 includes:

[0125] The horizontal auxiliary point determination unit is used to determine the adjacent pixels located above and below the font edge pixels in any horizontal direction as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction, respectively.

[0126] The vertical auxiliary point determination unit is used to determine the adjacent pixels located on the positive left and positive right of any vertical font edge pixel as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction, respectively.

[0127] The positive and negative gradient value determination unit is used to determine the negative gradient value of the font edge pixel in the negative direction by using the brightness value of the negative auxiliary pixel in the negative direction and the brightness value of the font edge pixel, and to determine the positive gradient value of the font edge pixel in the positive direction by using the brightness value of the positive auxiliary pixel in the positive direction and the brightness value of the font edge pixel.

[0128] The brightness direction determination unit is used to determine the brightness mixing direction of the font edge pixels by using the negative gradient value of the font edge pixels in the negative direction and the positive gradient value of the font edge pixels in the positive direction.

[0129] Optionally, the positive and negative gradient value determination unit includes:

[0130] The positive and negative point determination subunit is used to take the positive left and positive top adjacent pixels of the font edge pixel as negative auxiliary pixels of the font edge pixel in the negative direction, and to take the positive right and positive bottom adjacent pixels of the font edge pixel as positive auxiliary pixels of the font edge pixel in the positive direction.

[0131] The negative gradient value determination subunit is used to take the difference between the brightness value of the negative auxiliary pixel of the font edge pixel in the negative direction and the brightness value of the font edge pixel as the negative gradient value of the font edge pixel in the negative direction.

[0132] The positive gradient value determination subunit is used to take the difference between the brightness value of the positive auxiliary pixel of the font edge pixel in the positive direction and the brightness value of the font edge pixel as the positive gradient value of the font edge pixel in the positive direction.

[0133] Optionally, the search distance determination module 330 includes:

[0134] The blending position determination unit is used to determine the blending position of the font edge pixels by using the coordinates of the font edge pixels and the unit pixel offset of the font edge pixels in the brightness blending direction;

[0135] The negative search distance determination unit is used to start from the mixed position of the font edge pixels and search along the negative direction of the font edge pixels with a preset step size to obtain the negative search pixels until the search stopping condition in the negative direction is met, thereby obtaining the negative search distance of the font edge pixels.

[0136] The positive search distance determination unit is used to start from the mixed position of the font edge pixels and search along the positive direction of the font edge pixels with a preset step size to obtain the positive search pixels until the positive search stopping condition is met, thus obtaining the positive search distance of the font edge pixels.

[0137] Optionally, the negative search distance determination unit includes:

[0138] The reference mean determination subunit is used to take the brightness value of the font edge pixel and the average brightness value of the font edge pixel in its brightness mixing direction as the brightness reference mean of the font edge pixel;

[0139] The search mean determination subunit is used to determine the blending position of the font edge pixels by using the coordinates of the font edge pixels and the unit pixel offset of the font edge pixels in the brightness blending direction. Starting from the blending position, it searches along the negative direction of the font edge pixels with a preset step size to obtain the negative search pixel. The brightness value of the negative search pixel and the brightness value of the auxiliary pixel in the brightness blending direction of the font edge pixel are used to determine the brightness search mean of the font edge pixel in the negative direction.

[0140] The brightness mean difference determination subunit is used to determine the brightness mean difference between the brightness reference mean and the brightness search mean of the edge pixels of the font.

[0141] The region gradient determination subunit is used to select the maximum gradient value from the negative gradient values ​​of the font edge pixels in the negative direction and the positive gradient values ​​of the font edge pixels in the positive direction, and use the maximum gradient value and gradient coefficient to determine the pixel region gradient.

[0142] The negative distance sub-unit is used to determine whether the edge pixels of the font meet the search stopping condition based on the mean difference in brightness of the pixels and the gradient of the pixel region. If the search stopping condition is met, the negative search distance of the pixel is obtained.

[0143] Optionally, the edge direction determination module 310 includes:

[0144] The brightness contrast value determination unit is used to obtain the brightness value of the original pixels in the text image of the electronic price tag to be processed, and to take the pixels at the top, bottom, left and right positions of the adjacent pixels as positive reference pixels. For any pixel in the original pixels, the brightness contrast value of the pixel is determined according to the brightness value of the pixel and the brightness value of the positive reference pixels.

[0145] The edge pixel determination unit is used to select the maximum value of the brightness value from the brightness contrast value of the pixel and the brightness value of the positive reference pixel, and to determine the edge brightness threshold of the pixel by using the preset minimum brightness threshold, maximum brightness threshold and the maximum value of the brightness value; and to determine whether the pixel belongs to the font edge pixel by using the edge brightness threshold of the pixel and the brightness contrast value of the pixel.

[0146] The target direction determination unit is used to determine the horizontal edge tendency coefficient and vertical edge tendency coefficient of any font edge pixel by taking the adjacent pixels located at the upper left, lower left, upper right, and lower right of the font edge pixel as diagonal reference pixels, and using the brightness value of the font edge pixel and the brightness value of the diagonal reference pixels to determine the edge direction of the font edge pixel.

[0147] Optionally, the hybrid result mapping module 340 includes:

[0148] The first parameter determination unit is used to take the difference between the brightness value of the font edge pixel and the brightness reference mean value of the font edge pixel as the first parameter;

[0149] The second parameter determination unit is used to select the end that is closer to the edge of the font edge pixel from the positive search pixels and the negative search pixels based on the position of the font edge pixel, the negative search distance and the positive search distance, and use the difference between the brightness value of the search pixel at that end and the average brightness value of the pixels in the brightness mixing direction as the second parameter.

[0150] The third parameter determination unit is used to determine the minimum value of the negative search distance and the positive search distance of the edge pixels of the font, and to determine the total distance between the negative search distance and the positive search distance of the edge pixels of the font, and to use the ratio between the minimum value and the total distance as the third parameter;

[0151] The blending factor determination unit is used to determine the blending factor of the font edge pixels based on the third parameter and a preset balance factor when the product of the first parameter and the second parameter is less than or equal to zero.

[0152] A mixed brightness value determination unit is used to determine the mixed brightness value of the font edge pixels by using the mixing factor of the font edge pixels, the brightness value of the font edge pixels, and the brightness value of the font edge pixels in the brightness mixing direction.

[0153] The result unit is used to select the target grayscale value for the font edge pixels from the candidate grayscale values ​​based on the mixed brightness value and channel brightness value of the font edge pixels, so as to obtain the pixel processing result of the electronic price tag text image to be processed.

[0154] The electronic price tag text image pixel processing device provided in this embodiment of the invention can execute the electronic price tag text image pixel processing method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0155] Example 4

[0156] Figure 4A schematic diagram of an electronic device 400 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0157] like Figure 4 As shown, the electronic device 400 includes at least one processor 410 and a memory, such as a read-only memory (ROM) or a random access memory (RAM), communicatively connected to the at least one processor 410. The memory stores computer programs executable by the at least one processor. The processor 410 can perform various appropriate actions and processes based on the computer program stored in the ROM 420 or loaded into the RAM 430 from the storage unit 480. The RAM 430 can also store various programs and data required for the operation of the electronic device 400. The processor 410, ROM 420, and RAM 430 are interconnected via a bus 440. An input / output (I / O) interface is also connected to the bus 440.

[0158] Multiple components in electronic device 400 are connected to I / O interface 450, including: input unit 460, such as keyboard, mouse, etc.; output unit 470, such as various types of monitors, speakers, etc.; storage unit 480, such as disk, optical disk, etc.; and communication unit 490, such as network card, modem, wireless transceiver, etc. Communication unit 490 allows electronic device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0159] Processor 410 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 410 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 410 performs the various methods and processes described above, such as a method for processing text image pixels on an electronic price tag.

[0160] In some embodiments, an electronic price tag text image pixel processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 480. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 400 via ROM 420 and / or communication unit 490. When the computer program is loaded into RAM 430 and executed by processor 410, one or more steps of the electronic price tag text image pixel processing method described above may be performed. Alternatively, in other embodiments, processor 410 may be configured to perform an electronic price tag text image pixel processing method by any other suitable means (e.g., by means of firmware).

[0161] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard parts (ASSPs), system-on-chips (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.

[0162] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0163] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM 430, ROM 420, erasable programmable read-only memory (EPROM) or flash memory, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0164] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user, such as a cathode ray tube (CRT) or a liquid crystal display (LCD); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0165] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0166] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and Virtual Private Servers (VPS) in terms of management difficulty and weak business scalability.

[0167] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0168] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for processing text image pixels on electronic price tags, characterized in that, The method includes: Extract font edge pixels from the text image of the electronic price tag to be processed, select reference pixels from the adjacent pixels for the font edge pixels, and use the brightness values ​​of the font edge pixels and the reference pixels to determine the edge direction of the font edge pixels; wherein, the edge direction of the font edge pixels is either vertical or horizontal. Based on the edge direction of the font edge pixels, negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction are selected from the adjacent pixels. The brightness blending direction of the font edge pixels is determined by the brightness values ​​of the negative auxiliary pixels, the positive auxiliary pixels, and the font edge pixels. The brightness blending direction can be either negative or positive. The negative and positive search directions are performed by using the position and brightness mixing direction of the pixels at the edge of the font, respectively, to obtain the negative search pixels and the positive search pixels, until the search stops, and the negative search distance and the positive search distance are obtained respectively. The blending factor of the font edge pixels is determined based on the negative search distance, positive search distance, and preset balance factor. The blending brightness value of the font edge pixels is determined based on the blending factor, brightness value, and brightness value in the brightness blending direction of the font edge pixels. The pixel processing result of the electronic price tag text image is obtained by mapping the blending brightness value and the grayscale colors supported by the electronic price tag image.

2. The method according to claim 1, characterized in that, Based on the edge direction of the font edge pixels, negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction are selected from adjacent pixels. The brightness blending direction of the font edge pixels is determined using the brightness values ​​of the negative auxiliary pixels, the positive auxiliary pixels, and the font edge pixels, including: For any horizontal font edge pixel, the adjacent pixels located directly above and below are respectively designated as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction. For any vertical font edge pixel, the adjacent pixels located to the left and right are respectively designated as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction. The negative gradient value of the font edge pixel in the negative direction is determined by using the brightness value of the negative auxiliary pixel in the negative direction and the brightness value of the font edge pixel in the positive direction, and the positive gradient value of the font edge pixel in the positive direction is determined by using the brightness value of the positive auxiliary pixel in the positive direction and the brightness value of the font edge pixel in the positive direction. The brightness blending direction of the font edge pixels is determined by using the negative gradient value of the font edge pixels in the negative direction and the positive gradient value of the font edge pixels in the positive direction.

3. The method according to claim 2, characterized in that, Using the brightness values ​​of negative auxiliary pixels in the negative direction and the brightness values ​​of the font edge pixels, the negative gradient value of the font edge pixels in the negative direction is determined. Similarly, using the brightness values ​​of positive auxiliary pixels in the positive direction and the brightness values ​​of the font edge pixels, the positive gradient value of the font edge pixels in the positive direction is determined. This includes: The adjacent pixels directly to the left and directly above the edge pixel of the font are taken as negative auxiliary pixels in the negative direction, and the adjacent pixels directly to the right and directly below the edge pixel of the font are taken as positive auxiliary pixels in the positive direction. The difference between the brightness value of the negative auxiliary pixel of the font edge pixel in the negative direction and the brightness value of the font edge pixel is taken as the negative gradient value of the font edge pixel in the negative direction. The difference between the brightness value of the positive auxiliary pixel of the font edge pixel in the positive direction and the brightness value of the font edge pixel is taken as the positive gradient value of the font edge pixel in the positive direction.

4. The method according to any one of claims 1-3, characterized in that, The search is performed in both negative and positive directions using the position and brightness mixing direction of the font edge pixels, respectively, to obtain the negative search pixels and positive search pixels until the search stops. The negative search distance and positive search distance are then obtained, including: The blending position of the font edge pixels is determined by the coordinates of the font edge pixels and the unit pixel offset of the font edge pixels in the brightness blending direction; Starting from the mixed position of the font edge pixels, the negative search pixels are searched along the negative direction of the font edge pixels with a preset step size until the search stop condition in the negative direction is met, thus obtaining the negative search distance of the font edge pixels. Starting from the mixed position of the font edge pixels, the positive search is performed along the positive direction of the font edge pixels with a preset step size until the positive search stopping condition is met, thus obtaining the positive search distance of the font edge pixels.

5. The method according to claim 4, characterized in that, Starting from the mixed position of the font edge pixels, a search is performed along the negative direction of the font edge pixels with a preset step size to obtain negative search pixels until the search stops in the negative direction, thus obtaining the negative search distance of the font edge pixels, including: The brightness value of the font edge pixel and the average brightness value of the font edge pixel in its brightness mixing direction are used as the brightness reference average value of the font edge pixel; The blending position of the font edge pixels is determined by the coordinates of the font edge pixels and the unit pixel offset of the font edge pixels in the brightness blending direction. Starting from the blending position, the negative search pixel is obtained by searching along the negative direction of the font edge pixels with a preset step size. The brightness search mean of the font edge pixels in the negative direction is determined by the brightness value of the negative search pixel and the brightness value of the auxiliary pixel of the font edge pixel in the brightness blending direction. Determine the difference in brightness mean between the reference brightness mean and the search brightness mean of the edge pixels of the font; The maximum gradient value is selected from the negative gradient values ​​of the font edge pixels in the negative direction and the positive gradient values ​​of the font edge pixels in the positive direction. The maximum gradient value and the gradient coefficient are used to determine the gradient of the pixel region. Based on the difference in the mean brightness of the pixels at the edge of the font and the gradient of the pixel region, it is determined whether the pixels at the edge of the font meet the search stopping condition. If the search stopping condition is met, the negative search distance of the pixel is obtained.

6. The method according to claim 1, characterized in that, Extract font edge pixels from the text image of the electronic price tag to be processed. Select reference pixels from adjacent pixels for the font edge pixels. Determine the edge direction of the font edge pixels using the brightness values ​​of the font edge pixels and the reference pixels, including: Obtain the brightness values ​​of the original pixels in the text image of the electronic price tag to be processed. Take the pixels at the top, bottom, left and right positions of the adjacent pixels as positive reference pixels. For any pixel in the original pixels, determine the brightness contrast value of the pixel based on the brightness value of the pixel and the brightness value of the positive reference pixels. The maximum value of the brightness value is selected from the brightness contrast value of the pixel and the brightness value of the positive reference pixel. The edge brightness threshold of the pixel is determined by using the preset minimum brightness threshold, maximum brightness threshold and the maximum value of the brightness value. The edge brightness threshold of the pixel and the brightness contrast value of the pixel are used to determine whether the pixel belongs to the font edge pixel. For any font edge pixel, the adjacent pixels located at the top left, bottom left, top right, and bottom right of the font edge pixel are used as diagonal reference pixels. The brightness value of the font edge pixel and the brightness value of the diagonal reference pixels are used to determine the horizontal edge tendency coefficient and the vertical edge tendency coefficient of the font edge pixel, respectively. The edge direction of the font edge pixel is determined by the horizontal edge tendency coefficient and the vertical edge tendency coefficient.

7. The method according to claim 1, characterized in that, The blending factor of the font edge pixels is determined based on the negative search distance, positive search distance, and a preset balance factor. The blended brightness value of the font edge pixels is then determined based on the blending factor, the brightness value of the font edge pixels, and the brightness value along the brightness blending direction. Based on the blended brightness value and the grayscale colors supported by the electronic price tag image, the pixel processing result of the electronic price tag text image to be processed is obtained, including: The difference between the brightness value of the pixels at the edge of the font and the average brightness reference value of the pixels at the edge of the font is used as the first parameter; Based on the position of the font edge pixels, the negative search distance, and the positive search distance, select the end of the positive and negative search pixels that is closer to the font edge pixel. Use the difference between the brightness value of the search pixel at that end and the average brightness value of the pixels in the brightness mixing direction as the second parameter. Determine the minimum value of the negative search distance and the positive search distance of the edge pixels of the font, and determine the total distance between the negative search distance and the positive search distance of the edge pixels of the font. Use the ratio between the minimum value and the total distance as the third parameter. If the product of the first and second parameters is less than or equal to zero, the blending factor of the font edge pixels is determined according to the third parameter and the preset balance factor. The blending brightness value of the font edge pixels is determined by using the blending factor of the font edge pixels, the brightness value of the font edge pixels, and the brightness value of the font edge pixels in the brightness blending direction. Based on the blended brightness value and channel brightness value of the pixels at the edge of the font, the target grayscale value is selected from the candidate grayscale values ​​to obtain the pixel processing result of the electronic price tag text image to be processed.

8. An electronic price tag text image pixel processing device, characterized in that, The device includes: The edge direction determination module is used to extract font edge pixels from the text image of the electronic price tag to be processed, select reference pixels from adjacent pixels for the font edge pixels, and determine the edge direction of the font edge pixels using the brightness value of the font edge pixels and the brightness value of the reference pixels; wherein, the edge direction of the font edge pixels is either vertical or horizontal. The blending direction determination module is used to select negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction from adjacent pixels based on the edge direction of the font edge pixels. The brightness blending direction of the font edge pixels is determined by using the brightness values ​​of the negative auxiliary pixels, the brightness values ​​of the positive auxiliary pixels, and the brightness values ​​of the font edge pixels. The brightness blending direction can be either negative or positive. The search distance determination module is used to perform negative and positive searches based on the position and brightness mixing direction of the font edge pixels, respectively, to obtain negative search pixels and positive search pixels until the search stops, and to obtain negative search distance and positive search distance respectively. The blending result mapping module is used to determine the blending factor of the font edge pixels based on the negative search distance, the positive search distance, and the preset balance factor. It also determines the blended brightness value of the font edge pixels based on the blending factor, the brightness value of the font edge pixels, and the brightness value in the brightness blending direction of the font edge pixels. Based on the blended brightness value and the grayscale colors supported by the electronic price tag image, it maps the pixel processing result of the electronic price tag text image to be processed.

9. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the electronic price tag text image pixel processing method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the electronic price tag text image pixel processing method as described in any one of claims 1-7.