Thermal printing image processing method, device, electronic equipment and storage medium

By segmenting and adaptive binary processing according to the image application target, the problem of insufficient image quality in traditional thermal printing algorithms is solved, and more efficient and high-quality image processing is achieved.

CN118628367BActive Publication Date: 2024-11-29SHENZHEN EFERCRO ELECTRONIC TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411042979.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-29
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

When processing pictures based on traditional thermal printing algorithms, there are image quality problems such as lots of noise, loss of edge details, and insufficient smoothness, resulting in low information reliability.

Method used

By determining the characteristics of the image application based on the image application target, segmenting the original image with appropriate image processing methods, generating multiple sub-pictures to be processed, and adaptive binary processing is performed for each sub-picture, and finally regrouping the target sub-picture And overall processing is performed to improve image quality.

Benefits of technology

It improves the efficiency and quality of image processing, ensures that the final image can meet diverse application needs, and improves the quality and information reliability of printed images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628367B_ABST
    Figure CN118628367B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for image processing of thermal printing, and relates to the field of image data processing technology. The method for image processing of thermal printing includes: determining the application characteristics of the image according to the application target of the image; determining the image processing method based on the application characteristics of the image, and segmenting the image to be processed according to the image processing method to determine multiple sub-images to be processed; performing respective corresponding image processing operations on multiple sub-images to be processed according to the image processing method to determine multiple target sub-images; reorganizing multiple target sub-images according to the image processing method, and performing overall image processing on the reorganized image to determine the target image. Based on the application characteristics of the image, the present application adopts a suitable image processing method to segment the original image, performs targeted operations on the segmented sub-images, and performs overall processing after reorganization, thereby improving the quality of the printed image and the reliability of the information in the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image data processing, for example, to a method, device, electronic device and storage medium for processing images for thermal printing. Background Art

[0002] Thermal printing technology is a printing technology based on the characteristics of thermal paper. Thermal paper contains a special heat-sensitive material that changes color when exposed to heat. Thermal printers use this principle to generate heat through a thermal head, causing the thermal coating on the thermal paper to darken or change color in the heated area, thereby forming a printed pattern. The maturity and stability of thermal printing technology provide reliable hardware support for image processing. Secondly, the development of image processing technology has made the printed images higher in quality and more expressive. Therefore, using thermal printing algorithms to process images can make the entire printing process more efficient and convenient.

[0003] In the related technology, when processing images based on traditional thermal printing algorithms, binarization or conversion to dot matrix is ​​generally used for image processing. However, this method will cause the printed images to have image quality problems such as more noise, loss of edge details, and insufficient smoothness, which will lead to low reliability of the information that needs to be conveyed in the image. Summary of the invention

[0004] The present application aims to provide a method, device, electronic device and storage medium for image processing for thermal printing.

[0005] According to one aspect of the present application, a method for processing images for thermal printing is proposed, comprising: determining image application characteristics according to an image application target; determining an image processing method based on the image application characteristics, and performing image segmentation on the image to be processed according to the image processing method to determine a plurality of sub-images to be processed; performing respective corresponding image processing operations on the plurality of sub-images to be processed according to the image processing method to determine a plurality of target sub-images; and recombining the plurality of target sub-images according to the image processing method, and performing overall image processing on the recombined image to determine a target image.

[0006] According to some embodiments, the image to be processed is segmented according to the image processing method to determine multiple sub-images to be processed, including: performing quasi-segmentation on the image to be processed according to the image target segmentation method to generate multiple quasi-sub-images to be processed; analyzing the sub-image contents of the multiple quasi-sub-images to be processed to determine fuzzy data; determining an update segmentation method based on the fuzzy data and the image target segmentation method; and performing image segmentation on the image to be processed according to the updated segmentation method to determine multiple sub-images to be processed.

[0007] According to some embodiments, according to the sub-image processing operation, corresponding image processing is performed on multiple sub-images to be processed to determine multiple target sub-images, including: for each of the multiple sub-images to be processed, analyzing the image content of the sub-image to be processed to determine the noise type and sub-image edge detail data; determining the corresponding adaptive binarization operation according to the noise type and the sub-image edge detail data; based on the adaptive binarization operation, performing image processing on each corresponding sub-image to be processed to determine multiple target sub-images.

[0008] According to one aspect of the present application, a thermal printing image processing device is provided, comprising:

[0009] An application feature determination module, used to determine the application features of the image according to the application target of the image;

[0010] The image segmentation module is used to determine the image processing method based on the image application characteristics, and to segment the image to be processed according to the image processing method to determine multiple sub-images to be processed;

[0011] An image processing module is used to perform corresponding image processing operations on a plurality of sub-images to be processed according to an image processing method, so as to determine a plurality of target sub-images;

[0012] The image reorganization module is used to reorganize multiple target sub-images according to the image processing method, and perform overall image processing on the reorganized image to determine the target image.

[0013] Optionally, when the image segmentation module performs image segmentation on the image to be processed according to the image processing method to determine multiple sub-images to be processed, it is specifically used to:

[0014] Perform pseudo-segmentation on the image to be processed according to the image target segmentation method to generate multiple pseudo-sub-images to be processed;

[0015] Analyze the sub-image contents of the plurality of pseudo-sub-images to be processed to determine the fuzzy data;

[0016] Based on the fuzzy data and the image target segmentation method, determine the updated segmentation method;

[0017] The image to be processed is segmented according to the update segmentation method to determine multiple sub-images to be processed.

[0018] Optionally, when the image segmentation module performs corresponding image processing on a plurality of sub-images to be processed according to the sub-image processing operation to determine a plurality of target sub-images, the image segmentation module is specifically used to:

[0019] For each of the plurality of sub-images to be processed, analyzing the image content of the sub-image to be processed to determine the noise type and sub-image edge detail data;

[0020] Determine the corresponding adaptive binarization operation according to the noise type and the sub-image edge detail data;

[0021] Based on the adaptive binarization operation, image processing is performed on each corresponding sub-image to be processed to determine multiple target sub-images.

[0022] According to one aspect of the present application, an electronic device is provided, which includes: a processor; and a memory storing a computer program, wherein when the computer program is executed by the processor, the processor executes the thermal printing image processing method as described above.

[0023] According to one aspect of the present application, a non-transitory computer-readable medium is provided, on which readable instructions are stored. When the instructions are executed by a processor, the processor executes the thermal printing image processing method as described above.

[0024] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application.

[0025] Through the above-mentioned embodiments provided by the present application, the application characteristics of the picture are accurately determined according to the specific application target of the picture. Based on the determined application characteristics of the picture, the original picture is segmented by a suitable picture processing method to generate multiple sub-pictures to be processed, which not only considers the logical relationship between the sub-pictures to be processed, but also pays attention to the visual effect after segmentation and the convenience of subsequent processing. Through refined segmentation, the key areas of the picture can be better highlighted, laying the foundation for subsequent reorganization and optimization. Targeted picture processing operations are performed on each sub-picture to be processed to further improve the quality of the sub-picture to be processed, so that it better meets the application requirements. By processing each sub-picture one by one, it can be ensured that the target image finally reorganized reaches the optimal state in all aspects. According to the established picture processing method, multiple target sub-pictures are reorganized to form a complete image. In the reorganization process, attention is paid to the transition and connection between the sub-pictures to ensure the natural and smooth overall visual effect. At the same time, the reorganized images are processed as a whole to further improve the overall quality and expressiveness of the images, which not only improves the efficiency of image processing, but also ensures that the final image can meet diverse application requirements, thereby improving the target image, that is, the quality of the image that can be used for printing, and thereby improving the reliability of the information that needs to be conveyed in the target image. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. 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 exceeding the scope of protection required by the present application.

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

[0028] Figure 2 A flowchart of a thermal printing image processing method provided in an embodiment of the present application;

[0029] Figure 3 A block diagram of a thermal printing image processing device provided in an embodiment of the present application;

[0030] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0032] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0033] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0034] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0035] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the concepts of the present application. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0036] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application. Figure 1 In the application scenario shown, the image processing method for thermal printing can be built on an image processing server. The user can send image application targets and / or printing requirements to the image processing server. The image processing server can treat the image to be printed as the image to be processed, segment the image to be processed, perform targeted image processing operations on the segmented sub-images to be processed, and then perform overall processing after reorganization to determine the target image and send it to the thermal printer for printing.

[0037] For specific implementation methods, please refer to the following embodiments.

[0038] Figure 2 This is a flow chart of a thermal printing image processing method provided in an embodiment of the present application. The method of this embodiment can be applied to the image processing server in the above scenario. Figure 2 As shown, the method includes: step S201, step S202, step S203 and step S204.

[0039] In step S201, the image application characteristics are determined according to the image application target.

[0040] In this application, the image application target can be used to indicate the specific usage scenario or purpose of the image after it is printed out, and can be pre-set according to the application scenario and sent by the user to the image processing server. Image application characteristics can be used to indicate the characteristics that the image should have according to the image application target, including but not limited to resolution, color mode, file format, image clarity, compression rate, security, etc.

[0041] The correspondence between different image application targets and image application characteristics can be preset, and can be determined specifically by using the characteristics of the printed images when searching for different image application targets on a public network platform.

[0042] According to an example embodiment, the picture application characteristics corresponding to the picture application target may be directly searched and determined.

[0043] In step S202, based on the application characteristics of the picture, a picture processing method is determined, and the picture to be processed is segmented according to the picture processing method to determine a plurality of sub-pictures to be processed.

[0044] In this application, the image processing method may refer to a series of technical means used to achieve specific image application characteristics, including but not limited to cropping, scaling, color adjustment, filter application, image segmentation, etc. Image processing methods corresponding to different image application characteristics may be pre-set, and the image processing method may include an image segmentation method.

[0045] According to the example embodiment, the image processing method corresponding to the image application characteristics can be directly obtained, and the corresponding segmentation method can be obtained from the image processing method to perform image segmentation on the image to be processed to obtain multiple sub-images to be processed.

[0046] In some implementations, the image application characteristics are analyzed to determine the size, resolution, color, clarity, content layout, key highlight position, etc. of the image to be processed after printing. Based on the aforementioned information, the image processing software's cutout tool can be used to separate the highlighted information from the background to obtain a cleaner and more professional display effect. The image to be processed is cropped to a suitable size and proportion according to the required size. Then, according to the content layout, key highlight position, and clarity, the corresponding image segmentation rules can be obtained to obtain multiple images to be processed.

[0047] In step S203, according to the image processing method, the corresponding image processing operations are performed on the multiple sub-images to be processed to determine the multiple target sub-images.

[0048] According to an example embodiment, the image processing method may include an image processing method for each sub-image to be processed, from which a plurality of sub-images to be processed are extracted and respective corresponding image processing operations are performed on the sub-images to determine a plurality of target sub-images.

[0049] In step S204, according to the image processing method, the plurality of target sub-images are reorganized, and the reorganized image is subjected to overall image processing to determine the target image.

[0050] The image processing method includes the image segmentation method, and correspondingly, the reorganization method can be determined to ensure that the reorganized image content is not messy. After targeted processing of the target sub-image, the reorganized image may have overall problems, which can be handled accordingly.

[0051] According to the example embodiment, multiple target sub-images are split and correspondingly reassembled in reverse according to an image processing method, and then the content of the reassembled image is analyzed to determine the existing problems, and then the overall image processing is performed, which may include brightness contrast, color balance, sharpening, smoothing and other operations to obtain the target image.

[0052] This application accurately determines the application characteristics of the picture according to the specific application target of the picture, and based on the determined application characteristics of the picture, uses a suitable picture processing method to segment the original picture and generate multiple sub-pictures to be processed, which not only considers the logical relationship between the sub-pictures to be processed, but also pays attention to the visual effect after segmentation and the convenience of subsequent processing. Through refined segmentation, the key areas of the picture can be better highlighted, laying the foundation for subsequent reorganization and optimization. Targeted picture processing operations are performed on each sub-picture to be processed to further improve the quality of the sub-picture to be processed, so that it is more in line with application requirements. By processing each sub-picture one by one, it can be ensured that the target image finally reorganized reaches the optimal state in all aspects. According to the established picture processing method, multiple target sub-pictures are reorganized to form a complete image. In the reorganization process, attention is paid to the transition and connection between the sub-pictures to ensure the natural and smooth overall visual effect. At the same time, the overall picture processing is performed on the reorganized picture to further improve the overall quality and expressiveness of the image, which not only improves the efficiency of picture processing, but also ensures that the final image can meet the diverse application requirements, thereby improving the target image, that is, the quality of the picture that can be used for printing, and thereby improving the reliability of the information to be conveyed in the target picture.

[0053] In some embodiments, step S201 can be specifically implemented through the following steps: analyzing the image application target to determine the image application scenario and image content; determining the image application requirements based on the image application scenario; analyzing the image content and image application requirements to determine the image application characteristics.

[0054] In this application, the image application scenario can be used to indicate the specific environment or background in which the printed image is used. The image content can be used to indicate the specific information displayed by the image to be processed. The image application requirements can be used to indicate specific requirements for the image based on the application scenario and application goals, such as size requirements, resolution requirements, color requirements, layout requirements, etc.

[0055] According to the example embodiment, the image application target is analyzed and the image application scenario is extracted therefrom. Through image analysis, the text, image and other information in the image, such as barcode, QR code, text description, digital description, etc., can be determined. The image application requirements under different image application scenarios can be pre-set, and the image application requirements corresponding to the current image application scenario can be directly searched. The image application feature determination model can be pre-set, and the image content and image application requirements are input into the image application feature determination model, and the image application features are determined by output.

[0056] By analyzing the image application target, this application can accurately determine the scenario in which the image will be used, thereby ensuring that the image content is highly consistent with the scenario. This accuracy not only helps to improve the efficiency of conveying image information, but also enhances the audience's sense of identity and acceptance. Based on different image application scenarios, specific image application requirements are determined, and the image content is further determined, making the image application characteristics obtained based on the image content and image application requirements more accurate and reliable.

[0057] In some embodiments, step S202, when determining the image processing method based on the image application characteristics, can be specifically implemented through the following steps: obtaining the key points of image data display in the image application scenario; analyzing the image content to determine the image data distribution information; obtaining the printing requirements of the image to be processed and analyzing them to determine the additional processing requirements for the image to be processed; determining the image processing method based on the key points of image data display, image data distribution information and the additional processing requirements.

[0058] In this application, the key points of image data display can be used to indicate key information in the image that needs to be cleaned and displayed, such as the image part of the medical bill needs to clearly display the location of the lesion, key measurements, etc. Image data distribution information can be used to indicate the spatial layout relationship between the data in the image (such as text descriptions, annotations, etc.) and the image content to ensure that the information does not overlap and is easy to identify. New processing requirements can be used to indicate additional processing of the image, such as scaling, cropping, rotating, or adding watermarks, based on factors such as printing equipment, paper specifications, or special requirements of the user.

[0059] According to the embodiment, a set of display key point evaluation models can be preset or dynamically generated for different scenarios. For example, in the e-commerce display scenario, the focus is on the clarity, color saturation and visibility of the product main picture. Then the evaluation model is applied to analyze the picture, and the image area or features that need to be displayed as the key points of the picture data display are marked. The picture is fully scanned using an image processing algorithm (such as histogram analysis, edge detection, texture analysis, etc.), and an information framework for the distribution of picture data is constructed in combination with the scanning results. The printing requirements of the picture to be processed are obtained and the newly added processing requirements are extracted therefrom. A personalized picture processing strategy is formulated based on the key points of picture data display, picture data distribution information and newly added processing requirements. For example, if the picture is a product display picture and needs to be printed as a poster, the clarity and color saturation of the product area may be improved first, and the overall brightness contrast may be adjusted to meet the visual requirements of the poster. In some implementations, the picture processing methods corresponding to the key points of picture data display, picture data distribution information and newly added processing requirements can be preset and stored.

[0060] By analyzing the display points in the image application scenario, this application can accurately identify which image elements are critical and need to be highlighted, and which can be simplified or ignored. This not only improves processing efficiency, but also ensures that the processing results can meet the needs of the application scenario to the greatest extent possible. Through in-depth analysis of the image content, the distribution information of the image data is determined. Based on this information, the image can be intelligently adjusted to enhance the visual effect of the image and make it more in line with aesthetic standards and application scenario requirements. Taking into account the printing requirements of the image to be processed, it can identify and process specific requirements related to printing, ensuring that the image can maintain high-quality output effects during the printing process and meet the printing needs in different scenarios.

[0061] In some embodiments, step S202, when determining the image processing method based on the image data display key points, image data distribution information and newly added processing requirements, can be specifically implemented through the following steps: analyzing the newly added processing requirements to determine the image segmentation requirements and image data display requirements; analyzing the image data distribution information to determine the basic image segmentation method under the image data display key points; determining the image target segmentation method based on the image segmentation requirements and the basic image segmentation method; determining the sub-image processing operation after segmentation according to the sub-image data distribution information and image data display requirements corresponding to the image target segmentation method; determining the image processing method based on the image target segmentation method and the sub-image processing operation.

[0062] In this application, the image segmentation requirements can be used to indicate specific instructions for dividing an image into multiple sub-areas (sub-images) according to the newly added processing requirements. The image data display requirements can be used to indicate specific requirements for the image display effect, such as clarity, color accuracy, etc. The basic image segmentation method can be used to indicate the preliminary segmentation method determined based on the image data distribution information. The image target segmentation method can be the final image segmentation strategy determined after combining the newly added processing requirements and the basic image segmentation method. The image target segmentation method may include sub-image data distribution information.

[0063] According to the example embodiment, the newly added processing requirements are parsed, and the image segmentation instructions involved therein are identified, such as segmentation by content theme, segmentation by color area, etc., and specific requirements for image data display. Image processing algorithms, such as edge detection, color clustering, etc., are used to analyze the data distribution inside the image, identify naturally formed region boundaries or regions with similar visual attributes, and obtain the basic image segmentation method. The segmentation requirements in the newly added processing requirements are combined with the basic image segmentation method for comprehensive evaluation. In some implementations, a model for determining the image target segmentation method can be preset, and the target segmentation method of the image can be determined by considering the practicality of the segmentation, processing efficiency, and final display effect. Based on the image data display requirements and the sub-image data distribution information, the sub-image processing operations of each sub-image are searched in the image target segmentation method.

[0064] The detailed analysis of the newly added processing requirements in this application makes the image segmentation and display requirements clear. This processing method based on specific needs ensures the accuracy of image processing. At the same time, the basic image segmentation method is determined based on the analysis of the image data distribution information, which further reflects the personalization of the processing and makes the results more in line with the specific needs of the application scenario. By combining the image segmentation requirements and the basic image segmentation method, the image target segmentation method is determined, which not only considers the accuracy of the segmentation, but also takes into account factors such as the quality, coherence and amount of information of the segmented image. The optimized image segmentation method can extract key information more effectively, reduce redundancy and interference, and improve the overall presentation effect of the image. According to the sub-image data distribution information and image data display requirements corresponding to the image target segmentation method, the processing operation of the sub-image after segmentation is determined, which can ensure that each sub-image can get the processing that best suits its characteristics, and can further improve the quality and visual effect of the image.

[0065] In some embodiments, step S202, when performing image segmentation on the image to be processed according to the image processing method to determine multiple sub-images to be processed, can be specifically implemented through the following steps: performing image quasi-segmentation on the image to be processed according to the image target segmentation method to generate multiple simulated sub-images to be processed; analyzing the sub-image contents of the multiple simulated sub-images to be processed to determine fuzzy data; determining an update segmentation method based on the fuzzy data and the image target segmentation method; performing image segmentation on the image to be processed according to the updated segmentation method to determine multiple sub-images to be processed.

[0066] In the present application, the pseudo-image to be processed may be a temporary sub-image set obtained after preliminary segmentation according to the image target segmentation method. Fuzzy data can be used to represent areas in the pseudo-image to be processed where the image information is unclear, the edges are blurred, or it is difficult to identify due to inaccurate segmentation boundaries, complex image content, or noise. The updated segmentation method can be used to represent the analysis results based on the fuzzy data, and make necessary adjustments and optimizations to the image target segmentation method to obtain more accurate and reasonable segmentation results.

[0067] According to an example embodiment, according to a predetermined image target segmentation method, a preliminary segmentation operation is performed on the image to be processed to obtain multiple pseudo-images to be processed. Each pseudo-image to be processed can be analyzed for content by image processing algorithms, such as edge detection, blur detection, etc., focusing on its edge clarity, internal information consistency, and whether there is fuzzy data. During the analysis process, the fuzzy data area in the pseudo-image is identified. These areas may be caused by inaccurate segmentation boundaries, complex image details, or image quality problems (such as noise, low resolution). Based on the analysis results of the fuzzy data, the image target segmentation method is evaluated and adjusted. The position of the segmentation boundary can be adjusted, the segmentation strategy can be changed, such as from color-based segmentation to texture-based segmentation, or new segmentation techniques can be introduced, such as image segmentation based on deep learning, to better handle the fuzzy data area, and then determine the updated segmentation method. Then, the image to be processed can be segmented according to the updated segmentation method to obtain multiple sub-images to be processed.

[0068] This application preliminarily performs image segmentation according to the image target segmentation method, and then conducts in-depth analysis of the sub-image content of the generated pseudo-sub-image to be processed to identify fuzzy data. This step significantly improves the accuracy of image segmentation and effectively avoids segmentation errors and distortion. After identifying fuzzy data, the segmentation method can be dynamically adjusted and optimized, that is, the updated segmentation method can be determined, so that the image segmentation can be flexibly adjusted according to the actual content of the image, thereby better adapting to complex and changeable image processing needs.

[0069] In some embodiments, step S203 can be specifically implemented by the following steps: according to the sub-image processing operation, corresponding image processing is performed on multiple sub-images to be processed to determine multiple target sub-images; wherein the sub-image processing operation includes noise processing and edge smoothing processing.

[0070] According to an example embodiment, multiple sub-images to be processed are traversed, and noise processing operations are performed on each sub-image. Specific methods of noise processing may include median filtering, Gaussian filtering, bilateral filtering, etc., and the noise processing method can be selected based on the type and degree of noise, as well as the desired processing effect. After completing the noise processing, blur processing after edge detection can be used, such as using Gaussian blur to process only the edge area, selective application of a smoothing filter, etc., to continue edge smoothing processing for each sub-image to obtain multiple target sub-images.

[0071] This application can effectively remove noise elements in the image, reduce noise or graininess in the image, and smooth the image edges to make the image clearer and more delicate by performing targeted image processing operations on each sub-image to be processed, such as noise processing and edge smoothing. These processing operations significantly improve the overall quality of the image and enhance the visual effect.

[0072] In some embodiments, step S203, when performing corresponding image processing on multiple sub-images to be processed according to the sub-image processing operation to determine multiple target sub-images, can be specifically implemented through the following steps: for each of the multiple sub-images to be processed, analyzing the image content of the sub-image to be processed to determine the noise type and the sub-image edge detail data; determining the corresponding adaptive binarization operation according to the noise type and the sub-image edge detail data; based on the adaptive binarization operation, performing image processing on each corresponding sub-image to be processed to determine multiple target sub-images.

[0073] In the present application, the noise type may represent various pixel changes that are not expected to appear in the image, which may appear as randomly distributed light and dark spots, stripes, etc., affecting the image quality. The sub-image edge detail data may describe the data of the edge features of the sub-image, including edge clarity, direction, intensity and other information. The adaptive binarization operation may be a processing method that dynamically adjusts the threshold according to the local features of the image, such as brightness, contrast, etc., so as to convert the image into a processing method containing only black and white colors. This method can better retain the important features of the image while removing unnecessary noise.

[0074] The noise type may include Gaussian noise or normally distributed noise, uniform noise or some periodic noise. The sub-image edge detail data may be determined by gradient calculation, frequency domain analysis, local contrast and the like.

[0075] According to an example embodiment, for each sub-image to be processed, its image content can first be analyzed to identify and classify the type of noise present. This can be achieved by comparing the differences between pixels, applying a noise detection algorithm, such as difference analysis after median filtering, etc. Then, the edge detail data of the sub-image can be extracted, and the edge features can be identified and quantified using an edge detection algorithm to obtain the edge detail data of the sub-image. According to the noise type and the edge detail data of the sub-image, the threshold operation of binarization is dynamically adjusted, that is, an adaptive binarization operation. For areas with more noise, a lower threshold may be used to reduce noise interference; while for areas with rich edge details, a higher threshold may be used to retain more details. A local threshold method can also be introduced, that is, different thresholds are set according to the characteristics of the local area of ​​the image (such as brightness, contrast) to achieve more refined binarization processing. Then, each sub-image to be processed is subjected to noise reduction and smoothing processing according to the adaptive binarization operation to obtain multiple target sub-images.

[0076] In some implementations, for Gaussian noise or noise types with normal distribution, when the noise intensity is low to medium, Gaussian filtering can be selected for noise reduction. For uniform noise or certain periodic noise types, when the noise intensity is low to medium, mean filtering can be selected for noise reduction. Among them, Gaussian filtering is better for smoothing images and removing high-frequency noise, but it may cause blurring of image details. Mean filtering is better for removing uniform noise, but it may cause loss of image details. If the image contains more details and edges, Gaussian filtering may be more preferred to retain more detail information. If the noise in the image is mainly concentrated in uniform areas, mean filtering may be more preferred to better remove noise. Therefore, the adaptive binarization operation can be determined by combining the noise type and the sub-image edge detail data.

[0077] In other implementations, for calculating the edge data of the sub-image, a gradient calculation method (such as Sobel, Prewitt, etc.) can be used to calculate the gradient value of the image. The gradient value indicates the degree of change of the pixel intensity in the image, and the gradient value of the edge area is usually higher. The amount of edge details can be determined by calculating the average value, variance, or a certain threshold of the gradient image. A higher average value or variance usually indicates more edge details. The image can also be converted to the frequency domain using a frequency domain analysis method (such as Fourier transform). The high-frequency components in the frequency domain usually correspond to the edge details of the image. The amount of edge details can be determined by calculating the energy, spectrum range, or a certain threshold of the frequency domain image. A higher energy or spectrum range usually indicates more edge details. The local contrast calculation method (such as variance, local standard deviation, etc.) can also be used to evaluate the local contrast of the image. The edge area usually has a higher local contrast. The amount of edge details can be determined by calculating the average value, variance, or a certain threshold of the local contrast of the image. A higher average value or variance usually indicates more edge details.

[0078] In other implementations, an adaptive threshold algorithm, such as ADAPTIVE_THRESH_MEAN_C or ADAPTIVE_THRESH_GAUSSIAN_C, may be used for the setting process of the adaptive binarization operation. Specify a threshold type, such as THRESH_BINARY or THRESH_BINARY_INV. Calculate the threshold for each pixel separately, that is, the threshold for each pixel is different. Specifically, the pixels in an area of ​​a preset size around the pixel are weighted averaged, minus a constant C, to obtain the threshold of the point. Among them, ADAPTIVE_THRESH_MEAN_C is the average value of the local neighborhood block. The algorithm first calculates the mean in the block and then subtracts the constant C. ADAPTIVE_THRESH_GAUSSIAN_C is the Gaussian weighted sum of the local neighborhood block. The algorithm calculates the formaldehyde of the pixels around the area of ​​the preset image value point according to the Gaussian function according to their distance from the center point, and then subtracts the constant C. The area of ​​preset size around the pixel point can be set based on the neighborhood block size, and the constant C can be a parameter related to the algorithm used, which is a parameter extracted from the mean or weighted average and can be a negative number.

[0079] This application can accurately identify the noise type and edge detail data in the image by performing content analysis on each sub-image to be processed, making subsequent image processing operations more targeted, thereby improving the accuracy of image processing. According to the noise type and edge detail data, the most suitable adaptive binarization operation for the current sub-image can be determined. This adaptive binarization method can remove the noise of the corresponding sub-image and retain important edge detail information. The sub-image processed by the adaptive binarization operation retains important edge detail information while removing noise, making the image clearer and more accurate, which not only improves the user experience, but also provides more reliable data support for subsequent applications.

[0080] The following describes an apparatus embodiment of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, reference can be made to the method embodiment of the present application.

[0081] Figure 3 This is a block diagram of a thermal printing image processing device provided in an embodiment of the present application. Figure 3 As shown, the thermal printing image processing device 300 includes an application characteristic determination module 301 , an image segmentation module 302 , an image processing module 303 and an image reorganization module 304 .

[0082] The application characteristic determination module 301 is used to determine the application characteristics of the picture according to the application target of the picture;

[0083] The picture segmentation module 302 is used to determine a picture processing method based on picture application characteristics, and to segment the picture to be processed according to the picture processing method to determine a plurality of sub-pictures to be processed;

[0084] The image processing module 303 is used to perform corresponding image processing operations on the multiple sub-images to be processed according to the image processing method to determine the multiple target sub-images;

[0085] The picture reorganization module 304 is used to reorganize the multiple target sub-pictures according to the picture processing method, and perform overall picture processing on the reorganized picture to determine the target image.

[0086] Optionally, the application characteristic determination module 301 is specifically used for:

[0087] Analyze the image application target to determine the image application scenario and image content;

[0088] Determine image application requirements based on image application scenarios;

[0089] Analyze image content and image application requirements to determine image application characteristics.

[0090] Optionally, when determining the image processing method based on the image application characteristics, the image segmentation module 302 is specifically used to:

[0091] Get the key points of image data display in the image application scenario;

[0092] Analyze the image content to determine image data distribution information;

[0093] Obtain and analyze the printing requirements of the images to be processed to determine the additional processing requirements of the images to be processed;

[0094] Determine the image processing method based on the image data display key points, image data distribution information and new processing requirements.

[0095] Optionally, when the picture segmentation module 302 determines the picture processing method according to the picture data display key points, picture data distribution information and the newly added processing requirements, it is specifically used to:

[0096] Analyze the new processing requirements and determine the image segmentation requirements and image data display requirements;

[0097] Analyze the image data distribution information and determine the basic image segmentation method based on the image data display key points;

[0098] Determine the image target segmentation method based on the image segmentation requirements and the image basic segmentation method;

[0099] Determine the processing operation of the sub-images after segmentation based on the sub-image data distribution information and image data display requirements corresponding to the image target segmentation method;

[0100] Determine the image processing method based on the image target segmentation method and sub-image processing operation.

[0101] Optionally, when the picture segmentation module 302 performs picture segmentation on the picture to be processed according to the picture processing method to determine a plurality of sub-pictures to be processed, it is specifically used to:

[0102] Perform pseudo-segmentation on the image to be processed according to the image target segmentation method to generate multiple pseudo-sub-images to be processed;

[0103] Analyze the sub-image contents of the plurality of pseudo-sub-images to be processed to determine the fuzzy data;

[0104] Based on the fuzzy data and the image target segmentation method, determine the updated segmentation method;

[0105] The image to be processed is segmented according to the update segmentation method to determine multiple sub-images to be processed.

[0106] Optionally, the image processing module 303 is specifically used for:

[0107] According to the sub-image processing operation, corresponding image processing is performed on the multiple sub-images to be processed to determine multiple target sub-images; wherein the sub-image processing operation includes noise processing and edge smoothing processing.

[0108] Optionally, when the picture segmentation module 302 performs corresponding picture processing on a plurality of sub-pictures to be processed according to the sub-picture processing operation to determine a plurality of target sub-pictures, it is specifically configured to:

[0109] For each of the plurality of sub-images to be processed, analyzing the image content of the sub-image to be processed to determine the noise type and sub-image edge detail data;

[0110] Determine the corresponding adaptive binarization operation according to the noise type and the sub-image edge detail data;

[0111] Based on the adaptive binarization operation, image processing is performed on each corresponding sub-image to be processed to determine multiple target sub-images.

[0112] The device performs functions similar to the method provided above. For other functions, please refer to the previous description and will not be repeated here.

[0113] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 4 As shown, the electronic device 400 of this embodiment may include: a memory 401 and a processor 402 .

[0114] The memory 401 stores a computer program. When the computer program is executed by the processor 402, the processor 402 executes the method in the above embodiment.

[0115] The processor 402 and the memory 401 are connected, for example, via a bus.

[0116] Optionally, the electronic device 400 may further include a transceiver. It should be noted that in actual applications, the number of transceivers is not limited to one, and the structure of the electronic device 400 does not constitute a limitation on the embodiments of the present application.

[0117] Processor 402 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 402 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0118] The bus may include a path to transmit information between the above components. The bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0119] The memory 401 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0120] The memory 401 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 402. The processor 402 is used to execute the application code stored in the memory 401 to implement the contents shown in the above method embodiment.

[0121] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc. It can also be a server, etc. Figure 4 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0122] The electronic device of this embodiment can be used to execute the method of any of the above embodiments, and its implementation principle and technical effect are similar, which will not be described in detail here.

[0123] The present application also provides a non-transitory computer-readable storage medium having computer-readable instructions stored thereon. When the aforementioned instructions are executed by a processor, the processor executes the method in the above embodiment.

[0124] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a non-transient computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0125] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of ​​the present application. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present application, the specific implementation methods and the scope of application of the present application, all belong to the scope of protection of the present application. In summary, the content of this specification should not be construed as a limitation on the present application.

Claims

1. A method for processing thermal printing images, characterized in that: include: Determine the characteristics of the image application based on the image application goals; Based on the application characteristics of the picture, determine the picture processing method, and segment the picture to be processed according to the picture processing method to determine multiple sub-pictures to be processed, including: Performing image pseudo-segmentation on the image to be processed according to the image target segmentation method to generate multiple pseudo-sub-images to be processed; Analyzing sub-image contents of the plurality of pseudo-sub-images to be processed to determine fuzzy data; Determine an updated segmentation method based on the fuzzy data and the image target segmentation method; Segment the image to be processed according to the updated segmentation method to determine a plurality of sub-images to be processed; According to the image processing method, performing corresponding image processing operations on the plurality of sub-images to be processed to determine a plurality of target sub-images; According to the image processing method, the multiple target sub-images are reorganized, and the reorganized image is subjected to overall image processing to determine the target image.

2. The method according to claim 1, characterized in that Determining the application characteristics of the image according to the image application target includes: Analyze the image application target to determine the image application scenario and image content; determine the image application requirements based on the image application scenario; The image content and the image application requirements are analyzed to determine the image application characteristics.

3. The method according to claim 2, characterized in that The determining of the image processing method based on the image application characteristics includes: Obtaining the key points of image data display in the image application scenario; analyzing the image content to determine image data distribution information; Obtaining and analyzing the printing requirements of the image to be processed to determine the additional processing requirements of the image to be processed; The image processing method is determined according to the image data display key points, the image data distribution information and the newly added processing requirements.

4. The method according to claim 3, characterized in that The determining the image processing method according to the image data display key points, the image data distribution information and the newly added processing requirements includes: Analyze the newly added processing requirements to determine image segmentation requirements and image data display requirements; Analyze the image data distribution information to determine the basic image segmentation method under the image data display key points; determine the image target segmentation method based on the image segmentation requirements and the basic image segmentation method; Determine the processing operation of the sub-image after segmentation according to the sub-image data distribution information corresponding to the image target segmentation method and the image data display requirements; The image processing method is determined according to the image target segmentation method and the sub-image processing operation.

5. The method according to claim 1, characterized in that The step of performing corresponding image processing operations on the plurality of sub-images to be processed according to the image processing method to determine a plurality of target sub-images includes: According to the sub-image processing operation, corresponding image processing is performed on the multiple sub-images to be processed to determine the multiple target sub-images; wherein the sub-image processing operation includes noise processing and edge smoothing processing.

6. The method according to claim 5, characterized in that The processing operation according to the sub-picture is performed on the plurality of The sub-pictures to be processed are subjected to corresponding picture processing to determine the plurality of target sub-pictures, including: For each of the plurality of sub-pictures to be processed, analyzing the picture content of the sub-picture to be processed to determine the noise type and sub-picture edge detail data; Determining a corresponding adaptive binarization operation according to the noise type and the sub-image edge detail data; Based on the adaptive binarization operation, image processing is performed on each corresponding sub-image to be processed to determine the multiple target sub-images.

7. A thermal printing image processing device, characterized in that: include: An application feature determination module, used to determine the application features of the image according to the application target of the image; A picture segmentation module, used to determine a picture processing method based on the picture application characteristics, and to segment the picture to be processed according to the picture processing method to determine a plurality of sub-pictures to be processed; An image processing module is used to perform corresponding image processing operations on the plurality of sub-images to be processed according to the image processing method, so as to determine a plurality of target sub-images; The image reorganization module is used to reorganize the multiple target sub-images according to the image processing method, and perform overall image processing on the reorganized image to determine the target image.

8. An electronic device, characterized in that: include: processor; A memory storing a computer program, which, when executed by the processor, enables the processor to execute the thermal printing image processing method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the instructions are executed by a processor, the processor executes the thermal printing image processing method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Picture processing method and picture processing device

    CN106997580A

  • Picture processing method and device, electronic equipment and medium

    CN115454365A