Pixel processing method and apparatus for electronic shelf label text image, device, and medium

By extracting and processing font edge pixels in the electronic price tag text image, determining the brightness mixing direction and search distance, the jagged edge problem under the resolution limit of electronic paper is solved, achieving a clearer and smoother font display.

WO2025180237A1PCT designated stage Publication Date: 2025-09-04HANSHOW TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/077360
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-01
Filing Date
2025-02-14
Publication Date
2025-09-04

AI Technical Summary

Technical Problem

The resolution limitation of electronic paper leads to jagged edges of text, affecting the aesthetics and readability of text, which cannot be effectively solved by the existing technology.

Method used

By extracting the edge pixel points of the font from the electronic price tag text image, selecting the reference pixel points, determining the edge direction, and determining the brightness mixing direction based on the brightness value and the brightness value of the auxiliary pixel points, searching to obtain the mixing factor and brightness value, mapping to obtain smooth pixel processing results.

Benefits of technology

Improve the display clarity and smoothness of the electronic price tag text image, achieve the smooth transition effect of the font edges, and eliminate jagged edges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025077360_04092025_PF_FP_ABST
    Figure CN2025077360_04092025_PF_FP_ABST
Patent Text Reader

Abstract

A pixel processing method and apparatus for an electronic shelf label text image, a device, and a medium. The method comprises: extracting a font edge pixel from an electronic shelf label text image to be processed, selecting a reference pixel from adjacent pixels, and determining an edge direction of the font edge pixel (S110) and a luminance-blending direction of the font edge pixel (S120); on the basis of the position of the font edge pixel and the luminance-blending direction, performing searches in a negative position and a positive direction (S130); and on the basis of an obtained negative search distance, an obtained positive search distance, and a preset balance factor, determining a blending factor for the font edge pixel, on the basis of the blending factor, a luminance value of the font edge pixel, and a luminance value in the luminance-blending direction, determining a blended luminance value of the font edge pixel, and on the basis of the blended luminance value and grayscale colors supported by electronic shelf label images, performing mapping to obtain a pixel processing result of the electronic shelf label text image to be processed (S140).
Need to check novelty before this filing date? Find Prior Art

Description

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

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 1, 2024, with application number 202410238438.7, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of image processing technology, for example, to a method, device, equipment and medium for processing pixels of text images on electronic price tags. Background Art

[0003] Compared to traditional LCD screens, electronic ink displays use microcapsules suspended in liquid to display images and text. These displays consume less power, more closely resemble paper, are clearly visible even in sunlight, and are less straining on the eyes. They are widely used in devices such as e-books, smartwatches, smart labels, and electronic price tags. However, due to the resolution limitations of electronic paper, displayed text often exhibits jagged edges, affecting both the aesthetics and readability of the text.

[0004] In related technologies, the jagged edges of text are processed by adjusting each initial pixel to a corresponding target pixel based on the initial pixels in the jagged layer data and a grayscale mapping relationship determined by visual configuration parameters. However, this method of processing jagged edges in related technologies still cannot meet user needs. Summary of the Invention

[0005] The present application provides a method, apparatus, device, and medium for processing pixels of text images on electronic price tags to improve display clarity and smoothness, thereby making the edges of the fonts on electronic price tag text images present a smooth transition effect, making the displayed fonts smoother and more natural, and achieving an anti-aliasing effect.

[0006] In a first aspect, an embodiment of the present application provides a method for processing pixels of text images on electronic price tags, the method comprising:

[0007] Extracting font edge pixels from the electronic price tag text image to be processed, selecting reference pixels for the font edge pixels from adjacent pixels, and determining edge directions of the font edge pixels using the brightness values ​​of the font edge pixels and the brightness values ​​of the reference pixels; wherein the edge directions of the font edge pixels are vertical or horizontal;

[0008] Based on the edge direction of the font edge pixel, a negative auxiliary pixel in a negative direction and a positive auxiliary pixel in a positive direction are selected from adjacent pixels for the font edge pixel, and the brightness value of the negative auxiliary pixel, the brightness value of the positive auxiliary pixel, and the brightness value of the font edge pixel are used to determine the brightness mixing direction of the font edge pixel; wherein the brightness mixing direction is a negative direction or a positive direction;

[0009] The positions of the font edge pixels and the brightness mixing direction are used to search in the negative direction and the positive direction respectively, to obtain the negative search pixel points and the positive search pixel points, until the search stops, to obtain the negative search distance and the positive search distance respectively;

[0010] The mixing factor of the font edge pixel points is determined based on the negative search distance, the positive search distance and the preset balance factor, and the mixed brightness value of the font edge pixel points is determined based on the mixing factor of the font edge pixel points, the brightness value of the font edge pixel points and the brightness value in the brightness mixing direction of the font edge pixel points. According to the mixed brightness value and the grayscale color supported by the electronic price tag image, the pixel processing result of the electronic price tag text image to be processed is mapped.

[0011] In a second aspect, an embodiment of the present application further provides a device for processing pixels of text images on electronic price tags, the device comprising:

[0012] an edge direction determination module configured to extract font edge pixels from the electronic price tag text image to be processed, select reference pixels for the font edge pixels from adjacent pixels, and determine the edge direction of the font edge pixels using the brightness values ​​of the font edge pixels and the brightness values ​​of the reference pixels; wherein the edge direction of the font edge pixels is a vertical direction or a horizontal direction;

[0013] a mixing direction determining module configured to select, based on the edge direction of a font edge pixel, a negative auxiliary pixel in a negative direction and a positive auxiliary pixel in a positive direction from adjacent pixels for each font edge pixel, and determine a brightness mixing direction of the font edge pixel using the brightness value of the negative auxiliary pixel, the brightness value of the positive auxiliary pixel, and the brightness value of the font edge pixel; wherein the brightness mixing direction is a negative direction or a positive direction;

[0014] A search distance determination module is configured to use the position of the font edge pixel point and the brightness mixing direction to perform a search in a negative direction and a search in a positive direction respectively, to obtain a negative search pixel point and a positive search pixel point, until the search stops, to obtain a negative search distance and a positive search distance respectively;

[0015] The mixed result mapping module is configured to determine a mixing factor of a font edge pixel point based on a negative search distance, a positive search distance, and a preset balance factor, and determine a mixed brightness value of the font edge pixel point based on the mixing factor of the font edge pixel point, a brightness value of the font edge pixel point, and a brightness value in a brightness mixing direction of the font edge pixel point. Based on the mixed brightness value and the grayscale color supported by the electronic price tag image, a pixel processing result of the electronic price tag text image to be processed is mapped.

[0016] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0017] at least one processor; and

[0018] a memory communicatively connected to at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute a method for processing pixels of text images of electronic price tags according to any embodiment of the present application.

[0020] In a fourth aspect, an embodiment of the present application further provides a storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, the computer processor is enabled to execute any one of the electronic price tag text image pixel processing methods provided in the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] FIG1 is a flowchart of a method for processing pixels of text images on electronic price tags according to a first embodiment of the present application;

[0022] FIG2A is a flowchart of another method for processing pixels of text images on electronic price tags according to the second embodiment of the present application;

[0023] FIG2B is a rendering of a method for processing pixels of text images on an electronic price tag according to the second embodiment of the present application;

[0024] FIG2C is a rendering of a method for processing pixels of text images on an electronic price tag according to the second embodiment of the present application;

[0025] FIG3 is a schematic diagram of the structure of an electronic price tag text image pixel processing device provided according to the third embodiment of the present application;

[0026] FIG4 is a schematic structural diagram of an electronic device according to a method for processing pixels of text images on an electronic price tag provided in a fourth embodiment of the present application. DETAILED DESCRIPTION

[0027] The following describes the embodiments of the present application in conjunction with the accompanying drawings. The embodiments described are some related embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of this application.

[0028] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units listed, but may include other steps or units that are not listed or that are inherent to these processes, methods, products or devices.

[0029] In the embodiments of this application, the collection, storage, use, processing, transmission, provision and disclosure of the relevant data involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0030] Example 1

[0031] Figure 1 is a flowchart of a method for processing pixels of an electronic price tag text image provided in Example 1 of the present application. This embodiment is applicable to the case of processing pixels of an electronic price tag text image. The method can be performed by an electronic price tag text image pixel processing device. The electronic price tag text image pixel processing device can be implemented in the form of hardware and / or software. The electronic price tag text image pixel processing device can be configured in an electronic device, which can be a terminal device or a server, etc.

[0032] As shown in FIG1 , an embodiment of the present application provides a method for processing pixels of text images on electronic price tags, including the following steps:

[0033] S110. Extract font edge pixels from the electronic price tag text image to be processed, select reference pixels for the font edge pixels from adjacent pixels, and determine an 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 a vertical direction or a horizontal direction.

[0034] Exemplarily, in response to the need to determine the edge direction of font edge pixels from the electronic price tag text image to be processed, font edge pixels can be pre-extracted from the electronic price tag text image to be processed, and then for any of the extracted font edge pixels, a corresponding reference pixel can be selected for the font edge pixel from the adjacent pixels of the font edge pixel, and 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, wherein the edge direction of the font edge pixel can be a vertical direction or a horizontal direction.

[0035] When determining the brightness value of a pixel, an exemplary method for determining the brightness value of the pixel may 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 the sake of clarity and brevity, the following example illustrates the method for determining the brightness value of a single pixel. First, the coordinate position (x, y) of the pixel in the two-dimensional coordinate system is determined, and the values ​​of the R, G, and B channels of the pixel are obtained. The brightness value of the pixel is determined using the following formula:

[0036] luma (x,y) =α●R (x,y) +β●G (x,y) +γ●B (x,y) ;

[0037] Among them, α, β and γ are the weight factors of the pixel on the three channels of R, G and B respectively. When determining the brightness value at any pixel, the weight factors α, β and γ are all fixed values, that is to say, the values ​​of the weight factors α, β and γ are all empirical values. For example, the values ​​of α, β and γ are 0.299, 0.587 and 0.114 respectively. In some embodiments, the values ​​of the weight factors α, β and γ can be empirical values ​​or dynamically transformed, that is to say, for different pixels, the values ​​of the corresponding weight factors are different. In the embodiment of the present application, the values ​​of the weight factors α, β and γ can be set according to actual needs. The above method for determining the brightness value of a pixel is only an exemplary scheme. The method for determining the brightness value of a pixel in the embodiment of the present application can be set according to actual needs.

[0038] When extracting font edge pixels from the electronic price tag text image to be processed, the font edge pixel extraction method adopted may be to determine the pixel points in the electronic price tag text image that meet the edge pixel determination conditions through a deep learning algorithm as the font edge pixel points in the electronic price tag text image to be processed. In the embodiment of the present application, when extracting font edge pixels based on the electronic price tag text image to be processed, the selected extraction method can be set according to actual needs. In addition, based on any font edge pixel point extracted, when selecting a reference pixel point from adjacent pixels, the selected reference pixel point may be at least one adjacent pixel point among the eight surrounding pixels centered on the font edge pixel point. In the embodiment of the present application, when selecting reference pixels based on adjacent pixels, the number of selected reference pixels can be set according to actual needs. It can be understood that when the embodiment of the present application uses the brightness value of the font edge pixel point and the brightness value of the reference pixel point to determine the edge direction of the font edge pixel point, the selected determination method can be set according to actual needs.

[0039] By extracting font edge pixels from the electronic price tag text image to be processed, selecting reference pixels for the font edge pixels from adjacent pixels, and using the brightness value of the font edge pixels and the brightness value of the reference pixels to determine the edge direction of the font edge pixels; wherein the edge direction of the font edge pixels is a vertical direction or a horizontal direction, 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 value of the font edge pixels and the brightness value of 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.

[0040] S120. Based on the edge direction of the font edge pixel point, select a negative auxiliary pixel point in the negative direction and a positive auxiliary pixel point in the positive direction from the adjacent pixel points for the font edge pixel point, and use the brightness value of the negative auxiliary pixel point, the brightness value of the positive auxiliary pixel point and the brightness value of the font edge pixel point to determine the brightness mixing direction of the font edge pixel point; wherein the brightness mixing direction is a negative direction or a positive direction.

[0041] Exemplarily, based on the edge direction of the font edge pixel point, auxiliary pixel points can be selected for the font edge pixel point from the adjacent pixel points, that is, negative auxiliary pixel points in the negative direction are selected for the font edge pixel point, and positive auxiliary pixel points in the positive direction are selected for the font edge pixel point, and then the brightness value of the negative auxiliary pixel point, the brightness value of the positive auxiliary pixel point and the brightness value of the font edge pixel point are used to determine the brightness mixing direction of the font edge pixel point, wherein the brightness mixing direction is the negative direction or the positive direction.

[0042] Continuing with the example in S110, based on the edge direction of the font edge pixel, when selecting a negative auxiliary pixel in the negative direction and a positive auxiliary pixel in the positive direction for the font edge pixel from adjacent pixels, the 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. In other words, upward and leftward directions in the two-dimensional coordinate system can be defined as negative directions, while downward and rightward directions are defined as positive directions. Therefore, for any font edge pixel in the two-dimensional coordinate system, the positive and negative directions of the font edge pixel are the positive and negative directions defined in the two-dimensional coordinate system. For ease of understanding, the following example is provided: if the edge direction of a font edge pixel is horizontal, when selecting a negative auxiliary pixel in the negative direction from the adjacent pixels of the font edge pixel, it can be understood that the adjacent pixel to the left of the font edge pixel is the negative auxiliary pixel of the font edge pixel; when selecting a positive auxiliary pixel in the positive direction from the adjacent pixels of the font edge pixel, it can be understood that the adjacent pixel to the right of the font edge pixel is the positive auxiliary pixel of the font edge pixel. If the edge direction of a font edge pixel is vertical, when selecting a negative auxiliary pixel in the negative direction from the adjacent pixels of the font edge pixel, it can be understood that the adjacent pixel above the font edge pixel is the negative auxiliary pixel of the font edge pixel; when selecting a positive auxiliary pixel in the positive direction from the adjacent pixels of the font edge pixel, it can be understood that the adjacent pixel below the font edge pixel is the positive auxiliary pixel of the font edge pixel.

[0043] For any font edge pixel, based on the edge direction of the font edge pixel, the negative auxiliary pixel and the positive auxiliary pixel of the font edge pixel can be determined, and then the luminance mixing direction of the font edge pixel can be determined based on the luminance value of the negative auxiliary pixel, the luminance value of the positive auxiliary pixel, and the luminance value of the font edge pixel. It can be understood that the luminance mixing direction is negative or positive. When determining the luminance mixing direction based on the luminance value of the negative auxiliary pixel of any font edge pixel, the luminance value of the positive auxiliary pixel, and the luminance value of the font edge pixel, the method for determining the luminance mixing direction selected in the embodiment of the present application can be set according to actual needs.

[0044] Based on the edge direction of the font edge pixel, a negative auxiliary pixel in the negative direction and a positive auxiliary pixel in the positive direction are selected from the adjacent pixels for the font edge pixel. The lightness value of the negative auxiliary pixel, the lightness value of the positive auxiliary pixel, and the lightness value of the font edge pixel are used to determine the lightness blending direction of the font edge pixel; the lightness blending direction can be negative or positive. Based on the determined lightness blending direction of the font edge pixel, subsequent work can be carried out based on the lightness blending direction.

[0045] S130 , using the font edge pixel position and brightness mixing direction to perform searches in the negative direction and the positive direction, respectively, to obtain negative search pixels and positive search pixels, until the search stops, to obtain negative search distances and positive search distances, respectively.

[0046] S140: Determine a blending factor for the font edge pixels based on the negative search distance, the positive search distance, and a preset balance factor; determine a mixed luminance value for the font edge pixels based on the blending factor for the font edge pixels, the luminance value of the font edge pixels, and the luminance value in the luminance blending direction of the font edge pixels; and map the mixed luminance value and the grayscale color supported by the electronic price tag image to obtain a pixel processing result for the electronic price tag text image to be processed.

[0047] Exemplarily, based on the position of the font edge pixel point and the brightness mixing direction, searches are carried out in the negative direction and the positive direction respectively, and corresponding search results can be obtained, namely the negative search pixel point and the positive search pixel point. When the search stop condition is met, the search stops, and the corresponding negative search distance and positive search distance can be determined at this time. According to the determined negative search distance, the positive search distance and the preset balance factor, the mixing factor of the font edge pixel point can be determined, and then according to the determined mixing factor of the font edge pixel point, the brightness value of the font edge pixel point and the brightness value of the font edge pixel point in the brightness mixing direction, the mixed brightness value of the font edge pixel point is determined, and then the pixel processing result of the electronic price tag text image to be processed can be mapped according to the mixed brightness value and the grayscale color supported by the electronic price tag image. Based on the determined information, when processing the pixels of the electronic price tag text image to be processed, the selected processing method in the embodiment of the present application can be set according to actual needs.

[0048] The positions and brightness mixing directions of the font edge pixels are used to search in the negative and positive directions, respectively, obtaining negative search pixels and positive search pixels. The search is stopped, and the negative search distance and positive search distance are obtained, respectively. A mixing factor for the font edge pixels is determined based on the negative search distance, the positive search distance, and a preset balance factor. A mixed brightness value for the font edge pixels is determined based on the mixing factor, the brightness value of the font edge pixels, and the brightness value of the brightness mixing direction of the font edge pixels. Based on the mixed brightness value and the grayscale colors supported by the electronic price tag image, a pixel processing result for the electronic price tag text image to be processed is mapped to improve the display clarity and smoothness of the electronic price tag text image.

[0049] Optionally, extracting font edge pixels from the electronic price tag text image to be processed, selecting reference pixels for the font edge pixels from adjacent pixels, and using the brightness values ​​of the font edge pixels and the brightness values ​​of the reference pixels to determine the edge direction of the font edge pixels, including: obtaining the brightness values ​​of the original pixels in the electronic price tag text image to be processed, taking the adjacent pixels at the upper, lower, left, and right positions as positive reference pixels, and for any pixel in the original pixels, determining the brightness contrast value of the pixel according to the brightness value of the pixel and the brightness value of the positive reference pixel; selecting the brightness value from the brightness contrast value of the pixel and the brightness value of the positive reference pixel. Maximum value, using the preset minimum brightness threshold, maximum brightness threshold and the maximum value of the brightness value to determine the edge brightness threshold of the pixel point; using the edge brightness threshold of the pixel point and the brightness contrast value of the pixel point to determine whether the pixel point belongs to the font edge pixel point; for any font edge pixel point, the adjacent pixels located at the upper left, lower left, upper right and lower right of the font edge pixel point are used as oblique reference pixels, and the brightness value of the font edge pixel point and the brightness value of the oblique reference pixel point are used to respectively determine the horizontal edge tendency coefficient and the vertical edge tendency coefficient of the font edge pixel point, and the horizontal edge tendency coefficient and the vertical edge tendency coefficient are used to determine the edge direction of the font edge pixel point.

[0050] Exemplarily, when determining the edge direction of a font edge pixel, an optional exemplary embodiment may be to obtain the brightness value of the original pixel in the electronic price tag text image to be processed, and use the adjacent pixels at the upper, lower, left, and right positions 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 pixel. The brightness contrast value can be determined by selecting the maximum and minimum brightness values ​​of the brightness value of the pixel and the brightness value of the positive reference pixel, and using the difference between the obtained maximum and minimum brightness values ​​as the brightness contrast value C of the pixel. The method for determining the brightness contrast value C of the pixel in the embodiment of the present application can be set according to actual needs.

[0051] When determining the edge brightness threshold of the pixel point, its determination method can be exemplarily, first calculating the product between the maximum value of the selected brightness value and the preset maximum brightness threshold, and judging the calculated product result and the minimum brightness threshold, and selecting the maximum value of the two as the edge brightness threshold of the pixel point. The edge brightness threshold of the pixel point and the brightness contrast value C of the pixel point are used to determine whether the pixel point belongs to the font edge pixel point. In the embodiment of the present application, the judgment method of whether the pixel point belongs to the font edge pixel point can be set according to actual needs. For any font edge pixel point luma (x, y), the adjacent pixel points located at the upper left, lower left, upper right, and lower right of the font edge pixel point are used as oblique reference pixel points. Among them, the oblique reference pixel points can be lumaLeftCorners, lumaRightCorners, lumaUpCorners and lumaDownCorners, and the brightness value of the font edge pixel point and the brightness value of the oblique reference pixel point are used to determine the horizontal edge tendency coefficient edge of the font edge pixel point respectively. h and vertical edge inclination coefficient edge v When , you can refer to the following formula:

[0052] edge h =|-2×lumaLeft+lumaLeftCorners|+|-2×lumaCenter+lumaDown+lumaUp|×2+|-2×lumaRight+lumaRightCorners|;

[0053] edge v =|-2×lumaUp+lumaUpCorners|+|-2×lumaCenter+lumaLeft+lumaRight|×2+|-2×lumaDown+lumaDownCorners|;

[0054] The oblique reference pixel point lumaLeftCorners is obtained by summing the upper left adjacent pixel points and the lower left adjacent pixel points of the font edge pixel point; the oblique reference pixel point lumaRightCorners is obtained by summing the upper right adjacent pixel points and the lower right adjacent pixel points of the font edge pixel point; the oblique reference pixel point lumaUpCorners is obtained by summing the upper left adjacent pixel points and the lower right adjacent pixel points of the font edge pixel point; the oblique reference pixel point lumaDownCorners is obtained by summing the lower left adjacent pixel points and the upper right adjacent pixel points of the font edge pixel point.

[0055] When the horizontal edge tendency coefficient and the vertical edge tendency coefficient are used to determine the edge direction of the edge pixel of the font, for example, the horizontal edge tendency coefficient edge h and vertical edge inclination coefficient edge v , and the larger edge tendency coefficient of the two is selected as the edge direction of the edge pixel of the font. The edge direction of the edge pixel of the font is the vertical direction or the horizontal direction.

[0056] The embodiment of the present application extracts font edge pixels from an electronic price tag text image to be processed, selects reference pixels for the font edge pixels from adjacent pixels, and uses the brightness value of the font edge pixels and the brightness value of the reference pixels to determine the edge direction of the font edge pixels; wherein the edge direction of the font edge pixels is a vertical direction or a horizontal direction; based on the edge direction of the font edge pixels, a negative auxiliary pixel in a negative direction and a positive auxiliary pixel in a positive direction are selected from adjacent pixels for the font edge pixels, and the brightness value of the negative auxiliary pixel, the brightness value of the positive auxiliary pixel, and the brightness value of the font edge pixel are used to determine the brightness mixing direction of the font edge pixel; wherein, The brightness mixing direction is negative or positive; the position and brightness mixing direction of the font edge pixel point are used to search in the negative direction and the positive direction respectively, to obtain negative search pixel points and positive search pixel points, until the search stops, and the negative search distance and the positive search distance are obtained respectively; the mixing factor of the font edge pixel point is determined according to the negative search distance, the positive search distance and the preset balance factor, and the mixed brightness value of the font edge pixel point is determined according to the mixing factor of the font edge pixel point, the brightness value of the font edge pixel point and the brightness value in the brightness mixing direction of the font edge pixel point, and the pixel processing result of the electronic price tag text image to be processed is mapped according to the mixed brightness value and the grayscale color supported by the electronic price tag image. In the embodiment of the present application, the pixels of the electronic price tag text image are grayscale processed according to the determined mixed brightness value of the font edge pixel point and in the brightness mixing direction of the font edge pixel point to improve the display clarity and smoothness, so that the font edge of the electronic price tag text image presents a smooth transition effect, making the displayed font smoother and more natural, and achieving an anti-aliasing effect.

[0057] Example 2

[0058] FIG2A is a flowchart of another method for processing pixels of text images on electronic price tags provided in a second embodiment of the present application. The embodiment of the present application is improved on the basis of the above-mentioned optional embodiments.

[0059] In some embodiments, "based on the edge direction of the font edge pixel point, select the negative auxiliary pixel point in the negative direction and the positive auxiliary pixel point in the positive direction from the adjacent pixel points for the font edge pixel point, and use the brightness value of the negative auxiliary pixel point, the brightness value of the positive auxiliary pixel point and the brightness value of the font edge pixel point to determine the brightness mixing direction of the font edge pixel point", which can be "for any font edge pixel point in the horizontal direction, use the adjacent pixels located above and below as the negative auxiliary pixel point in the negative direction and the positive auxiliary pixel point in the positive direction; for any font edge pixel point in the vertical direction, use the adjacent pixels located above and below as the positive auxiliary pixel point in the positive direction; The adjacent pixels on the left and right serve as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction, respectively; the luminance value of the negative auxiliary pixel in the negative direction and the luminance value of the font edge pixel are used to determine the negative gradient value of the font edge pixel in the negative direction, and the luminance value of the positive auxiliary pixel in the positive direction and the luminance value of the font edge pixel are used to determine the positive gradient value of the font edge pixel in the positive direction; 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 are used to determine the luminance mixing direction of the font edge pixel to improve display clarity and smoothness. For parts not described in this embodiment, please refer to the relevant descriptions of other embodiments.

[0060] As shown in FIG2A , another method for processing pixels of text images on electronic price tags provided by an embodiment of the present application includes the following steps:

[0061] S210: Extract font edge pixels from the electronic price tag text image to be processed, select reference pixels for the font edge pixels from adjacent pixels, and determine an 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 a vertical direction or a horizontal direction.

[0062] S220 : For any font edge pixel point in the horizontal direction, use adjacent pixel points located directly above or directly below as negative auxiliary pixel points in the negative direction and positive auxiliary pixel points in the positive direction, respectively.

[0063] S230 : For any font edge pixel point in the vertical direction, use adjacent pixel points located to the left and right of the font edge pixel point as negative auxiliary pixel points in the negative direction and positive auxiliary pixel points in the positive direction, respectively.

[0064] Exemplarily, font edge pixels are extracted from the electronic price tag text image to be processed, reference pixels are selected for the font edge pixels from the adjacent pixels, and the edge direction of the font edge pixels is determined 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 vertical or horizontal. For any font edge pixel whose edge direction is horizontal, the reference pixel is the adjacent pixel just above or just below the font edge pixel. Exemplarily, the adjacent pixel just above is defined as a negative auxiliary pixel in the negative direction, and the adjacent pixel just below is defined as a positive auxiliary pixel in the positive direction; for any font edge pixel whose edge direction is vertical, the reference pixel is the adjacent pixel just to the left or just to the right of the font edge pixel. Exemplarily, the adjacent pixel just to the left is defined as a negative auxiliary pixel in the negative direction, and the adjacent pixel just to the right is defined as a positive auxiliary pixel in the positive direction.

[0065] The basis for determining the negative and positive directions described in the embodiments of this application is to establish a two-dimensional coordinate system with the pixel point in the upper left corner of the electronic price tag text image to be processed as the origin. Therefore, the positive direction of the x-axis is the direction directly to the right of the origin, and the positive direction of the y-axis is the direction directly below the origin. Therefore, the negative and positive directions in the technical solutions described in the embodiments of this application are based on this specified direction.

[0066] For any font edge pixel point in the horizontal direction, the adjacent pixel point directly above the font edge pixel point is the negative auxiliary pixel point in the negative direction of the font edge pixel point, and the adjacent pixel point directly below the font edge pixel point is the positive auxiliary pixel point in the positive direction of the font edge pixel point. For any font edge pixel point in the vertical direction, the adjacent pixel point directly to the left of the font edge pixel point is the negative auxiliary pixel point in the negative direction of the font edge pixel point, and the adjacent pixel point directly to the right of the font edge pixel point is the positive auxiliary pixel point in the positive direction of the font edge pixel point.

[0067] Font edge pixels are extracted from the electronic price tag text image to be processed. A reference pixel is selected for the font edge pixel from adjacent pixels. The edge direction of the font edge pixel is determined using the brightness value of the font edge pixel and the brightness value of the reference pixel. The edge direction of the font edge pixel can be vertical or horizontal. Therefore, for any horizontal or vertical font edge pixel, the negative auxiliary pixel and positive auxiliary pixel of the font edge pixel can be determined, so that subsequent work can be carried out based on the brightness value of the font edge pixel and the determined negative auxiliary pixel and positive auxiliary pixel.

[0068] S240. Use the brightness value of the negative auxiliary pixel in the negative direction and the brightness value of the font edge pixel to determine the negative gradient value of the font edge pixel in the negative direction, and use the brightness value of the positive auxiliary pixel in the positive direction and the brightness value of the font edge pixel to determine the positive gradient value of the font edge pixel in the positive direction.

[0069] For example, by using the luminance value of the negative auxiliary pixel in the negative direction and the luminance value of the font edge pixel, the negative gradient value of the font edge pixel in the negative direction can be determined. Similarly, by using the luminance value of the positive auxiliary pixel in the positive direction and the luminance value of the font edge pixel, the positive gradient value of the font edge pixel in the positive direction can be determined. In the embodiment of the present application, the method for determining the negative gradient value and the positive gradient value of the font edge pixel can be set according to actual needs.

[0070] Optionally, the luminance value of the negative auxiliary pixel in the negative direction and the luminance value of the font edge pixel are used to determine the negative gradient value of the font edge pixel in the negative direction, and the luminance value of the positive auxiliary pixel in the positive direction and the luminance value of the font edge pixel are used to determine the positive gradient value of the font edge pixel in the positive direction, including: using the adjacent pixel to the left and above the font edge pixel as the negative auxiliary pixel of the font edge pixel in the negative direction, and using the adjacent pixel to the right and below the font edge pixel as the positive auxiliary pixel of the font edge pixel in the positive direction; using the difference between the luminance value of the negative auxiliary pixel of the font edge pixel in the negative direction and the luminance value of the font edge pixel as the negative gradient value of the font edge pixel in the negative direction; and using the difference between the luminance value of the positive auxiliary pixel of the font edge pixel in the positive direction and the luminance value of the font edge pixel as the positive gradient value of the font edge pixel in the positive direction.

[0071] Exemplarily, for any font edge pixel point, when determining the negative gradient value and the positive gradient value of the font edge pixel point, the adjacent pixel points to the left and above the font edge pixel point can be used as the negative auxiliary pixel points of the font edge pixel point in the negative direction, and the adjacent pixel points to the right and below the font edge pixel point can be used as the positive auxiliary pixel points of the font edge pixel point in the positive direction; the difference between the brightness value of the negative auxiliary pixel point of the font edge pixel point in the negative direction and the brightness value of the font edge pixel point is used as the negative gradient value of the font edge pixel point in the negative direction; and the difference between the brightness value of the positive auxiliary pixel point of the font edge pixel point in the positive direction and the brightness value of the font edge pixel point is used as the positive gradient value of the font edge pixel point in the positive direction.

[0072] In some implementations, the difference between the luminance value luma1 of the negative auxiliary pixel of the font edge pixel in the negative direction and the luminance 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 luminance value luma2 of the positive auxiliary pixel of the font edge pixel in the positive direction and the luminance 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 shown in the following formula.

[0073] gradient1=luma1-lumaCenter;

[0074] gradient2=luma2-lumaCenter;

[0075] Let the brightness value of the font edge pixel be lumaCenter, the adjacent pixel to the left of the font edge pixel be lumaLeft, the adjacent pixel to the right of the font edge pixel be lumaRight, the adjacent pixel above the font edge pixel be lumaUp, and the adjacent pixel below the font edge pixel be lumaDown. It can be understood that the negative auxiliary pixel points of the font edge pixel in the negative direction are lumaLeft and lumaUp; similarly, the positive auxiliary pixel points of the font edge pixel in the positive direction are lumaRight and lumaDown. Therefore, for the above-mentioned formula for determining 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 font edge pixel. That is, if the edge direction of the font edge pixel is a horizontal edge, then when determining the negative gradient value of the font edge pixel, the value of luma1 should be lumaUp, and when determining the positive gradient value of the font edge pixel, the value of luma2 should be lumaDown. Similarly, if the edge direction of the font edge pixel is a vertical edge, the value of luma1 when determining the negative gradient value of the font edge pixel should be lumaLeft, and the value of luma2 when determining the positive gradient value of the font edge pixel should be lumaRight. For the values ​​of luma1 and luma2 in different positive and negative directions, as well as different edge directions, please refer to Table 1 below.

[0076] Table 1 shows the values ​​of luma1 and luma2:

[0077] The negative gradient value of the font edge pixel in the negative direction is determined by using the luminance value of the negative auxiliary pixel in the negative direction and the luminance value of the font edge pixel. The positive gradient value of the font edge pixel in the positive direction is determined by using the luminance value of the positive auxiliary pixel in the positive direction and the luminance value of the font edge pixel, so as to carry out subsequent work based on the negative gradient value and positive gradient value determined at this time.

[0078] 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 to determine the brightness mixing direction of the font edge pixel.

[0079] In some embodiments, the brightness mixing direction is a negative direction or a positive direction.

[0080] For example, when determining the luminance blending direction of a font edge pixel based on 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, the method for determining the luminance blending direction selected in the embodiments of the present application can be set according to actual needs. The luminance blending direction can be either negative or positive.

[0081] In an implementation of an optional embodiment, when determining the brightness mixing direction of a font edge pixel point, the negative gradient value of the font edge pixel point in the negative direction and the positive gradient value in the positive direction may be compared, and the direction with the larger gradient value is used as the brightness mixing direction of the font edge pixel point. That is, if the negative gradient value is greater than the positive gradient value, the brightness mixing direction of the font edge pixel point is the negative direction corresponding to the negative gradient value; conversely, the brightness mixing direction of the font edge pixel point can be determined accordingly. The brightness mixing direction is either a negative direction or a positive direction. The method for determining the brightness mixing direction of the font edge pixel point in the embodiment of the present application can be set according to actual needs.

[0082] 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 are used to determine the lightness blending direction of the font edge pixel. The lightness blending direction can be negative or positive, so that subsequent work can be carried out based on the determined lightness blending direction of the font edge pixel.

[0083] S260, using the font edge pixel position and brightness mixing direction to perform searches in the negative direction and the positive direction respectively, obtaining negative search pixels and positive search pixels, until the search stops, and obtaining negative search distances and positive search distances respectively.

[0084] For example, when searching in the negative and positive directions respectively using the position and brightness mixing direction of the font edge pixel points, corresponding negative search pixel points and positive search pixel points can be obtained. When the search stop condition is met, the search stops, and then the negative search distance and positive search distance can be obtained.

[0085] Optionally, the position of the font edge pixel point and the brightness mixing direction are used to search in the negative direction and the positive direction respectively to obtain negative search pixel points and positive search pixel points until the search stops, and the negative search distance and the positive search distance are respectively obtained, including: using the coordinates of the font edge pixel point and the unit pixel offset of the font edge pixel point in the brightness mixing direction to determine the mixing position of the font edge pixel point; using the mixing position of the font edge pixel point as the starting point, searching along the negative direction of the font edge pixel point with a preset step size to obtain the negative search pixel point, until the search stop condition in the negative direction is met, and the negative search distance of the font edge pixel point is obtained; using the mixing position of the font edge pixel point as the starting point, searching along the positive direction of the font edge pixel point with a preset step size to obtain the positive search pixel point, until the search stop condition in the positive direction is met, and the positive search distance of the font edge pixel point is obtained.

[0086] Exemplarily, in response to the need to determine the negative search distance and positive search distance of a font edge pixel, the following method for determining the negative search distance of a font edge pixel is used as an example to illustrate the method. The coordinates of the font edge pixel and the unit pixel offset of the font edge pixel in the brightness mixing direction are used to determine the mixed position of the font edge pixel. Then, using the mixed position of the font edge pixel 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. When the search stop condition in the negative direction is met, the corresponding negative search distance of the font edge pixel can be obtained. In the embodiment of the present application, the unit pixel offset in the brightness mixing direction selected when determining the mixed position of the font edge pixel can be set according to actual needs. In addition, the preset step size value in the embodiment of the present application can be set according to actual needs, and the content of the search stop condition in the negative direction in the embodiment of the present application can also be set according to actual needs. Similarly, the method for determining the positive search distance of the font edge pixel can refer to the above-mentioned method for determining the negative search distance of the font edge pixel. The method for determining both the negative search distance and the positive search distance in the embodiment of the present application can be set according to actual needs.

[0087] In some embodiments, the mixed position of the font edge pixel point is used as the starting point, and a preset step size is used to search along the negative direction of the font edge pixel point to obtain a negative search pixel point, until the search stop condition in the negative direction is met, and the negative search distance of the font edge pixel point is obtained, including: taking the brightness value of the font edge pixel point and the average of the brightness value of the font edge pixel point in its brightness mixing direction as the brightness reference average of the font edge pixel point; using the coordinates of the font edge pixel point and the unit pixel offset of the font edge pixel point in the brightness mixing direction to determine the mixed position of the font edge pixel point, and taking the mixed position as the starting point, searching along the negative direction of the font edge pixel point with a preset step size to obtain a negative search pixel point. ; Use the luminance value of the negative search pixel point and the luminance value of the auxiliary pixel point of the negative search pixel point in the luminance mixing direction to determine the luminance search mean of the negative search pixel point in the negative direction; determine the luminance mean difference between the luminance reference mean and the luminance search mean of the negative search pixel point; select the maximum gradient value from the negative gradient value of the font edge pixel point in the negative direction and the positive gradient value of the font edge pixel point in the positive direction, and use the maximum gradient value and the gradient coefficient to determine the pixel area gradient; determine whether the font edge pixel point meets the search stop condition based on the luminance mean difference and the pixel area gradient of the font edge pixel point, and if the search stop condition is met, obtain the negative search distance of the pixel point.

[0088] Exemplarily, the negative search distance of the font edge pixel point is taken as an example for explanation. The determination method can be understood as taking the luminance value of the font edge pixel point and the average of the luminance value of the font edge pixel point in its luminance mixing direction as the luminance reference average of the font edge pixel point. That is to say, continuing the example in S240, if the luminance mixing direction of the font edge pixel point is negative, the luminance reference average lumaLocalAverage of the font edge pixel point is the average of luma1 and lumaCenter. Similarly, if the luminance mixing direction of the font edge pixel point is positive, the luminance reference average lumaLocalAverage of the font edge pixel point is the average of luma2 and lumaCenter.

[0089] The coordinates of the font edge pixel points and the unit pixel offset of the font edge pixel points in the brightness mixing direction are used to determine the mixing position of the font edge pixel points, and with the mixing position as the starting point, a search is performed along the negative direction of the font edge pixel points with a preset step size to obtain a negative search pixel point. That is, the coordinates of the font edge pixel point and the pixel point with the unit pixel offset of the font edge pixel point in the brightness mixing direction are selected, and the middle position of the two pixel points selected at this time is used as the mixing position, that is, the search starting point, and a search is performed along the negative direction of the font edge pixel points with a preset step size to obtain a negative search pixel point. An exemplary preset step size can be 1. 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. The value of the iteration upper limit threshold in the embodiment of the present application can be set according to actual needs.

[0090] Using the obtained luminance value of the negative search pixel and the luminance value of the auxiliary pixel in the luminance mixing direction of the font edge pixel, the luminance search mean of the font edge pixel in the negative direction can be determined. The luminance mean difference between the luminance reference mean and the luminance search mean of the font edge pixel can then be determined. The pixel region gradient can be determined by selecting the maximum gradient value from the negative gradient values ​​of the font edge pixel in the negative direction and the positive gradient values ​​of the font edge pixel in the positive direction, and using the maximum gradient value and the gradient coefficient. Based on the luminance mean difference and the pixel region gradient of the font edge pixel, it can be determined whether the font edge pixel meets the search stop condition. If the search stop condition is met, the negative search distance of the pixel is obtained.

[0091] For example, based on the coordinates of the font edge pixel points, the pixel point at the font edge pixel step step is the obtained search pixel point, the luminance value of the search pixel point is lumaStep, and the luminance value of the auxiliary pixel point in the mixing direction of the search pixel point is lumaStepGradient. The luminance search mean lumaEnd of the font edge pixel point in the luminance mixing direction can be determined, as shown in the following formula. Therefore, if the luminance mixing direction is negative, the luminance search mean can be recorded as lumaEnd1, that is, lumaEnd=lumaEnd1 at this time; if the luminance mixing direction is positive, the luminance search mean can be recorded as lumaEnd2, that is, lumaEnd=lumaEnd2 at this time.

[0092] For example, if the luminance blending direction is negative, the search luminance mean is lumaEnd1. The difference in luminance between the reference luminance mean lumaLocalAverage and the search luminance mean lumaEnd1 for the negative search pixel can be calculated. The maximum gradient value, gradient1, for the negative edge pixel of the font, and gradient2, for the positive edge pixel of the font, are selected and used together with the gradient coefficient to determine the pixel region gradient g, as shown in the following formula.

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

[0094] Among them, gradient1 is the negative gradient value of the font edge pixel in the negative direction; gradient2 is the positive gradient value of the font edge pixel in the positive direction; 0.25 is the gradient coefficient; g is the pixel area gradient.

[0095] In summary, by comparing the luminance mean difference between the luminance reference mean lumaLocalAverage of the negative search pixel point obtained at this time and the luminance search mean lumaEnd1 and the pixel area gradient, see the following formula:

[0096] Based on the brightness mean difference and pixel area gradient of the font edge pixel point, determine whether the font edge pixel point meets the search stop condition. When the search stop condition is met, the negative search distance of the pixel point is obtained. That is to say, if the formula shown above is established, that is, the font edge pixel point meets the search stop condition, the negative search distance of the pixel point can be obtained. It should be noted that the above is only illustrated by taking the brightness mixing direction as the negative direction as an example. Similarly, the above method is also applicable to determining the positive search distance when the brightness mixing direction is the positive direction.

[0097] S270: Determine a blending factor for the font edge pixels based on the negative search distance, the positive search distance, and a preset balance factor; determine a mixed luminance value for the font edge pixels based on the blending factor for the font edge pixels, the luminance value for the font edge pixels, and the luminance value in the luminance blending direction for the font edge pixels; and map the mixed luminance value and the grayscale color supported by the electronic price tag image to obtain a pixel processing result for the electronic price tag text image to be processed.

[0098] Exemplarily, when the position and brightness mixing direction of the font edge pixel point are used to search in the negative direction and the positive direction respectively, the corresponding negative search pixel point and positive search pixel point can be obtained, and then when the search stops, the negative search distance and the positive search distance can be obtained respectively. In the embodiment of the present application, the search stop condition can be set according to actual needs. In addition, when the search stops, the method for determining the negative search distance and the positive search distance in the embodiment of the present application can be set according to actual needs. The mixing factor of the font edge pixel point is determined based on the obtained negative search distance, the positive search distance and the preset balance factor, and the mixed brightness value of the font edge pixel point can be determined based on the mixing factor of the font edge pixel point, the brightness value of the font edge pixel point and the brightness value in the brightness mixing direction of the font edge pixel point. Then, according to the mixed brightness value and the grayscale color supported by the electronic price tag image, the pixel processing result of the electronic price tag text image to be processed can be mapped.

[0099] After obtaining the negative and positive search distances, the sum of the negative and positive search distances can be used to calculate the total search distance. The calculated total search distance is then compared with a preset edge length blending threshold, L, to determine whether the pixel needs to be processed. If the total search distance is greater than L, processing begins on the next font edge pixel, terminating the current operation. Otherwise, calculation of the blended brightness value for that font edge pixel begins.

[0100] Optionally, a mixing factor of the font edge pixel is determined according to the negative search distance, the positive search distance and a preset balance factor, and a mixed brightness value of the font edge pixel is determined according to 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. According to the mixed brightness value and the grayscale color supported by the electronic price tag image, a pixel processing result of the electronic price tag text image to be processed is mapped, including: taking the difference between the brightness value of the font edge pixel and the brightness reference mean of the font edge pixel as the first parameter; selecting an end closer to the edge of the font edge pixel from the positive direction search pixel and the negative direction search pixel according to the position of the font edge pixel, the negative search distance and the positive search distance, and using the brightness value of the search pixel at this end and the brightness of the pixel in the brightness mixing direction as the value of the pixel. The method comprises the steps of: determining a minimum value of a negative search distance and a positive search distance of the font edge pixel point, determining a total distance between the negative search distance and the positive search distance of the font edge pixel point, and using a ratio of the minimum value to the total distance as a third parameter; determining a blending factor of the font edge pixel point 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; determining a blending luminance value of the font edge pixel point using the blending factor of the font edge pixel point, a luminance value of the font edge pixel point, and a luminance value in a luminance blending direction of the font edge pixel point; and selecting a target grayscale value for the font edge pixel point from candidate grayscale values ​​based on the blending luminance value and the channel luminance value of the font edge pixel point to obtain a pixel processing result of the electronic price tag text image to be processed.

[0101] Exemplarily, the mixing factor of the font edge pixel points is determined based on the negative search distance, the positive search distance and the preset balance factor, and the mixed brightness value of the font edge pixel points is determined based on the mixing factor of the font edge pixel points, the brightness value of the font edge pixel points and the brightness value in the brightness mixing direction of the font edge pixel points. According to the mixed brightness value and the grayscale color supported by the electronic price tag image, the pixel processing result of the electronic price tag text image to be processed is mapped. Exemplarily, the difference between the brightness value of the font edge pixel point and the brightness reference mean of the font edge pixel point is used as the first parameter; based on the position of the font edge pixel point, the negative search distance and the positive search distance, the end closer to the edge of the font edge pixel point is selected from the positive direction search pixel point and the negative direction search pixel point, and the difference between the brightness value of the search pixel point at this end and the mean of the pixel brightness in the brightness mixing direction is used as the second parameter; the minimum value of the negative search distance and the positive search distance of the font edge pixel point is determined, and the total distance between the negative search distance and the positive search distance of the font edge pixel point is determined, and the ratio between the minimum value and the total distance is used as the third parameter; by comparing the product of the first parameter and the second parameter with the zero value, and when the product is less than or equal to zero, the mixing factor of the font edge pixel point is determined according to the third parameter and a preset balance factor. The mixing factor can be obtained by referring to the following formula.

[0102] Among them, lumaCenter is the brightness value of the edge pixel of the font; lumaLocalAverage is the reference average brightness value of the edge pixel of the font; lumaEndNearest is the brightness value of the search pixel at the end closer to the edge of the font edge pixel selected from the positive direction search pixel and the negative direction search pixel according to the position of the font edge pixel, negative search distance and positive search distance, that is, the average brightness value of the pixels at the edge closer to the two ends and the brightness value of the pixels in the brightness mixed direction; d nearest It is the ratio between the minimum value of the negative search distance and the positive search distance and the total search distance; u is the mixing factor of the font edge pixels; K is the preset balance factor, that is, the balance factor of the brightness mixing factors in the negative and positive directions. The value can be an empirical value between 0 and 1. The larger the value, the greater the pixel brightness mixing ratio in the desired pixel mixing direction, and the smaller the value, the smaller the pixel brightness mixing ratio in the desired pixel mixing direction.

[0103] When determining the mixed luminance value of the font edge pixel point using the mixing factor of the font edge pixel point, the luminance value of the font edge pixel point, and the luminance value in the luminance mixing direction of the font edge pixel point, the mixed luminance value finalLuma can be obtained by referring to the following formula.

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

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

[0106] When processing the pixels of the electronic price tag text image to be processed, the target grayscale value for the font edge pixel point can be selected from the candidate grayscale values ​​based on the mixed luminance value and channel luminance value of the font edge pixel point at this time. For example, since the grayscale colors supported by the electronic price tag are limited, the luminance value {luma} can be calculated based on the color values ​​on the R, G, and B channels of the supported grayscale colors {gray1, gray2, gray3, ...} as the candidate grayscale values. gray1 , luma gray2 , luma gray3 , …}, as shown in the following formula:

[0107] Among them, CurrColor is the target grayscale value selected from the candidate grayscale values. Grayscale colors {gray1, gray2, gray3, ...} and the brightness value {luma gray1 , luma gray2 , luma gray3 , ...} can be pre-set. It should be noted that the candidate grayscale colors are not limited to different levels of gray, but can also be other transition colors of different levels between the foreground and background colors.

[0108] Based on the technical solution described in the above embodiment of the present application, the resulting effect diagram is shown in Figures 2B and 2C, where the left figure is the effect diagram before processing and the right figure is the effect diagram after processing using the technical solution described in this embodiment. It can be seen that instead of simply adding gray blocks to the edges of the font, different shades of gray blocks are added where mixing is required, or the original black blocks are changed to gray blocks based on the calculated pixel mixed brightness value. The technical solution described in the embodiment of the present application can also be applied to image pixel processing including but not limited to Chinese characters, English letters, Arabic, Japanese and Russian, and can achieve the effects shown in Figures 2B and 2C. The technical solution described in the embodiment of the present application can also be applied to the pixel processing of electronic price tag text images with other foreground and background color combinations. In other words, 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 black text on a white background, white text on a black background, red text on a white background, and red text on a yellow background. The application scenarios of the technical solution provided in the embodiment of the present application and the background color of the electronic price tag text image can be set according to actual needs.

[0109] The embodiment of the present application first obtains the brightness value of the original pixel in the electronic price tag text image to be processed, and selects a positive reference pixel. For the brightness value of any pixel in the original pixel and the brightness value of the positive reference pixel, the brightness contrast value and edge brightness threshold of the pixel are determined, and then whether the pixel is a font edge pixel is judged. 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. According to the edge direction of the font edge pixel, the negative auxiliary pixel and the positive auxiliary pixel are determined, and the corresponding negative gradient value and positive gradient value are determined, and then the brightness mixing direction is determined. The position and brightness mixing direction of the font edge pixel are used to search in the negative direction and the positive direction respectively, and the negative search pixel and the positive search pixel are obtained until the search stops, and the negative search distance and the positive search distance are obtained respectively. The blending factor of the font edge pixel is determined based on the negative search distance, the positive search distance, and a preset balance factor. The mixed luminance value of the font edge pixel is determined based on the blending factor of the font edge pixel, the luminance value of the font edge pixel, and the luminance value in the luminance blending direction of the font edge pixel. Based on the mixed luminance value and the channel luminance value of the font edge pixel, a target grayscale value is selected from the candidate grayscale values ​​for the font edge pixel to obtain the pixel processing result of the electronic price tag text image to be processed. In an embodiment of the present application, grayscale processing is performed on the pixels of the electronic price tag text image based on the determined mixed luminance value of the font edge pixel and in the luminance blending direction of the font edge pixel to improve display clarity and smoothness, so that the font edges of the electronic price tag text image present a smooth transition effect, making the displayed font smoother and more natural, and achieving an anti-aliasing effect.

[0110] Example 3

[0111] FIG3 is a schematic diagram of the structure of an electronic price tag text image pixel processing device provided in Example 3 of the present application. As shown in FIG3, the electronic price tag text image pixel processing device includes: an edge direction determination module 310, a mixed direction determination module 320, a search distance determination module 330, and a mixed result mapping module 340. Among them:

[0112] The edge direction determination module 310 is configured to extract font edge pixels from the electronic price tag text image to be processed, select reference pixels for the font edge pixels from adjacent pixels, and determine the edge direction of the font edge pixels using the brightness values ​​of the font edge pixels and the brightness values ​​of the reference pixels; wherein the edge direction of the font edge pixels is a vertical direction or a horizontal direction;

[0113] a blending direction determining module 320 configured to select, based on the edge direction of the font edge pixel, a negative auxiliary pixel in a negative direction and a positive auxiliary pixel in a positive direction from adjacent pixels for each of the font edge pixels, and determine a brightness blending direction of the font edge pixel using the brightness value of the negative auxiliary pixel, the brightness value of the positive auxiliary pixel, and the brightness value of the font edge pixel; wherein the brightness blending direction is a negative direction or a positive direction;

[0114] The search distance determination module 330 is configured to perform searches in negative and positive directions using the positions and brightness mixing directions of the font edge pixels, obtaining negative search pixels and positive search pixels, until the search stops, thereby obtaining negative search distances and positive search distances, respectively.

[0115] The mixed result mapping module 340 is configured to determine a mixing factor for the font edge pixel points based on the negative search distance, the positive search distance, and a preset balance factor, and determine a mixed luminance value for the font edge pixel points based on the mixing factor for the font edge pixel points, the luminance value of the font edge pixel points, and the luminance value in the luminance mixing direction of the font edge pixel points. Based on the mixed luminance value and the grayscale color supported by the electronic price tag image, mapping is performed to obtain a pixel processing result for the electronic price tag text image to be processed.

[0116] The embodiment of the present application extracts font edge pixels from an electronic price tag text image to be processed, selects reference pixels for the font edge pixels from adjacent pixels, and uses the brightness value of the font edge pixels and the brightness value of the reference pixels to determine the edge direction of the font edge pixels; wherein the edge direction of the font edge pixels is a vertical direction or a horizontal direction; based on the edge direction of the font edge pixels, a negative auxiliary pixel in a negative direction and a positive auxiliary pixel in a positive direction are selected from adjacent pixels for the font edge pixels, and the brightness value of the negative auxiliary pixel, the brightness value of the positive auxiliary pixel, and the brightness value of the font edge pixel are used to determine the brightness mixing direction of the font edge pixel; wherein, The brightness mixing direction is negative or positive; the position and brightness mixing direction of the font edge pixel point are used to search in the negative direction and the positive direction respectively, to obtain negative search pixel points and positive search pixel points, until the search stops, and the negative search distance and the positive search distance are obtained respectively; the mixing factor of the font edge pixel point is determined according to the negative search distance, the positive search distance and the preset balance factor, and the mixed brightness value of the font edge pixel point is determined according to the mixing factor of the font edge pixel point, the brightness value of the font edge pixel point and the brightness value in the brightness mixing direction of the font edge pixel point, and the pixel processing result of the electronic price tag text image to be processed is mapped according to the mixed brightness value and the grayscale color supported by the electronic price tag image. In the embodiment of the present application, the pixels of the electronic price tag text image are grayscale processed according to the determined mixed brightness value of the font edge pixel point and in the brightness mixing direction of the font edge pixel point to improve the display clarity and smoothness, so that the font edge of the electronic price tag text image presents a smooth transition effect, making the displayed font smoother and more natural, and achieving an anti-aliasing effect.

[0117] Optionally, the hybrid direction determination module 320 includes:

[0118] The horizontal auxiliary point determination unit is configured to determine, for any horizontal font edge pixel point, adjacent pixels located directly above and directly below the font edge pixel point as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction, respectively;

[0119] The vertical auxiliary point determination unit is configured to determine, for any vertical font edge pixel point, adjacent pixels located to the left and right of the font edge pixel point as negative auxiliary pixels in the negative direction and positive auxiliary pixels in the positive direction, respectively;

[0120] a positive and negative gradient value determination unit configured to use the lightness value of the negative auxiliary pixel in the negative direction and the lightness value of the font edge pixel to determine the negative gradient value of the font edge pixel in the negative direction, and use the lightness value of the positive auxiliary pixel in the positive direction and the lightness value of the font edge pixel to determine the positive gradient value of the font edge pixel in the positive direction;

[0121] The brightness direction determining unit is configured to determine the brightness mixing direction of the font edge pixel point by using the negative gradient value of the font edge pixel point in the negative direction and the positive gradient value of the font edge pixel point in the positive direction.

[0122] Optionally, a positive and negative gradient value determination unit includes:

[0123] The positive and negative point determination subunit is configured to use the adjacent pixel points directly to the left and directly above the font edge pixel point as the negative auxiliary pixel point of the font edge pixel point in the negative direction, and to use the adjacent pixel points directly to the right and directly below the font edge pixel point as the positive auxiliary pixel point of the font edge pixel point in the positive direction;

[0124] a negative gradient value determining subunit configured to use 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;

[0125] The positive gradient value determination subunit is configured to use 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.

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

[0127] a mixing position determining unit configured to determine the mixing position of the font edge pixel point by using the coordinates of the font edge pixel point and the unit pixel offset of the font edge pixel point in the brightness mixing direction;

[0128] a negative search distance determination unit configured to use the mixed position of the font edge pixel point as a starting point, search along the negative direction of the font edge pixel point with a preset step length to obtain a negative search pixel point, until a search stop condition in the negative direction is satisfied, thereby obtaining a negative search distance of the font edge pixel point;

[0129] The positive search distance determination unit is configured to use the mixed position of the font edge pixel point as the starting point, and to search along the positive direction of the font edge pixel point with a preset step size to obtain the positive search pixel point until the search stop condition in the positive direction is met, thereby obtaining the positive search distance of the font edge pixel point.

[0130] Optionally, the negative search distance determining unit includes:

[0131] a reference mean value determination subunit configured to use the average of the brightness value of the font edge pixel and the brightness value of the font edge pixel in its brightness mixing direction as the brightness reference mean value of the font edge pixel;

[0132] A search mean determination subunit is configured to determine a mixing position of a font edge pixel point using the coordinates of the font edge pixel point and the unit pixel offset of the font edge pixel point in the brightness mixing direction, and to search along the negative direction of the font edge pixel point with a preset step size from the mixing position as a starting point to obtain a negative search pixel point; and to determine a brightness search mean of the font edge pixel point in the negative direction using the brightness value of the negative search pixel point and the brightness value of the auxiliary pixel point of the font edge pixel point in the brightness mixing direction;

[0133] a brightness mean difference determining subunit, configured to determine a brightness mean difference between a brightness reference mean and a brightness search mean of pixels at an edge of the font;

[0134] a regional gradient determination subunit configured to select a maximum gradient value from the negative gradient values ​​of the font edge pixel points in the negative direction and the positive gradient values ​​of the font edge pixel points in the positive direction, and determine the pixel regional gradient using the maximum gradient value and the gradient coefficient;

[0135] The negative distance obtaining subunit is configured to determine whether the font edge pixel meets the search stop condition based on the brightness mean difference and pixel area gradient of the font edge pixel, and obtain the negative search distance of the pixel if the search stop condition is met.

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

[0137] a luminance contrast value determining unit configured to obtain the luminance values ​​of original pixels in the electronic price tag text image to be processed, use adjacent pixels located immediately above, below, to the left, and to the right as positive reference pixels, and determine, for any pixel in the original pixels, a luminance contrast value of the pixel based on the luminance value of the pixel and the luminance value of the positive reference pixel;

[0138] an edge pixel determination unit configured to select a maximum value of a brightness value from the brightness contrast value of the pixel and the brightness value of the forward reference pixel, and determine an edge brightness threshold of the pixel using a preset minimum brightness threshold, a maximum brightness threshold, and the maximum value of the brightness values; and determine whether the pixel is a font edge pixel using the edge brightness threshold of the pixel and the brightness contrast value of the pixel;

[0139] The target direction determination unit is configured to, for any font edge pixel point, use the adjacent pixel points located to the upper left, lower left, upper right, and lower right of the font edge pixel point as oblique reference pixel points, and use the brightness value of the font edge pixel point and the brightness value of the oblique reference pixel point to respectively determine the horizontal edge inclination coefficient and the vertical edge inclination coefficient of the font edge pixel point, and use the horizontal edge inclination coefficient and the vertical edge inclination coefficient to determine the edge direction of the font edge pixel point.

[0140] Optionally, the mixed result mapping module 340 includes:

[0141] A first parameter determination unit is configured to use the difference between the brightness value of the font edge pixel and the reference average brightness value of the font edge pixel as the first parameter;

[0142] a second parameter determining unit configured to select, based on the position of the font edge pixel point, the negative search distance, and the positive search distance, an end of the positive search pixel point and the negative search pixel point that is closer to the edge of the font edge pixel point, and use a difference between a brightness value of the search pixel point at the end and an average brightness value of pixels in a brightness mixing direction as a second parameter;

[0143] a third parameter determination unit configured to determine a minimum value between a negative search distance and a positive search distance of a pixel point at an edge of the font, and to determine a total distance between the negative search distance and the positive search distance of the pixel point at the edge of the font, and to use a ratio between the minimum value and the total distance as a third parameter;

[0144] a blending factor determining unit configured to determine a blending factor of the edge pixel of the font according to a 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;

[0145] a mixed brightness value determining unit configured to determine the mixed brightness value of the font edge pixel point by using the mixing factor of the font edge pixel point, the brightness value of the font edge pixel point, and the brightness value of the font edge pixel point in the brightness mixing direction;

[0146] The result obtaining unit is configured to select a target grayscale value for the font edge pixel point from the candidate grayscale values ​​according to the mixed brightness value and the channel brightness value of the font edge pixel point, and obtain a pixel processing result of the electronic price tag text image to be processed.

[0147] An electronic price tag text image pixel processing device provided in an embodiment of the present application can execute an electronic price tag text image pixel processing method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects of the execution method.

[0148] Example 4

[0149] FIG4 shows a block diagram of an electronic device 400 that can be used to implement an embodiment of the present application. The electronic device is used 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 processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are for example only.

[0150] As shown in Figure 4, the electronic device 400 includes at least one processor 410 and a memory connected to the at least one processor 410, such as a read-only memory (ROM), a random access memory (RAM), etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 410 can perform various appropriate actions and processes according to the computer program stored in the ROM 420 or the computer program loaded from the storage unit 480 to the RAM 430. Various programs and data required for the operation of the electronic device 400 can also be stored in the RAM 430. The processor 410, ROM 420 and RAM 430 are connected to each other via a bus 440. An input / output (I / O) interface is also connected to the bus 440.

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

[0152] The processor 410 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the processor 410 can include a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 410 performs the various methods and processes described above, such as a method for processing pixels of text images on electronic price tags.

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

[0154] Various embodiments of the systems and techniques described 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 can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0155] Computer programs for implementing the methods of the present application 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 the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0156] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable storage medium can include an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. The example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, RAM 430, ROM 420, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0157] 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 a pointing device (such as a mouse or a trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (such as visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0158] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0159] A computing system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. The client-server relationship arises through computer programs running on the respective computers and establishing a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within a cloud computing service ecosystem that addresses the management difficulties and limited business scalability of traditional physical hosts and virtual private servers (VPS).

[0160] The various forms of processes shown above can be used to reorder, add or delete steps. For example, the multiple steps described in this application can be performed in parallel, sequentially or in a different order, as long as the desired results of this application can be achieved.

Claims

1. A method for processing pixels of text images on electronic price labels, comprising: Extracting font edge pixels from the electronic price tag text image to be processed, selecting reference pixels for the font edge pixels from adjacent pixels, and determining edge directions of the font edge pixels using the brightness values ​​of the font edge pixels and the brightness values ​​of the reference pixels; wherein the edge directions of the font edge pixels are vertical or horizontal; Based on the edge direction of the font edge pixel, a negative auxiliary pixel in a negative direction and a positive auxiliary pixel in a positive direction are selected from adjacent pixels for the font edge pixel, and the brightness value of the negative auxiliary pixel, the brightness value of the positive auxiliary pixel, and the brightness value of the font edge pixel are used to determine the brightness mixing direction of the font edge pixel; wherein the brightness mixing direction is a negative direction or a positive direction; The positions of the font edge pixels and the brightness mixing direction are used to search in the negative direction and the positive direction respectively, to obtain the negative search pixel points and the positive search pixel points, until the search stops, to obtain the negative search distance and the positive search distance respectively; The mixing factor of the font edge pixel points is determined based on the negative search distance, the positive search distance and the preset balance factor, and the mixed brightness value of the font edge pixel points is determined based on the mixing factor of the font edge pixel points, the brightness value of the font edge pixel points and the brightness value in the brightness mixing direction of the font edge pixel points. According to the mixed brightness value and the grayscale color supported by the electronic price tag image, the pixel processing result of the electronic price tag text image to be processed is mapped.

2. The method according to claim 1, wherein Based on the edge direction of the font edge pixel, a negative auxiliary pixel in the negative direction and a positive auxiliary pixel in the positive direction are selected from adjacent pixels for the font edge pixel, and the brightness value of the negative auxiliary pixel, the brightness value of the positive auxiliary pixel, and the brightness value of the font edge pixel are used to determine the brightness mixing direction of the font edge pixel, including: For any horizontal font edge pixel point, the adjacent pixel points located directly above and directly below the font edge pixel point are used as negative auxiliary pixel points in the negative direction and positive auxiliary pixel points in the positive direction respectively; For any vertical font edge pixel point, the adjacent pixel points located to the left and right are used as negative auxiliary pixel points in the negative direction and positive auxiliary pixel points in the positive direction respectively; The negative gradient value of the font edge pixel in the negative direction is determined by using the lightness value of the negative auxiliary pixel in the negative direction and the lightness value of the font edge pixel, and the positive gradient value of the font edge pixel in the positive direction is determined by using the lightness value of the positive auxiliary pixel in the positive direction and the lightness value of the font edge pixel; 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 are used to determine the brightness mixing direction of the font edge pixel.

3. The method according to claim 2, wherein: The method comprises: using the lightness value of the negative auxiliary pixel in the negative direction and the lightness value of the edge pixel of the font to determine the negative gradient value of the edge pixel of the font in the negative direction; and using the lightness value of the positive auxiliary pixel in the positive direction and the lightness value of the edge pixel of the font to determine the positive gradient value of the edge pixel of the font in the positive direction. The adjacent pixel points immediately to the left and immediately above the edge pixel of the font are used as negative auxiliary pixel points of the edge pixel of the font in the negative direction, and the adjacent pixel points immediately to the right and immediately below the edge pixel of the font are used as positive auxiliary pixel points of the edge pixel of the font 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 used 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 used as the positive gradient value of the font edge pixel in the positive direction.

4. The method according to any one of claims 1 to 3, wherein The position and brightness mixing direction of the font edge pixel point are used to search in the negative direction and the positive direction respectively, and the negative search pixel point and the positive search pixel point are obtained until the search stops, and the negative search distance and the positive search distance are obtained respectively, including: The blending position of the font edge pixel point is determined by using the coordinates of the font edge pixel point and the unit pixel offset of the font edge pixel point in the brightness blending direction; Using the mixed position of the font edge pixel point as the starting point, searching along the negative direction of the font edge pixel point with a preset step size to obtain a negative search pixel point, until the search stop condition in the negative direction is met, and the negative search distance of the font edge pixel point is obtained; Taking the mixed position of the font edge pixel point as the starting point, the positive search pixel point is searched along the positive direction of the font edge pixel point with a preset step size until the search stop condition in the positive direction is met, and the positive search distance of the font edge pixel point is obtained.

5. The method according to claim 4, wherein Using the mixed position of the font edge pixel point as the starting point, with a preset step size, search along the negative direction of the font edge pixel point to obtain a negative search pixel point until the search stop condition in the negative direction is met, and obtain the negative search distance of the font edge pixel point, including: The average of the brightness value of the edge pixel of the font and the brightness value of the edge pixel of the font in its brightness mixing direction is used as the brightness reference average value of the edge pixel of the font; The coordinates of the font edge pixel points and the unit pixel offset of the font edge pixel points in the brightness mixing direction are used to determine the mixing position of the font edge pixel points. Starting from the mixing position, a search is performed along the negative direction of the font edge pixel points with a preset step size to obtain a negative search pixel point. The brightness value of the negative search pixel point and the brightness value of the auxiliary pixel points of the font edge pixel point in the brightness mixing direction are used to determine the brightness search mean value of the font edge pixel point in the negative direction. Determine the brightness mean difference between the brightness reference mean and the brightness search mean of the edge pixels of the font; Selecting a maximum gradient value from the negative gradient values ​​of the font edge pixel points in the negative direction and the positive gradient values ​​of the font edge pixel points in the positive direction, and using the maximum gradient value and the gradient coefficient to determine the pixel area gradient; According to the brightness mean difference and pixel area gradient of the font edge pixel point, it is determined whether the font edge pixel point meets the search stop condition. If the search stop condition is met, the negative search distance of the pixel point is obtained.

6. The method according to claim 1, wherein Extracting font edge pixels from the electronic price tag text image to be processed, selecting reference pixels for the font edge pixels from adjacent pixels, and determining edge directions of the font edge pixels using the brightness values ​​of the font edge pixels and the reference pixels, including: Obtain the brightness value of the original pixel in the electronic price tag text image to be processed, use the adjacent pixels at the upper, lower, left, and right positions as positive reference pixels, and determine the brightness contrast value of any pixel in the original pixel based on the brightness value of the pixel and the brightness value of the positive reference pixel; Selecting 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 determining the edge brightness threshold of the pixel using a preset minimum brightness threshold, a maximum brightness threshold, and the maximum value of the brightness values; and determining whether the pixel is a font edge pixel using the edge brightness threshold of the pixel and the brightness contrast value of the pixel; For any font edge pixel point, the adjacent pixel points located to the upper left, lower left, upper right, and lower right of the font edge pixel point are used as oblique reference pixel points, and the brightness value of the font edge pixel point and the brightness value of the oblique reference pixel point are used to respectively determine the horizontal edge tendency coefficient and the vertical edge tendency coefficient of the font edge pixel point, and the horizontal edge tendency coefficient and the vertical edge tendency coefficient are used to determine the edge direction of the font edge pixel point.

7. The method according to claim 1, wherein Determining a blending factor of the font edge pixel points based on the negative search distance, the positive search distance, and a preset balance factor, and determining a mixed brightness value of the font edge pixel points based on the blending factor of the font edge pixel points, the brightness value of the font edge pixel points, and the brightness value of the font edge pixel points in the brightness blending direction, and mapping the pixel processing result of the electronic price tag text image to be processed based on the mixed brightness value and the grayscale color supported by the electronic price tag image, including: The difference between the brightness value of the font edge pixel and the reference average brightness value of the font edge pixel is used as the first parameter; According to the position of the font edge pixel point, the negative search distance, and the positive search distance, the end of the positive search pixel point and the negative search pixel point that is closer to the edge of the font edge pixel point is selected, and the difference between the brightness value of the search pixel point at this end and the average brightness of the pixels in the brightness mixing direction is used as the second parameter; Determining the minimum value of the negative search distance and the positive search distance of the edge pixel of the font, and determining the total distance between the negative search distance and the positive search distance of the edge pixel of the font, and using the ratio of the minimum value to the total distance as a third parameter; When the product of the first parameter and the second parameter is less than or equal to zero, determining a blending factor of the edge pixel of the font according to the third parameter and a preset balance factor; Determine a mixed brightness value of the font edge pixel by using a mixing factor of the font edge pixel, a brightness value of the font edge pixel, and a brightness value in a brightness mixing direction of the font edge pixel; According to the mixed brightness value and channel brightness value of the font edge pixel point, a target grayscale value is selected for the font edge pixel point from the candidate grayscale values ​​to obtain a pixel processing result of the electronic price tag text image to be processed.

8. An electronic price label text image pixel processing device, comprising: an edge direction determination module configured to extract font edge pixels from the electronic price tag text image to be processed, select reference pixels for the font edge pixels from adjacent pixels, and determine the edge direction of the font edge pixels using the brightness values ​​of the font edge pixels and the brightness values ​​of the reference pixels; wherein the edge direction of the font edge pixels is a vertical direction or a horizontal direction; a mixing direction determining module configured to select, based on the edge direction of a font edge pixel, a negative auxiliary pixel in a negative direction and a positive auxiliary pixel in a positive direction from adjacent pixels for each font edge pixel, and determine a brightness mixing direction of the font edge pixel using the brightness value of the negative auxiliary pixel, the brightness value of the positive auxiliary pixel, and the brightness value of the font edge pixel; wherein the brightness mixing direction is a negative direction or a positive direction; A search distance determination module is configured to use the position of the font edge pixel point and the brightness mixing direction to perform a search in a negative direction and a search in a positive direction respectively, to obtain a negative search pixel point and a positive search pixel point, until the search stops, to obtain a negative search distance and a positive search distance respectively; The mixed result mapping module is configured to determine a mixing factor of a font edge pixel point based on a negative search distance, a positive search distance, and a preset balance factor, and determine a mixed brightness value of the font edge pixel point based on the mixing factor of the font edge pixel point, a brightness value of the font edge pixel point, and a brightness value in a brightness mixing direction of the font edge pixel point. Based on the mixed brightness value and the grayscale color supported by the electronic price tag image, a pixel processing result of the electronic price tag text image to be processed is mapped.

9. An electronic device comprising: one or more processors; a memory for storing 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 according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for processing pixels of text images on an electronic price tag according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and computer readable storage medium

    CN112150368A

  • Character display edge processing method and device, terminal equipment and storage medium

    CN115424588A

  • Character display method, device and equipment based on ink screen and storage medium

    CN115691434A

  • Electronic price tag character image pixel processing method and device, equipment and medium

    CN118115380A

  • System and method for anti-aliasing of text overlays on electronic images

    US6154576A