Edge enhancement method, image forming operation method, image forming operation device and storage medium

By determining the edge histogram and target threshold and adjusting the edge binarized image data, the problem of edge disconnection in the prior art is solved, and image quality and user experience are improved.

CN120543387APending Publication Date: 2025-08-26ZHUHAI PANTUM ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510565712.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

In the prior art, after sharpening filtering or edge image overlapping with the original image, the image binarization process still has edge disconnection problems, resulting in poor printing effect and affecting user experience.

Method used

By determining the edge histogram, calculate the edge target threshold, adjust the edge target threshold to determine the edge binarized image data, avoid edge disconnection, and improve image quality.

Benefits of technology

Effectively avoid edge disconnection, improving image quality and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120543387A_ABST
    Figure CN120543387A_ABST
Patent Text Reader

Abstract

The invention provides an edge enhancement method, an image forming operation method, an image forming operation device and a storage medium. The method comprises the following steps: firstly, determining an edge histogram according to an edge image corresponding to an original image; then, according to the edge histogram, determining an edge target threshold value; and finally, determining edge binarization image data according to the edge target threshold. It can be understood that the edge target threshold is determined according to the data distribution of the edge histogram, it can be ensured that the obtained binarized image data is more accurate to a certain extent, the problem of edge line breakage is effectively avoided, the image quality is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image forming technology, and in particular to an edge enhancement method, an image forming operation method, a device and a storage medium. Background Art

[0002] Image forming devices typically perform binarization during the scanning process. Because pixels in an image contain a wide variety of tones, binarization can be used to create an image with rich tones that has a local average grayscale similar to that of the original continuous-tone image, leveraging the characteristics of the human visual system.

[0003] However, due to the characteristics of the relevant algorithms, the edge contours of the original image may become blurred after the error diffusion process. To address this problem, in the existing technology, the edge is highlighted by using sharpening filtering or by overlapping the edge image with the original image before performing image binarization.

[0004] However, after highlighting the edges through sharpening filtering or overlapping calculation of the edge image and the original image, the problem of edge disconnection still exists when binarizing the image, which results in poor printing effect and ultimately affects the user experience.

[0005] It should be pointed out that the information disclosed in the background technology section of this application is only intended to deepen the understanding of the general background technology of this application, and should not be regarded as an admission or any form of implication that the information constitutes prior art already known to those skilled in the art. Summary of the Invention

[0006] In view of this, the present application provides an edge enhancement method, an image forming operation method, a device and a storage medium, so as to solve the problem in the prior art that after highlighting the edges through sharpening filtering or overlapping calculation of the edge image and the original image, the image is binarized and still has broken edges, which results in poor printing effect and ultimately affects the user experience.

[0007] In a first aspect, an embodiment of the present application provides a method for edge enhancement of an image, characterized in that the method includes:

[0008] determining an edge histogram based on an edge image corresponding to an original image, wherein the original image is an image acquired by an image forming device through a scanning operation, and the edge histogram is used to represent a correspondence between grayscale values ​​and numbers of pixels in the edge image corresponding to the original image;

[0009] Determining an edge target threshold according to the edge histogram;

[0010] According to the edge target threshold, edge binarization image data is determined, wherein the edge binarization image data is the binarization image data corresponding to the edge image portion in the original image, and the binarization image data is used to instruct the image forming device to perform a binarization image forming operation on the original image.

[0011] In the embodiments of the present application, an edge histogram is first determined based on the edge image corresponding to the original image; then, an edge target threshold is determined based on the edge histogram; finally, edge binarized image data is determined based on the edge target threshold. The determined binarized image data results in a higher degree of image restoration. It can be understood that adjusting the edge target threshold based on the correspondence between the grayscale value and the number of pixels in the edge image can, to a certain extent, ensure that the obtained binarized image data is more accurate, thereby effectively avoiding the problem of edge disconnection, improving image quality, and enhancing the user experience.

[0012] In a possible implementation, determining an edge target threshold according to the edge histogram includes:

[0013] Determining a target grayscale value based on the edge histogram, where the target grayscale value is a grayscale value having the largest number of pixels less than or equal to a first preset grayscale value, wherein the first preset grayscale value is a grayscale value near a boundary between a shadow area and an intermediate area, and the second preset grayscale value is greater than the first preset grayscale value;

[0014] Determining whether a difference between the first preset grayscale value and the target grayscale value is greater than or equal to a preset difference value;

[0015] When the difference between the first preset grayscale value and the target grayscale value is greater than or equal to a preset difference value, the first preset grayscale value is used as the edge target threshold.

[0016] In an embodiment of the present application, the target grayscale value is first determined based on the edge histogram; then, it is determined whether the difference between the first preset grayscale value and the target grayscale value is greater than or equal to the difference preset value; when the difference between the first preset grayscale value and the target grayscale value is greater than or equal to the difference preset value, the first preset grayscale value is used as the edge target threshold. It can be understood that by comparing the difference between the first preset grayscale value and the target grayscale value with the difference preset value, when the first preset grayscale value differs greatly from the target grayscale value, to some extent, it indicates that the image data is distributed more in the darker part of the shadow area and less in the brighter part of the shadow area. At this time, the edge target threshold is set to the first preset grayscale value, that is, it is set to a lower value. That is, when the image data is distributed less in the brighter part of the shadow area, the edge target threshold is set to a smaller value, which is more conducive to obtaining edge binarization data that is closer to the edge image of the original image and avoids the problem of edge disconnection. The present application personalizes the edge target threshold according to different situations, rather than always using a fixed edge target threshold, which can ensure that the final determined edge target threshold is more accurate, and thus ensures that the obtained binary image data is more accurate, and ultimately effectively avoids the problem of edge disconnection, improves image quality, and improves user experience.

[0017] In a possible implementation, the method further includes:

[0018] When the difference between the first preset grayscale value and the target grayscale value is less than a preset difference value, the second preset grayscale value is used as the edge target threshold.

[0019] In an embodiment of the present application, when the difference between the first preset grayscale value and the target grayscale value is less than the preset difference value, the second preset grayscale value is used as the edge target threshold. It can be understood that when the difference between the first preset grayscale value and the target grayscale value is less than the preset difference value, it means that the image data is distributed more in the brighter part of the shadow area. At this time, the second preset grayscale value is used as the edge target threshold. The second preset grayscale value is greater than the first preset grayscale value. Using the second preset grayscale value as the edge target threshold is more conducive to obtaining edge binarization data that is closer to the edge image of the original image. The present application determines the edge target threshold in a personalized manner according to different situations, rather than using a fixed edge target threshold. This can ensure that the determined edge target threshold is more accurate, thereby ensuring that the obtained binarized image data is more accurate, and ultimately effectively avoids the problem of edge disconnection, improves image quality, and enhances user experience.

[0020] In a second aspect, an embodiment of the present application provides an image forming method, characterized by comprising:

[0021] Determine edge binarization image data according to any one of the image edge enhancement methods described in the first aspect;

[0022] Determine original binary image data according to the original image and a preset threshold, wherein the original binary image data is the binary image data corresponding to the original image;

[0023] determining target binarized image data according to the edge binarized image data and the original binarized image data, wherein the target binarized image data includes the edge binarized image data;

[0024] The image forming device is controlled to execute an image forming job based on the target binarized image data.

[0025] In an embodiment of the present application, first, edge binarized image data is determined according to any one of the image edge enhancement methods described in the first aspect; then, original binarized image data is determined based on the original image and a preset threshold; then, target binarized image data is determined based on the edge binarized image data and the original binarized image data; and finally, an image forming device is controlled to perform an image forming operation based on the target binarized image data. It can be understood that the target binarized image data determined based on the edge binarized image data can more accurately represent the original image, thereby effectively avoiding the problem of edge disconnection, improving image quality, and enhancing user experience.

[0026] In a possible implementation, determining the original binary image data according to the original image and a preset threshold includes:

[0027] The original image and the preset threshold are input into an error diffusion algorithm model to output original binary image data.

[0028] In the embodiment of the present application, the original image and the preset threshold are input into the error diffusion algorithm model to output the original binary image data. It can be understood that based on the error diffusion algorithm model, more accurate original binary image data can be determined, thereby making the final image restoration higher.

[0029] In a possible implementation, determining the original binary image data according to the original image and a preset threshold includes:

[0030] According to the distribution of pixels of the original image, the preset threshold is modified to obtain a modified preset threshold, wherein the modified preset threshold is positively correlated with the distribution density of the pixels of the original image;

[0031] Original binary image data is determined according to the original image and the corrected preset threshold.

[0032] In the embodiment of the present application, first, a preset threshold is modified based on the distribution of pixels in the original image; then, the original binary image data is determined based on the original image and the modified preset threshold. It can be understood that by modifying the preset threshold, the determined original binary image data can be made more accurate, thereby achieving a higher degree of image restoration in the final determination.

[0033] In a possible implementation, determining target binarized image data according to the edge binarized image data and the original binarized image data includes:

[0034] The edge binarized image data is used to replace the image data corresponding to the edge image in the original binarized image data to determine target binarized image data.

[0035] In an embodiment of the present application, by replacing the image data corresponding to the edge image in the original binary image data with the edge binary image data, the target binary image data can be determined more simply and accurately, thereby effectively avoiding the problem of edge disconnection, improving image quality, and enhancing user experience.

[0036] In a third aspect, an embodiment of the present application provides an image edge enhancement device, comprising:

[0037] an edge histogram determination module, configured to determine an edge histogram based on an edge image corresponding to an original image, wherein the original image is an image acquired by the image forming device through a scanning operation, and the edge histogram is configured to represent a correspondence between grayscale values ​​and the number of pixels in the edge image corresponding to the original image;

[0038] An edge target threshold determination module, configured to determine an edge target threshold according to the edge histogram;

[0039] The edge binarization image data determination module is used to determine the edge binarization image data according to the edge target threshold value, wherein the edge binarization image data is the binarization image data corresponding to the edge image portion in the original image, and the binarization image data is used to instruct the image forming device to perform a binarization image forming operation on the original image.

[0040] In a fourth aspect, an embodiment of the present application provides an image forming device, characterized in that it includes:

[0041] an edge binarization image data determination module, configured to determine edge binarization image data according to the apparatus of the third aspect;

[0042] An original binary image data determination module is used to determine original binary image data according to the original image and a preset threshold, wherein the original binary image data is the binary image data corresponding to the original image;

[0043] a target binarized image data determining module, configured to determine target binarized image data according to the edge binarized image data and the original binarized image data, wherein the target binarized image data includes the edge binarized image data;

[0044] The control module is used to control the image forming device to perform an image forming operation according to the target binarized image data.

[0045] In the fifth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described in the first aspect or the second aspect.

[0046] It is understood that the image edge enhancement device provided in the third aspect, the image forming device provided in the fourth aspect, and the computer-readable storage medium provided in the fifth aspect are all used to perform the method provided in this application. Therefore, the beneficial effects achieved by these devices can be referenced to the beneficial effects of the corresponding methods and will not be further elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0048] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application.

[0049] Figure 2 A schematic diagram of image binarization processing provided in an embodiment of the present application.

[0050] Figure 3 A schematic diagram of another image binarization process provided in an embodiment of the present application.

[0051] Figure 4 A flowchart of an image binarization processing algorithm provided in an embodiment of the present application.

[0052] Figure 5 A flowchart of an image edge enhancement method provided in an embodiment of the present application.

[0053] Figure 6 A schematic diagram of an edge histogram provided in an embodiment of the present application.

[0054] Figure 7 A schematic diagram of printing effects at different printing depths provided in an embodiment of the present application.

[0055] Figure 8 A schematic diagram of another edge histogram provided in an embodiment of the present application.

[0056] Figure 9 A schematic diagram of another edge histogram provided in an embodiment of the present application.

[0057] Figure 10 A schematic flow chart of an image forming method according to an embodiment of the present application.

[0058] Figure 11 A schematic structural diagram of an image edge enhancement device provided in an embodiment of the present application.

[0059] Figure 12 A schematic structural diagram of an image forming operation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0061] It should be clear that the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0062] The terms used in the embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a", "an", "the" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.

[0063] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the associated objects.

[0064] To facilitate understanding, a specific application scenario is first exemplified below.

[0065] See also Figure 1, is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, this application scenario includes an image forming device 101. It should be noted that the image forming device described herein is merely an example and should not be construed as limiting the scope of protection of this application. For example, image forming devices include, but are not limited to, printers, copiers, fax machines, scanners, and multifunction devices that integrate printing, copying, faxing, and scanning functions. Their function is to print images or text on imaging media.

[0066] In practical applications, image forming devices typically perform binarization during the image scanning process. This involves comparing the grayscale value of each pixel in the scanned original image with a preset grayscale value; setting the grayscale value of pixels greater than the preset grayscale value to the grayscale value corresponding to white; and setting the grayscale value of pixels less than the preset grayscale value to the grayscale value corresponding to black.

[0067] For easier understanding, see Figure 2 , is a schematic diagram of an image binarization process provided by an embodiment of the present application. As shown in the figure, Figure 2 The image on the left in the middle represents the original image that has not been binarized. Figure 2 The image on the right side of the middle represents the image after binarization processing.

[0068] Grayscale refers to the logarithmic relationship between white and black, also known as grayscale. Grayscale values ​​generally range from 0 to 255, with white at 255 and black at 0.

[0069] Depend on Figure 2 It can be seen that simply comparing the grayscale value of each pixel in the original image with the preset grayscale value will result in lower quality of the final image.

[0070] In order to make the local average grayscale of the generated image similar to the local average grayscale of the original continuous-tone image, the binarization of the pixel points can be used to approximate the grayscale value of the original image. That is, after the image with rich gradations is binarized, the characteristics of the human eye's visual system are used to make the local average grayscale of the generated image similar to the local average grayscale of the original continuous-tone image.

[0071] For easier understanding, see Figure 3 , is a schematic diagram of another image binarization process provided by an embodiment of the present application. As shown in the figure, Figure 3 The image on the left in the middle represents the original image that has not been binarized. Figure 3 The image on the right in the figure shows the image after binarization. Figure 3 It can be seen that although Figure 3The image on the middle right is still only in black and white, but it can more clearly reflect the information of the original image.

[0072] In the specific implementation, Figure 3 The image binarization methods shown here typically include dithering and error diffusion. The error diffusion algorithm scans each pixel individually and then uses a matrix filter composed of weighted coefficients to diffuse the resulting error to adjacent pixels. This is a pixel-neighborhood-based processing method.

[0073] For easier understanding, see Figure 4 , which is a flow chart of an image binarization processing algorithm provided in an embodiment of the present application. It can be understood that, under normal circumstances, the algorithm traverses a specific path from left to right when processing pixels. Specifically, when the grayscale of the input pixel is I(m,n), the grayscale value I(m,n) of the pixel is summed with the error compensation of the loss grayscale obtained based on the previous pixel to obtain U(m,n); the summed U(m,n) is compared with the threshold B(m,n) to determine the output value corresponding to the pixel; then the difference between the summed U(m,n) and the threshold B(m,n) is used as the loss grayscale E(m,n); then the error compensation of the loss grayscale E(m,n) is determined based on the current weight coefficient for the binarization operation of the next pixel.

[0074] It can be understood that the image processed by this algorithm is compensated for the local grayscale loss, thereby maintaining the local grayscale value unchanged. The key to the algorithm lies in determining the size and direction of error diffusion. In the coefficient matrix, the weight coefficients in the horizontal and vertical directions are larger than those in the diagonal direction. This is set by the different sensitivities of human visual perception in different directions.

[0075] However, due to the characteristics of the related algorithms, the edges of the original image may become blurred after the error diffusion process. To address this problem, there are specific solutions as follows.

[0076] First, edge highlighting can be achieved by applying a sharpening filter or by overlaying the edge image with the original image before binarization. However, even after highlighting the edges through sharpening filters or overlaying the edge image with the original image, binarization still results in broken edges, resulting in poor printing quality and ultimately affecting the user experience.

[0077] Second, by overlaying the edge image with the original image to obtain optimal edge-enhanced image information, and then performing halftone screening on the image, the image edges can be enhanced. However, the overlay of the edge image with the original image requires multiple adjustments to obtain the optimal edge-enhanced image information, which is inefficient.

[0078] Third, edge enhancement is achieved by calculating the average pixel value of the edge area or comparing the current input pixel with a threshold. If the value is greater than the threshold, no powdering is applied, while if the value is less than the threshold, powdering is applied. However, the threshold determined by this method is not precise enough, resulting in lower quality in some areas of the image.

[0079] To address the above issues, in an embodiment of the present application, an edge histogram is first determined based on the edge image corresponding to the original image; then, an edge target threshold is determined based on the edge histogram; finally, edge binary image data is determined based on the edge target threshold, resulting in a higher degree of restoration. It is understood that adjusting the edge target threshold based on the data distribution of the edge histogram can, to a certain extent, ensure that the obtained binary image data is more accurate, thereby effectively avoiding the problem of edge disconnection, improving image quality, and enhancing user experience. Specifically, a detailed description is provided below in conjunction with the accompanying drawings and specific embodiments.

[0080] See also Figure 5 , is a flow chart of an image edge enhancement method provided by an embodiment of the present application. This method can be applied to Figure 1 In the application scenario shown in Figure 5 As shown, it mainly includes the following steps.

[0081] Step S501: determining an edge histogram according to an edge image corresponding to an original image.

[0082] In an embodiment of the present application, after the image forming device begins scanning an image, an edge histogram is determined based on the edge image corresponding to the original image. It is understood that after the image forming device begins scanning an image, the edge image in the original image is first identified, and then histogram statistics are performed on the pixels in the identified edge image. The original image is an image obtained by the image forming device through a scanning operation; the edge histogram is used to represent the corresponding relationship between the grayscale value and the number of pixels in the edge image corresponding to the original image.

[0083] In a possible implementation, when the image forming device is scanning an image, when a pixel corresponding to an edge image is identified, the edge histogram can be directly updated without acquiring the entire edge image and then performing histogram statistics.

[0084] To understand the marginal histogram, see Figure 6, is a schematic diagram of an edge histogram provided in an embodiment of the present application. As shown in the figure, the abscissa of the edge histogram is the grayscale value, and the ordinate is the number of pixels. Of course, the range of the grayscale value of the abscissa of the histogram can also be proportionally reduced to 0-15. That is, in the edge histogram, 0 represents black and 15 represents white.

[0085] Of course, it should be pointed out that, in a possible implementation, the abscissa of the edge histogram may be the average value of the grayscale values ​​of the fixed-area regions, and the ordinate is the number of the fixed-area regions.

[0086] To facilitate understanding, we'll use a 5×5 scanning window as an example to explain how to form an edge histogram. First, we determine whether there are any pixels in the edge image within the 5×5 scanning window. If there are any pixels in the edge image within the scanning window, we calculate the average grayscale value within the window and dynamically update the histogram.

[0087] like Figure 6 As shown, according to different grayscale values, the edge histogram information can be divided into shadow area, middle area and highlight area. In order to ensure the continuity and accuracy of the edge image, it is usually necessary to ensure that the shadow area is black after binarization.

[0088] It should be pointed out that before analyzing the edge histogram and the distribution of positions that need to be powdered, the printing bit depth must be determined first. Different printing bit depths contain different powdering amounts. For example, a 1-bit printing bit depth includes two powdering amounts: powdering and no powdering; a 2-bit printing bit depth divides the powdering amount from no powdering to powdering into four different powdering amounts; a 4-bit printing bit depth divides the powdering amount from no powdering to powdering into sixteen different powdering amounts. It can be understood that the more detailed the powdering amount is divided, the more vivid the final printing effect will be. For ease of understanding, see Figure 7 , is a schematic diagram of the printing effect under different printing depths provided by the embodiment of the present application. Figure 7 As shown, a 4-bit print depth produces the most vivid printing effect.

[0089] For ease of understanding, see Table 1, which is a schematic diagram of powder coating at a 2-bit printing depth provided in an embodiment of the present application.

[0090] Table 1:

[0091]

[0092] The pixel values ​​and grayscale thresholds in Table 1 are expressed in hexadecimal, corresponding to grayscale values ​​of 0-255. "Pixel value" represents the pixel value of the edge input pixel. The four powder application levels in Table 1—states 00, 01, 11, and 10—correspond to four different powder application levels for a 2-bit print bit depth. Each state corresponds to three grayscale thresholds.

[0093] Specifically, when using a 2-bit printing bit depth, the corresponding powder application amount can be determined based on the pixel value and grayscale threshold. For example, when the input pixel values ​​are all greater than the corresponding three preset values, the powder application amount corresponding to the 11 state is output; when the output pixel value is greater than the corresponding two preset values, the powder application amount corresponding to the 10 state is output; when the output pixel value is greater than the corresponding one preset value, the powder application amount corresponding to the 01 state is output; and when the output pixel values ​​are all less than the three preset values, the powder application amount corresponding to the 00 state is output.

[0094] Step S502: Determine the edge target threshold according to the edge histogram.

[0095] In the embodiment of the present application, after the edge histogram is determined, the edge target threshold is determined according to the edge histogram.

[0096] Specifically, in one possible implementation, a determination is first made as to whether the edge histogram is bimodal. Only when the edge histogram is bimodal is a target grayscale value determined based on the edge histogram. A determination is then made as to whether the difference between a first preset grayscale value and the target grayscale value is greater than or equal to a preset difference value. When the difference between the first preset grayscale value and the target grayscale value is greater than or equal to the preset difference value, the first preset grayscale value is used as the target threshold. The target grayscale value is the grayscale value with the largest number of pixels less than or equal to the first preset grayscale value. The first preset grayscale value is the grayscale value near the boundary between the shadow area and the middle area.

[0097] Among them, the bimodal shape means that within a certain grayscale value range in the shadow area and highlight area of ​​the edge histogram, the distribution ratio of pixel points is greater than the preset distribution ratio; within any grayscale value range in the middle area, the distribution ratio of pixel points is less than the preset distribution ratio.

[0098] Of course, those skilled in the art may also set up a method for determining whether the edge histogram is of other shapes, and then determine the edge target threshold according to other corresponding principles. This application does not impose any specific restrictions on this.

[0099] For easier understanding, see Figure 8, which is a schematic diagram of another edge histogram provided in an embodiment of the present application. As shown in the figure, L1 represents the target grayscale value, L2 represents the first preset grayscale value, and L3 represents the difference between the first preset grayscale value and the target grayscale value. It can be understood that when the target grayscale value is far from the boundary between the shadow area and the middle area, the boundary between the shadow area and the middle area, i.e., the first preset grayscale value, is used as the edge target threshold.

[0100] In a possible implementation, the first preset grayscale value may not be at the boundary between the shadow area and the middle area, but may be another grayscale value near the boundary between the shadow area and the middle area. This application does not impose any specific restrictions on this.

[0101] In an embodiment of the present application, by comparing the difference between the first preset grayscale value and the target grayscale value with the difference preset value, when the first preset grayscale value differs greatly from the target grayscale value, to some extent, it indicates that the image data is distributed more in the darker part of the shadow area and less in the brighter part of the shadow area. At this time, the edge target threshold is set to the first preset grayscale value, that is, it is set to a lower value. That is, when the image data is distributed less in the brighter part of the shadow area, the edge target threshold is set to a smaller value, which is more conducive to obtaining edge binarization data that is closer to the edge image of the original image and avoids the problem of edge disconnection. The present application personalizes the edge target threshold according to different situations, instead of always using a fixed edge target threshold. The specific grayscale value is personalized as the edge target threshold according to the actual portrait requirements, which can ensure that the final determined edge target threshold is more accurate, and thus ensure that the obtained binary image data is more accurate, and ultimately effectively avoids the problem of edge disconnection, improves image quality, and improves user experience.

[0102] In a possible implementation, when the difference between the first preset grayscale value and the target grayscale value is less than a preset difference value, the second preset grayscale value is used as the target grayscale value, wherein the second preset grayscale value is greater than the first preset grayscale value.

[0103] For easier understanding, see Figure 9 , a schematic diagram of another edge histogram provided in an embodiment of the present application. As shown in the figure, L1 represents the target grayscale value, L2 represents the first preset grayscale value, L3 represents the difference between the first preset grayscale value and the target grayscale value, and L4 represents the second preset grayscale value. It can be understood that when the target grayscale value is close to the boundary between the shadow area and the middle area, the second preset grayscale value is used as the edge target threshold.

[0104] In an embodiment of the present application, when the difference between the first preset grayscale value and the target grayscale value is less than the preset difference value, it means that the image data is distributed more in the brighter part of the shadow area. At this time, the second preset grayscale value is used as the edge target threshold. The second preset grayscale value is greater than the first preset grayscale value. Using the second preset grayscale value as the edge target threshold is more conducive to obtaining edge binarization data that is closer to the edge image of the original image. The present application determines the edge target threshold in a personalized manner according to different situations, rather than using a fixed edge target threshold. This can ensure that the determined edge target threshold is more accurate, thereby ensuring that the obtained binarized image data is more accurate, and ultimately effectively avoiding the problem of edge disconnection, improving image quality, and improving user experience.

[0105] In one possible implementation, the second preset grayscale value can be set to be a first preset difference greater than the first preset grayscale value. The first preset difference can be preset by a technician in this field according to different needs. In one possible implementation, the first preset difference can be set to 16, that is, after determining the first preset grayscale value, 16 is added to the first preset grayscale value as the second preset grayscale value. In another possible implementation, the first preset difference can also be a value such as 15 or 17. This application does not impose any specific restrictions on the value of the first preset difference.

[0106] Step S503: Determine edge binarization image data according to the edge target threshold.

[0107] In the embodiment of the present application, after the edge target threshold is determined, edge binarization image data is determined according to the edge target threshold.

[0108] It can be understood that after determining the edge target threshold, the grayscale value of the edge image in the original image is compared with the edge target threshold. When the grayscale value of the edge image in the original image is greater than the determined edge target threshold, it is determined that the pixel point is a pixel point that does not need to be powdered. When the grayscale value of the edge image in the original image is less than the determined edge target threshold, it is determined that the pixel point is a pixel point that needs to be powdered, thereby determining the edge binarization data.

[0109] It can be understood that the edge binarized image data is the binarized image data corresponding to the edge image portion in the original image, and the binarized image data is used to instruct the image forming device to perform a binarized image forming operation on the original image.

[0110] In an embodiment of the present application, an edge histogram is first determined based on the edge image corresponding to the original image; then, an edge target threshold is determined based on the edge histogram; finally, edge binarized image data is determined based on the edge target threshold, so that the binarized image data of the edge image presented finally has a higher degree of restoration than the binarized image data obtained by conventional methods. It can be understood that adjusting the edge target threshold based on the data distribution of the edge histogram can ensure that the obtained binarized image data is more accurate to a certain extent, thereby effectively avoiding the problem of edge disconnection, improving image quality, and enhancing user experience. Corresponding to the above embodiment, the present application also provides an image forming operation method.

[0111] For ease of understanding, Figure 5 Based on this, the present application also provides a flow chart of an image forming method. Figure 10 , is a flow chart of an image forming method provided in an embodiment of the present application. After step S503, the method further includes:

[0112] Step S1001: determining original binary image data according to the original image and a preset threshold.

[0113] In an embodiment of the present application, original binarized image data is determined based on the original image and a preset threshold. The original binarized image data is the binarized image data determined by comparing the original image with the preset threshold. It is understood that the preset threshold is a grayscale value preset by a person skilled in the art. Exemplarily, the preset threshold is a grayscale value of 127. The original image is compared with the preset threshold, and the grayscale value of the original image is approximately simulated using the binarization of the pixels. After the original image with rich tones is binarized, the local average grayscale of the generated image is made similar to the local average grayscale of the original continuous-tone image using the characteristics of the human eye's visual system.

[0114] In one possible implementation, the original image and a preset threshold are input into an error diffusion algorithm model to output binary image data. It is understood that based on the error diffusion algorithm model, more accurate binary image data can be determined, thereby making the final image restoration more accurate.

[0115] In one possible implementation, a preset threshold is first modified based on the distribution of pixels in the original image; and original binary image data is determined based on the original image and the modified preset threshold. The modified preset threshold is positively correlated with the density of pixel distribution in the original image.

[0116] It can be understood that when the powdering area near the current pixel is densely distributed, the threshold is increased to prevent the current pixel from generating powdering data. Otherwise, the threshold is lowered to increase the powdering data.

[0117] In the embodiment of the present application, first, a preset threshold is modified based on the distribution of pixels in the original image; then, the original binary image data is determined based on the original image and the modified preset threshold. It can be understood that by modifying the preset threshold, the determined original binary image data can be made more accurate, thereby achieving a higher degree of image restoration in the final determination.

[0118] Step S1002: determining target binarized image data according to the edge binarized image data and the original binarized image data.

[0119] In the embodiment of the present application, target binarized image data is determined based on the edge binarized image data and the original binarized image data, wherein the target binarized image data includes the edge binarized image data.

[0120] Specifically, in a possible implementation, the edge binarized image data is used to replace the image data corresponding to the edge image in the original binarized image data to determine the target binarized image data.

[0121] Of course, those skilled in the art may also perform weighted operations on the edge binarized image data and the image data corresponding to the edge image in the original binarized image data according to actual needs, and then determine the target binarized image data. This application does not impose any specific restrictions on this.

[0122] In an embodiment of the present application, by replacing the image data corresponding to the edge image in the original binary image data with the edge binary image data, the target binary image data can be determined more simply and accurately, thereby effectively avoiding the problem of edge disconnection, improving image quality, and enhancing user experience.

[0123] Step S1003: Controlling the image forming apparatus to execute an image forming job according to the target binarized image data.

[0124] In the embodiment of the present application, after the target binarized image data is determined, the image forming apparatus is controlled to perform an image forming operation according to the target binarized image data.

[0125] In an embodiment of the present application, first, edge binarized image data is determined based on any one of the image edge enhancement methods described in the first aspect; then, original binarized image data is determined based on the original image and a preset threshold; then, target binarized image data is determined based on the edge binarized image data and the original binarized image data; and finally, an image forming device is controlled to perform an image forming operation based on the target binarized image data. It can be understood that the target binarized image data determined based on the edge binarized image data can more accurately represent the original image, thereby effectively avoiding the problem of edge disconnection, improving image quality, and enhancing user experience.

[0126] In one possible implementation, the embodiment shown in steps S501-S1002 can be executed by an image forming apparatus or by another terminal device that is communicatively connected to the image forming apparatus. Specifically, if steps S501-S1002 are executed by a terminal device, then before step S501, the process further includes: the terminal device receiving the original image sent by the image forming apparatus; after the terminal device completes steps S501-S1002, the terminal device transmits the obtained target binarized image data to the image forming apparatus; and the image forming apparatus then performs an image forming operation based on the received target binarized image data.

[0127] Corresponding to the above embodiment, the present application also provides an image edge enhancement device.

[0128] See also Figure 11 , which is a structural schematic diagram of an image edge enhancement device provided in an embodiment of the present application. As shown in the figure, an image edge enhancement device 1100 is shown. Among them, the image edge enhancement device 1100 specifically includes: an edge histogram determination module 1101, an edge target threshold determination module 1102, and an edge binarization image data determination module 1103. The edge histogram determination module is used to determine the edge histogram based on the edge image corresponding to the original image; the edge target threshold determination module is used to determine the edge target threshold based on the edge histogram; and the edge binarization image data determination module is used to determine the edge binarization image data based on the edge target threshold.

[0129] It should be noted that the specific contents involved in the embodiment of the image forming apparatus can be found in the description of the above method embodiment, and for the sake of brevity, they will not be elaborated on again.

[0130] Corresponding to the above embodiment, the present application also provides an image forming operation device.

[0131] See also Figure 12, which is a structural schematic diagram of an image forming operation device provided in an embodiment of the present application. As shown in the figure, an image forming operation device 1200 is shown. Among them, the image forming operation device 1200 specifically includes: an edge binarized image data determination module 1201, an original binarized image data determination module 1202, a target binarized image data determination module 1203 and a control module 1204. The edge binarized image data determination module is used to determine the edge binarized image data; the original binarized image data determination module is used to determine the original binarized image data based on the original image and a preset threshold; the target binarized image data determination module is used to determine the target binarized image data based on the edge binarized image data and the original binarized image data; the control module is used to control the image forming device to perform the image forming operation according to the target binarized image data.

[0132] It should be noted that the specific contents involved in the embodiment of the image forming apparatus can be found in the description of the above method embodiment, and for the sake of brevity, they will not be elaborated on again.

[0133] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program that, when executed, may include some or all of the steps of each embodiment of the simulation scenario generation method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0134] In a specific implementation, the present invention also provides a computer program product, wherein the computer program product includes executable instructions, and when the executable instructions are executed on a computer, the computer executes some or all of the steps in each embodiment of the simulation scene generation method provided by the present invention.

[0135] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0136] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented using a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0137] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0138] In the several embodiments provided in this application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of this application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0139] In this specification, reference can be made to the same or similar parts between the various embodiments. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.

Claims

1. A method for edge enhancement of an image, characterized in that: The method comprises: determining an edge histogram based on an edge image corresponding to an original image, wherein the original image is an image acquired by an image forming device through a scanning operation, and the edge histogram is used to represent a correspondence between grayscale values ​​and numbers of pixels in the edge image corresponding to the original image; Determining an edge target threshold according to the edge histogram; According to the edge target threshold, edge binarization image data is determined, wherein the edge binarization image data is the binarization image data corresponding to the edge image portion in the original image, and the binarization image data is used to instruct the image forming device to perform a binarization image forming operation on the original image.

2. The method according to claim 1, characterized in that Determining an edge target threshold according to the edge histogram includes: Determining a target grayscale value based on the edge histogram, where the target grayscale value is a grayscale value having the largest number of pixels less than or equal to a first preset grayscale value, wherein the first preset grayscale value is a grayscale value near a boundary between a shadow area and an intermediate area, and the second preset grayscale value is greater than the first preset grayscale value; Determining whether a difference between the first preset grayscale value and the target grayscale value is greater than or equal to a preset difference value; When the difference between the first preset grayscale value and the target grayscale value is greater than or equal to a preset difference value, the first preset grayscale value is used as the edge target threshold.

3. The method according to claim 2, characterized in that Also includes: When the difference between the first preset grayscale value and the target grayscale value is less than a preset difference value, the second preset grayscale value is used as the edge target threshold.

4. An image forming method, characterized in that: include: Determining edge binarized image data according to any one of the image edge enhancement methods of claims 1 to 3; Determine original binary image data according to the original image and a preset threshold, wherein the original binary image data is the binary image data corresponding to the original image; determining target binarized image data according to the edge binarized image data and the original binarized image data, wherein the target binarized image data includes the edge binarized image data; The image forming device is controlled to execute an image forming job based on the target binarized image data.

5. The method according to claim 4, characterized in that The determining of the original binary image data according to the original image and a preset threshold value includes: The original image and the preset threshold are input into an error diffusion algorithm model to output original binary image data.

6. The method according to claim 4, characterized in that The determining of the original binary image data according to the original image and a preset threshold value includes: According to the distribution of pixels of the original image, the preset threshold is modified to obtain a modified preset threshold, wherein the modified preset threshold is positively correlated with the distribution density of the pixels of the original image; Original binary image data is determined according to the original image and the corrected preset threshold.

7. The method according to claim 4, characterized in that The step of determining target binarized image data according to the edge binarized image data and the original binarized image data includes: The edge binarized image data is used to replace the image data corresponding to the edge image in the original binarized image data to determine target binarized image data.

8. An image edge enhancement device, characterized in that: include: an edge histogram determination module, configured to determine an edge histogram based on an edge image corresponding to an original image, wherein the original image is an image acquired by the image forming device through a scanning operation, and the edge histogram is configured to represent a correspondence between grayscale values ​​and the number of pixels in the edge image corresponding to the original image; An edge target threshold determination module, configured to determine an edge target threshold according to the edge histogram; The edge binarization image data determination module is used to determine the edge binarization image data according to the edge target threshold value, wherein the edge binarization image data is the binarization image data corresponding to the edge image portion in the original image, and the binarization image data is used to instruct the image forming device to perform a binarization image forming operation on the original image.

9. An image forming apparatus, characterized in that: include: an edge binarization image data determining module, configured to determine edge binarization image data in the apparatus according to claim 8; An original binary image data determination module is used to determine original binary image data according to the original image and a preset threshold, wherein the original binary image data is the binary image data corresponding to the original image; a target binarized image data determining module, configured to determine target binarized image data according to the edge binarized image data and the original binarized image data, wherein the target binarized image data includes the edge binarized image data; The control module is used to control the image forming device to perform an image forming operation according to the target binarized image data.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for measuring three-dimensional position and stance of object with single camera

    CN101839692A

  • Method and system for judging smudginess defect of display screen

    CN114519714A

  • Image adaptive binarization method based on edge information

    CN116363158A

  • Shape measuring device and program

    JP2010133751A

  • Method and apparatus for image binarization

    US9552528B1