A printing method and system based on automatic scanning

Through automatic scanning and OCR technology processing, combined with image comparison and Hough transformation algorithm, the problem of inconsistent image quality in traditional scanning and printing equipment is solved, efficient and automated document processing is achieved, and the integrity and professionalism of the image is ensured.

CN118760407BActive Publication Date: 2024-12-03GUANGZHOU MEIHENGTONG ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411204431.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-03
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

Traditional scanning and printing equipment have challenges in improving efficiency and ensuring quality. Common problems include missing images, repeated scans, uncentered images, uneven text lines, black edges and blurred documents, resulting in the professionalism and readability of documents. Influence.

Method used

Using a printing system based on automatic scanning, the same file is scanned at least twice by scanning the storage module, and pre-processed using OCR technology. The scanning optimization module recognizes the missing scan area through an image comparison algorithm, and the center optimization module uses the Hough transformation algorithm to perform the Text line correction, the evaluation module generates correction angle and cut instructions to ensure consistency in image quality.

Benefits of technology

It significantly improves image quality, avoids missed scans and repeated scans, realizes automated image correction and centering, ensures the neat and beautiful image of printed images, reduces manual intervention, and improves operation efficiency and document processing reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760407B_ABST
    Figure CN118760407B_ABST
Patent Text Reader

Abstract

The present invention discloses a printing method and system based on automatic scanning, and relates to the field of scanning and printing technology. The system scans the same file at least twice through a scanning storage module to obtain multiple images, constructs a regional scan miss index Lsx after preprocessing through OCR technology, judges the eligibility of the scanned image, removes unqualified images and rescans, ensures that each part of the document is accurately scanned, and avoids content loss and waste of resources. In the scanning and printing process, the centering and correction of the document image is an important link. The present invention extracts the distance F from the center line to the edge of the text and the tilt angle JD of the text line through a centering optimization module, combines with a correction prediction model, analyzes and obtains the rotation index XZCz and the black edge area Hb and the first correction index Dy, realizes automatic correction and centering, and generates corresponding correction angle instructions and shearing instructions, eliminates the black edge and tilt problems, and ensures the professional appearance of the document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of scanning and printing technology, and in particular to a printing method and system based on automatic scanning. Background Art

[0002] In modern office and production environments, scanning and printing technology is a core component of document processing. Traditional scanning and printing equipment faces many challenges in improving efficiency and ensuring quality. With the development of information technology, automatic scanning printers came into being.

[0003] In the traditional scanning process, due to the limitations of the equipment or improper operation, part of the image is often missed or scanned repeatedly. Missed scanning will result in missing document content, while repeated scanning wastes time and resources. During the scanning and printing process, the centering and correction of the document image requires manual adjustment, which is prone to errors, resulting in problems such as tilted printed images and uneven text lines. This not only affects the aesthetics of the document, but may also have a negative impact on the understanding and use of the document content. Due to various problems in the scanning and printing process, the quality of images printed by traditional systems is often inconsistent. Some images may have black edges, tilts, blurs, etc., which seriously affect the professionalism and readability of the document. Summary of the invention

[0004] In view of the deficiencies of the prior art, the present invention provides a printing method and system based on automatic scanning to solve the problems mentioned in the background technology.

[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: a printing system based on automatic scanning, comprising:

[0006] A scanning storage module, used for scanning the same document to be printed and scanned at least twice, obtaining a first image and a second image, and preprocessing the first image and the second image by OCR technology, including denoising, enhancement and edge detection;

[0007] The scanning optimization module is used to identify the processed first image and the second image through an image comparison algorithm, extract the regional missed scan area features, and construct the regional missed scan index Lsx; if the regional missed scan index Lsx is lower than the preset defect threshold, the first image or the second image is judged to be qualified, and the images are aggregated into a third image set and sent to the second recognition optimization module; if the missed scan area index Lsx is higher than or equal to the preset defect threshold, the first image or the second image is eliminated;

[0008] The centering optimization module is used to collect and obtain the tilt-related data of the text line in the third image set through the Hough transform algorithm, and after feature extraction, respectively obtain the text centerline to edge distance F and the text line tilt angle JD of each image in the third image set, and analyze and obtain the rotation index XZCz and the black edge area Hb according to the trained correction prediction model; and associate the rotation index XZCz with the black edge area Hb to obtain the first correction index Dy;

[0009] An evaluation module pre-sets a first evaluation threshold Z and a second evaluation threshold R, performs comparative analysis on the first correction index Dy, comprehensively evaluates the relative influence of the black edge area generated after each image is rotated on the scanned document, and generates corresponding correction angle instructions and shearing instructions;

[0010] The printing module is used to send a printing command to start the printing operation after executing the corresponding correction angle instruction and cutting instruction.

[0011] Preferably, the scanning storage module includes a scanning unit and a pre-processing unit;

[0012] The scanning unit scans the same document to be scanned at least twice through an optical sensor and a scanning glass plate built into the scanner and an automatic paper feeder to obtain a first image and a second image;

[0013] The preprocessing unit is used to perform pre-image preprocessing on the first image and the second image, including:

[0014] S11, removing noise from the image, including median filtering, Gaussian filtering or wavelet denoising;

[0015] S12, enhancing the contrast and clarity of the image, using histogram equalization, adaptive histogram equalization or contrast stretching method to perform enhancement processing to improve OCR recognition performance;

[0016] S13, detecting edge features in the image;

[0017] S14. Use optical character recognition (OCR) technology to extract text from the preprocessed first image and the second image, convert the text into an editable text format, and store the text as a first standby text.

[0018] Preferably, the scanning optimization module includes an image registration unit and an image missed scanning information calculation unit;

[0019] The image registration unit is used to align different scanning results and compare the first image with the second image, and calculate the difference value of the i-th pixel in the registered differential image by the following formula: :

[0020] ;

[0021] In the formula, Indicates that the first image scan is The pixel value of Indicates that the second image is scanned at The pixel value of the image is obtained by calculating the difference threshold value. The difference threshold value T is set. >T, the pixel is counted into the total number of difference pixels N;

[0022] The image missed scan information calculation unit is used to calculate the difference value of the i-th pixel in the registered differential image. , the regional scan miss index Lsx is calculated by the following formula:

[0023] ;

[0024] ;

[0025] In the formula, It indicates the density of the difference value in the difference area, which is used to judge the concentration of the difference in the area. It is calculated by the ratio of the difference value to the area size. N indicates the total number of difference pixels. represents the difference value of the i-th pixel in the differential image after registration, Rs represents the area of ​​the difference region, is the sum of all difference values ​​in the difference region, represents the area of ​​the ith difference region, which is used to evaluate the severity of the missed scanning area; Through contour detection in image processing technology, the difference area is identified and its area is calculated; , and Represents the weight coefficient.

[0026] Preferably, the scanning optimization module further includes a first judgment unit and a first adjustment unit;

[0027] The first judgment unit is used to compare the regional scan miss index Lsx with the preset defect threshold to obtain the following judgment results, including:

[0028] If the area scan miss index Lsx is less than the preset defect threshold, the first image or the second image is judged to be qualified, a first qualified printing mark is generated, the mark is aggregated into a third image set, and sent to the second recognition optimization module;

[0029] If the missed scan area index Lsx is higher than or equal to the preset defect threshold, the first image or the second image is judged to be unqualified, including image partial blur, blank, and partial data loss problems, and a first abnormal printing mark is generated;

[0030] The first adjustment unit is used to generate a first rejection command according to the first abnormal printing mark, to reject the first image or the second image, and to generate a rescan command until a first qualified printing mark is generated.

[0031] Preferably, the centering optimization module includes a collection unit, a feature extraction unit and a model building unit;

[0032] The acquisition unit is used to acquire the tilt-related data of the text lines in the third image set in real time by using the Hough transform algorithm;

[0033] The feature extraction unit is used to extract the distance feature from the center line to the edge of the text and the tilt angle feature of the text line;

[0034] The model building unit is used to use image processing technology, including edge detection and geometric analysis, to obtain the text centerline to edge distance F and the text line inclination angle JD of each image; the convolutional neural network establishes a correction prediction model to analyze and obtain the rotation index XZCz and the black edge area Hb.

[0035] Preferably, the rotation index XZCz is obtained by extracting the distance F from the text centerline to the edge and the text line tilt angle JD of each image, and after dimensionless processing, the rotation index XZCz is calculated by the following formula:

[0036] ;

[0037] In the formula, Indicates the effect of 90 degree rotation on the rotation index XZCz. The value range is 0-1. When , the influence parameter is 1, indicating no rotation influence; when When it increases, the impact parameter is 1, and when it increases, the impact parameter will increase accordingly. , and represents the weight coefficient, Indicates the constant correction factor.

[0038] Preferably, the black border area Hb is calculated by the following formula:

[0039] ;

[0040] ;

[0041] ;

[0042] In the formula, Indicates the width of the image after simulated rotation. represents the height of the image after simulated rotation; W represents the width of the original image in the third image set, H represents the height of the original image in the third image set; JD represents the tilt angle of the text line in the original image, is the cosine value of the tilt angle JD, which represents the horizontal component corresponding to the rotation angle. is the sine value of the tilt angle JD, indicating the vertical component corresponding to the tilt angle JD, Make sure the calculated black border area is not negative, taking into account the actual excess after rotation.

[0043] Preferably, the centering optimization module further includes a correlation module, which is used to obtain a first correction index Dy by calculating the rotation index XZCz and the black edge area Hb through the following correlation:

[0044] ;

[0045] In the formula, and They represent the weight coefficients of the rotation index XZCz and the black border area Hb respectively.

[0046] Preferably, the evaluation module includes a first evaluation unit and a second strategy unit;

[0047] The first evaluation unit is used to preset a first evaluation threshold Z and a second evaluation threshold R, wherein the first evaluation threshold Z>the second evaluation threshold R;

[0048] The first correction index Dy is compared and evaluated with the first evaluation threshold Z and the second evaluation threshold R respectively to generate the following evaluation results, including:

[0049] The first correction index Dy is less than the second evaluation threshold R, indicating that after adjustment according to the tilt angle JD, the relative impact strength is normal. At this time, the adjusted image meets the printing requirements and no further adjustment is required. The second strategy unit generates a first angle adjustment instruction to correct the image for the value of the original tilt angle JD;

[0050] The second evaluation threshold R≤the first correction index Dy≤the first evaluation threshold Z, indicating that after adjustment according to the tilt scheduling JD, the relative impact strength is abnormal; at this time, further adjustment is required, and the second policy unit generates a second angle adjustment instruction to correct the image at a value of JD*70% of the original tilt angle; and generates a first shearing instruction according to the black edge area Hb generated after the adjustment; at this time, after adjustment according to the value of the original tilt angle JD, shearing beyond the black edge range will cause content loss in the scanned image document, therefore, the image is corrected at a value of JD*70% of the original tilt angle;

[0051] The first correction index Dy>the first evaluation threshold Z, indicating that the relative impact intensity is abnormal after adjustment according to the tilt scheduling JD. At this time, further adjustment is required, and the second strategy unit generates a third angle adjustment instruction to correct the image with the value of the original tilt angle JD*30%. A second shearing instruction is generated according to the black border area Hb generated after the adjustment.

[0052] A printing method based on automatic scanning comprises the following steps:

[0053] Step 1: Scan the storage module for processing; use the scanning unit to scan the same document at least twice through the built-in optical sensor and scanning glass plate of the scanner and the automatic paper feeder to obtain the first image and the second image, and pre-process the first image and the second image through the OCR technology, including denoising, enhancement and edge detection;

[0054] Step 2, processing of the scanning optimization module: the pre-processed first image and the second image are identified by the image comparison algorithm, and the regional missed scan area features are extracted to construct the regional missed scan index Lsx, and then it is determined whether the regional missed scan index Lsx is lower than the preset defect threshold. If it is lower, it is qualified and summarized into the third image set; otherwise, it is eliminated and re-scanned;

[0055] Step 3: Obtain the tilt-related data of the text lines in the third image set through the Hough transform algorithm, extract feature data, obtain the distance F from the text centerline to the edge and the tilt angle JD of the text line in each image; according to the trained correction prediction model, analyze and obtain the rotation index XZCz and the black edge area Hb, and obtain the first correction index Dy by correlation calculation;

[0056] Step 4: Processing of the evaluation module: presetting a first evaluation threshold Z and a second evaluation threshold R, performing comparative analysis on the first correction index Dy, and generating corresponding correction angle instructions and shearing instructions;

[0057] Step 5: Processing of the printing module: After executing the corresponding angle correction instructions and cutting instructions, a printing command is sent to start the printing operation.

[0058] The present invention provides a printing method and system based on automatic scanning, which has the following beneficial effects:

[0059] (1) A printing system based on automatic scanning, the system scans the same document at least twice through a scanning storage module to obtain multiple images, and performs preprocessing through OCR technology, including denoising, enhancement and edge detection. This multiple scanning and preprocessing technology can significantly improve the quality of the image, remove noise, enhance contrast and clarity, thereby improving the accuracy of OCR recognition and ensuring the integrity and accuracy of the document content. The common phenomenon of missed scanning and repeated scanning in the traditional scanning process is effectively solved in the present invention. Through the scanning optimization module, the image comparison algorithm is used to identify the processed first image and the second image, extract the regional missed scanning area features, construct the regional missed scanning index Lsx, judge the eligibility of the scanned image, remove the unqualified image and rescan, ensure that every part of the document is accurately scanned, and avoid content loss and resource waste. In the scanning and printing process, the centering and correction of the document image is an important link. The traditional method requires manual adjustment, which is prone to errors, resulting in tilted printed images and uneven text lines. The present invention uses a centering optimization module and a Hough transform algorithm to collect the tilt-related data of the text line, extract the distance F from the center line to the edge of the text and the tilt angle JD of the text line, and analyzes and obtains the rotation index XZCz and the black edge area Hb in combination with the correction prediction model, so as to achieve automatic correction and centering, and ensure the neatness and beauty of the printed image. In traditional scanning and printing systems, inconsistent image quality is a common problem. Some images may have black edges, tilts, blurs, etc., which affect the professionalism and readability of the document. The evaluation module of the present invention pre-sets a first evaluation threshold Z and a second evaluation threshold R, compares and analyzes the first correction index Dy, and generates corresponding correction angle instructions and shearing instructions to ensure the high quality and consistency of the printed image, eliminate the black edge and tilt problems, and ensure the professional appearance of the document.

[0060] (2) This is a printing method based on automatic scanning. All steps from scanning to printing are automated, which greatly reduces the need for manual intervention and improves operational efficiency. Through intelligent missed scan detection and area optimization, it avoids the waste of resources caused by multiple scans and manual adjustments, saving time and costs. The automated evaluation and adjustment process ensures the consistency and reliability of each printing result, reducing quality problems caused by human operational errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 This is a schematic diagram of a flow chart of a printing system based on automatic scanning according to the present invention;

[0062] Figure 2 The present invention is a schematic diagram of the steps of a printing method based on automatic scanning. DETAILED DESCRIPTION

[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] Example 1, please refer to Figure 1 The present invention provides a printing system based on automatic scanning, comprising:

[0065] A scanning storage module, used for scanning the same document to be printed and scanned at least twice, obtaining a first image and a second image, and preprocessing the first image and the second image by OCR technology, including denoising, enhancement and edge detection;

[0066] The scanning optimization module is used to identify the processed first image and the second image through an image comparison algorithm, extract the regional missed scan area features, and construct the regional missed scan index Lsx; if the regional missed scan index Lsx is lower than the preset defect threshold, the first image or the second image is judged to be qualified, and the images are aggregated into a third image set and sent to the second recognition optimization module; if the missed scan area index Lsx is higher than or equal to the preset defect threshold, the first image or the second image is eliminated;

[0067] The centering optimization module is used to collect and obtain the tilt-related data of the text line in the third image set through the Hough transform algorithm, and after feature extraction, respectively obtain the text centerline to edge distance F and the text line tilt angle JD of each image in the third image set, and analyze and obtain the rotation index XZCz and the black edge area Hb according to the trained correction prediction model; and associate the rotation index XZCz with the black edge area Hb to obtain the first correction index Dy;

[0068] An evaluation module pre-sets a first evaluation threshold Z and a second evaluation threshold R, performs comparative analysis on the first correction index Dy, comprehensively evaluates the relative influence of the black edge area generated after each image is rotated on the scanned document, and generates corresponding correction angle instructions and shearing instructions;

[0069] The printing module is used to send a printing command to start the printing operation after executing the corresponding correction angle instruction and cutting instruction.

[0070] In this embodiment, the system scans the same file at least twice through the scanning storage module to obtain multiple images, and performs preprocessing through OCR technology, including denoising, enhancement and edge detection. This multiple scanning and preprocessing technology can significantly improve the quality of the image, remove noise, enhance contrast and clarity, thereby improving the accuracy of OCR recognition and ensuring the integrity and accuracy of the document content. The common phenomenon of missed scanning and repeated scanning in the traditional scanning process has been effectively solved in the present invention. Through the scanning optimization module, the image comparison algorithm is used to identify the processed first image and the second image, extract the regional missed scanning area features, construct the regional missed scanning index Lsx, judge the eligibility of the scanned image, remove unqualified images and rescan, ensure that every part of the document is accurately scanned, and avoid content loss and resource waste. In the scanning and printing process, the centering and correction of the document image is an important link. The traditional method requires manual adjustment, which is prone to errors, resulting in tilted printed images and uneven text lines. The present invention uses a centering optimization module and a Hough transform algorithm to collect the tilt-related data of the text line, extract the distance F from the center line to the edge of the text and the tilt angle JD of the text line, and analyzes and obtains the rotation index XZCz and the black edge area Hb in combination with the correction prediction model, so as to achieve automatic correction and centering, and ensure the neatness and beauty of the printed image. In traditional scanning and printing systems, inconsistent image quality is a common problem. Some images may have black edges, tilts, blurs, etc., which affect the professionalism and readability of the document. The evaluation module of the present invention pre-sets a first evaluation threshold Z and a second evaluation threshold R, compares and analyzes the first correction index Dy, and generates corresponding correction angle instructions and shearing instructions to ensure the high quality and consistency of the printed image, eliminate the black edge and tilt problems, and ensure the professional appearance of the document.

[0071] This system realizes the automation of the whole process from scanning, preprocessing, optimization, correction, evaluation to printing. This not only greatly reduces the steps of manual operation and the possibility of human error, but also significantly improves work efficiency, making document processing faster and more accurate, and adapting to the needs of efficient document processing in modern office and production environments.

[0072] Example 2, please refer to Figure 1 ,Specifically, the scanning and storage module includes a scanning unit and a pre-processing unit;

[0073] The scanning unit scans the same document to be scanned at least twice through an optical sensor and a scanning glass plate built into the scanner and an automatic paper feeder to obtain a first image and a second image;

[0074] The preprocessing unit is used to perform pre-image preprocessing on the first image and the second image, including:

[0075] S11, removing noise from the image, including median filtering, Gaussian filtering or wavelet denoising;

[0076] S12, enhancing the contrast and clarity of the image, using histogram equalization, adaptive histogram equalization or contrast stretching method to perform enhancement processing to improve OCR recognition performance;

[0077] S13, detecting edge features in the image;

[0078] S14. Use optical character recognition (OCR) technology to extract text from the preprocessed first image and the second image, convert the text into an editable text format, and store the text as a first standby text.

[0079] In this embodiment, the same document is scanned at least twice by means of the built-in optical sensor and scanning glass plate of the scanning unit, as well as the automatic paper feeder, to obtain a first image and a second image. Multiple scans can capture more image details, reduce scanning errors caused by equipment jitter or uneven paper, and ensure the accuracy and integrity of the scanned image. Through automated scanning and preprocessing processes, high-quality image scanning and processing can be completed without human intervention, significantly improving work efficiency. The use of an automatic paper feeder makes batch document scanning faster and more convenient, meeting the needs of modern office environments for efficient document processing. Multiple scans and efficient image preprocessing technology ensure the quality consistency of scanned images and the reliability of processing results. Through automated and intelligent technical means, errors and unstable factors caused by human operation are reduced, ensuring that each scanned document can obtain high-quality processing results.

[0080] Example 3, please refer to Figure 1 ,Specifically, the scanning optimization module includes an image registration unit and an ,image missing scan information calculation unit;

[0081] The image registration unit is used to align different scanning results and compare the first image with the second image, and calculate the difference value of the i-th pixel in the registered differential image by the following formula: ;

[0082] ;

[0083] In the formula, Indicates that the first image scan is The pixel value of Indicates that the second image is scanned at The pixel value of the image is obtained by calculating the difference threshold value. The difference threshold value T is set. >T, the pixel is counted into the total number of difference pixels N;

[0084] The image missed scan information calculation unit is used to calculate the difference value of the i-th pixel in the registered differential image. , the regional scan miss index Lsx is calculated by the following formula:

[0085] ;

[0086] ;

[0087] In the formula, It indicates the density of the difference value in the difference area, which is used to judge the concentration of the difference in the area. It is calculated by the ratio of the difference value to the area size. N indicates the total number of difference pixels. represents the difference value of the i-th pixel in the registered differential image, Rs represents the area of ​​the difference region, is the sum of all difference values ​​in the difference region, represents the area of ​​the ith difference region, which is used to evaluate the severity of the missed scanning area; Through contour detection in image processing technology, the difference area is identified and its area is calculated; , and Represents the weight coefficient.

[0088] In this embodiment, the image missed scan information calculation unit quantifies the missed scan degree in the image by calculating the regional missed scan index Lsx. The calculation of Lsx comprehensively considers multiple factors such as the density of differential values ​​in the difference area, the total number of difference pixels, and the area of ​​the difference area, so that the evaluation of the missed scan degree is more comprehensive and accurate, and can better reflect the quality problems of the scanned image. The calculation process of the regional missed scan index Lsx is automated, without the need for manual intervention, and can quickly and accurately detect the missed scan area in the scanned image. For the detected missed scan area, the system can automatically rescan or perform other processing, which improves work efficiency and reduces errors caused by human operation. This method can adapt to different types of scanning devices and a variety of scanning environments, and can provide stable and reliable missed scan detection effects regardless of single-page scanning or multi-page batch scanning. For image deviations generated by different scanning devices, the image registration unit can perform effective alignment to ensure the accuracy of missed scan detection.

[0089] Example 4, please refer to Figure 1 ,Specifically, the scanning optimization module also includes a first judgment unit and a first adjustment unit;

[0090] The first judgment unit is used to compare the regional scan miss index Lsx with the preset defect threshold to obtain the following judgment results, including:

[0091] If the area scan miss index Lsx is less than the preset defect threshold, the first image or the second image is judged to be qualified, a first qualified printing mark is generated, the mark is aggregated into a third image set, and sent to the second recognition optimization module;

[0092] If the missed scan area index Lsx is higher than or equal to the preset defect threshold, the first image or the second image is judged to be unqualified, including image partial blur, blank, and partial data loss problems, and a first abnormal printing mark is generated;

[0093] The first adjustment unit is used to generate a first rejection command according to the first abnormal printing mark, to reject the first image or the second image, and to generate a rescan command until a first qualified printing mark is generated.

[0094] In this embodiment, the first judgment unit realizes automatic detection and control of the scanned image quality by comparing the regional scan leakage index Lsx with the preset defect threshold. It can quickly identify and mark qualified and unqualified images, reduce the need for manual intervention, and improve the automation level and processing efficiency of the system. The judgment standard is clear, and the regional scan leakage index Lsx is compared with the defect threshold, which can accurately identify quality problems in the image, such as scan leakage, blur and data loss. This precise judgment method can effectively eliminate problems in image processing and ensure that the quality of the final generated image meets expectations. For unqualified images, the first adjustment unit automatically generates a rejection command and a rescan command to avoid the tediousness and errors of manual operation. This automated adjustment and processing mechanism can significantly improve the efficiency of scanning processing, speed up document processing, and reduce human errors and intervention time. Through the automatic rejection and rescanning mechanism of the first adjustment unit, it is ensured that the images finally summarized in the third image set are qualified images that have undergone quality control. This mechanism ensures the consistency and reliability of the quality of the final output document and meets high-standard printing requirements. Through automatic judgment and adjustment, further processing or printing of unqualified images is avoided, reducing the waste of resources. Especially in batch scanning and printing, it can significantly reduce the waste rate and save paper, ink and time costs.

[0095] Example 5, please refer to Figure 1 ,Specifically, the centering optimization module includes an acquisition unit, a feature extraction unit and a model building unit;

[0096] The acquisition unit is used to acquire the tilt-related data of the text lines in the third image set in real time by using the Hough transform algorithm;

[0097] The feature extraction unit is used to extract the distance feature from the center line to the edge of the text and the tilt angle feature of the text line;

[0098] The model building unit is used to use image processing technology, including edge detection and geometric analysis, to obtain the text centerline to edge distance F and the text line inclination angle JD of each image; the convolutional neural network establishes a correction prediction model to analyze and obtain the rotation index XZCz and the black edge area Hb.

[0099] In this embodiment, the feature extraction unit extracts the features of the distance F from the text centerline to the edge and the text line tilt angle JD from the text image. These detailed features provide key data for model building, making the correction process more accurate and effective, and can accurately correct the tilt problem in the document. The correction prediction model is established by the convolutional neural network CNN, which can efficiently analyze and predict the rotation index XZCz and the black edge area Hb. The CNN model has powerful feature extraction and pattern recognition capabilities, and can extract valuable information from complex image data, thereby improving the accuracy and efficiency of correction.

[0100] Example 6, please refer to Figure 1 Specifically, the rotation index XZCz is obtained by extracting the distance F from the text centerline to the edge and the text line inclination angle JD of each image, and after dimensionless processing, the rotation index XZCz is calculated by the following formula:

[0101] ;

[0102] In the formula, Indicates the effect of 90 degree rotation on the rotation index XZCz. The value range is 0-1. When , the influence parameter is 1, indicating no rotation influence; when When it increases, the impact parameter is 1, and when it increases, the impact parameter will increase accordingly. , and represents the weight coefficient, Indicates the constant correction factor.

[0103] When an image is rotated, some parts of the original image may extend beyond the rotated image boundary, resulting in blank areas within the rotated image area, which appear black. Some printers or scanners may simply fill in the uncovered areas when processing the boundaries, and the unfilled areas appear blank or black. In scanning devices, optical sensors may have an impact during the rotation or scanning process, especially at the boundaries, which may cause areas not to be scanned or processed properly. Specifically, the black border area Hb is calculated using the following formula:

[0104] ;

[0105] ;

[0106] ;

[0107] In the formula, Indicates the width of the image after simulated rotation. represents the height of the image after simulated rotation; W represents the width of the original image in the third image set, H represents the height of the original image in the third image set; JD represents the tilt angle of the text line in the original image, is the cosine value of the tilt angle JD, which represents the horizontal component corresponding to the rotation angle. is the sine value of the tilt angle JD, indicating the vertical component corresponding to the tilt angle JD, Make sure the calculated black border area is not negative, taking into account the actual excess after rotation.

[0108] Specifically, the centering optimization module further includes a correlation module, which is used to obtain the first correction index Dy by calculating the rotation index XZCz and the black edge area Hb through the following correlation:

[0109] ;

[0110] In the formula, and They represent the weight coefficients of the rotation index XZCz and the black border area Hb respectively.

[0111] In this embodiment, the rotation index XZCz can accurately quantify the impact of image rotation on text alignment and printing quality, helping to identify and correct image quality problems caused by rotation. The black border area Hb accurately calculates the blank area that appears in the rotated image, helping to evaluate the impact of rotation on the image. The first correction index Dy comprehensively considers the rotation impact and the black border area, providing a comprehensive evaluation standard for image correction. Through the first correction index Dy, targeted correction instructions can be generated to optimize the printing and scanning quality of the image and reduce human errors. Reduce quality fluctuations caused by improper rotation and boundary processing, and improve the overall consistency and professionalism of the image.

[0112] Example 7, please refer to Figure 1 ,Specifically, the evaluation module includes a first evaluation unit and a second ,strategy unit;

[0113] The first evaluation unit is used to preset a first evaluation threshold Z and a second evaluation threshold R, wherein the first evaluation threshold Z>the second evaluation threshold R;

[0114] The first correction index Dy is compared and evaluated with the first evaluation threshold Z and the second evaluation threshold R respectively to generate the following evaluation results, including:

[0115] The first correction index Dy is less than the second evaluation threshold R, indicating that after adjustment according to the tilt angle JD, the relative impact strength is normal. At this time, the adjusted image meets the printing requirements and no further adjustment is required. The second strategy unit generates a first angle adjustment instruction to correct the image for the value of the original tilt angle JD;

[0116] The second evaluation threshold R≤the first correction index Dy≤the first evaluation threshold Z, indicating that the relative impact intensity is abnormal after adjustment according to the tilt scheduling JD. At this time, further adjustment is required, and the second strategy unit generates a second angle adjustment instruction to correct the image with the value of the original tilt angle JD*70%. A first cropping instruction is generated according to the black border area Hb generated after the adjustment to ensure that the image correction effect meets the medium requirements.

[0117] The first correction index Dy> the first evaluation threshold Z, indicating that the relative impact intensity is abnormal after adjustment according to the tilt scheduling JD; at this time, further adjustment is required, and the second strategy unit generates a third angle adjustment instruction to correct the image with the value of the original tilt angle JD*30%; and generates a second shearing instruction according to the black edge area Hb generated after adjustment. The first shearing instruction usually involves shearing in a smaller range and is suitable for adjustments with smaller impact intensity. The second shearing instruction involves shearing in a larger range and is suitable for adjustments with larger impact intensity. Solve more serious image quality problems to prevent affecting the final printing effect.

[0118] In this embodiment, the evaluation module provides a flexible adjustment strategy based on different impact intensities, which can deal with image quality problems of various degrees. Through hierarchical adjustment and cutting strategies, the adjustment efficiency is improved and unnecessary resource waste is reduced. The automated evaluation and adjustment process reduces the reliance on manual intervention and improves the automation and reliability of the system.

[0119] Example 8, please refer to Figure 2 , a printing method based on automatic scanning, comprising the following steps,

[0120] Step 1: Scan the storage module for processing; use the scanning unit to scan the same document at least twice through the built-in optical sensor and scanning glass plate of the scanner and the automatic paper feeder to obtain the first image and the second image, and pre-process the first image and the second image through the OCR technology, including denoising, enhancement and edge detection;

[0121] Step 2, processing of the scanning optimization module: the pre-processed first image and the second image are identified by the image comparison algorithm, and the regional missed scan area features are extracted to construct the regional missed scan index Lsx, and then it is determined whether the regional missed scan index Lsx is lower than the preset defect threshold. If it is lower, it is qualified and summarized into the third image set; otherwise, it is eliminated and re-scanned;

[0122] Step 3: Obtain the tilt-related data of the text lines in the third image set through the Hough transform algorithm, extract feature data, obtain the distance F from the text centerline to the edge and the tilt angle JD of the text line in each image; according to the trained correction prediction model, analyze and obtain the rotation index XZCz and the black edge area Hb, and obtain the first correction index Dy by correlation calculation;

[0123] Step 4: Processing of the evaluation module: presetting a first evaluation threshold Z and a second evaluation threshold R, performing comparative analysis on the first correction index Dy, and generating corresponding correction angle instructions and shearing instructions;

[0124] Step 5: Processing of the printing module: After executing the corresponding angle correction instructions and cutting instructions, a printing command is sent to start the printing operation.

[0125] The method comprises steps 1 to 5. The scanning storage module in step 1 is pre-processed by at least two scans and OCR technology, which effectively reduces the probability of image leakage and ensures that the acquired image data is more complete and accurate. The scanning optimization module in step 2 automatically identifies and processes the leakage area through the image comparison algorithm, reduces manual intervention, and improves the integrity and quality of the image. The centering optimization module in step 3 extracts the tilt data of the text line by using the Hough transform algorithm, and calculates the rotation index and the black edge area through the trained correction prediction model to achieve high-precision text line correction. By calculating the rotation index XZCz and the black edge area Hb, the boundary problem after the image rotation can be effectively identified and processed to ensure that the final image has no unnecessary black edges or blank areas. The evaluation module in step 4 automatically generates corresponding angle adjustment and shearing instructions based on the comparison results of the first correction index Dy with the first evaluation threshold Z and the second evaluation threshold R. Appropriate adjustments are made according to actual needs to avoid unnecessary over-correction and improve adjustment efficiency. By generating appropriate angle adjustment and shearing instructions, it is ensured that the quality of the final printed output image meets the expected standards and avoids quality problems caused by image tilt or boundary problems during printing. The entire method uses automation in all steps from scanning to printing, which greatly reduces the need for manual intervention and improves operational efficiency. Through intelligent missed scan detection and area optimization, it avoids the waste of resources caused by multiple scans and manual adjustments, saving time and costs. The automated evaluation and adjustment process ensures the consistency and reliability of each print result, reducing quality problems caused by human operating errors.

[0126] The threshold is set to facilitate comparison. The size of the threshold depends on the amount of sample data and the number of bases set by technicians in this field for each group of sample data; as long as it does not affect the proportional relationship between the parameter and the quantized value.

[0127] The above formulas are obtained by collecting a large amount of data for software simulation and selecting a formula that is close to the actual value. The coefficients in the formula are set by technical personnel in this field according to actual conditions. The above are only preferred specific implementations of the present invention, but the protection scope of the present invention is not limited to this. Any technical personnel familiar with the technical field within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, make equivalent replacement or change, which should be covered within the protection scope of the present invention.

Claims

1. A printing system based on automatic scanning, characterized in that: include, A scanning storage module, used for scanning the same document to be printed and scanned at least twice, obtaining a first image and a second image, and preprocessing the first image and the second image by OCR technology, including denoising, enhancement and edge detection; A scanning optimization module is used to identify the processed first image and the second image through an image comparison algorithm, extract the regional missed scan area features, and construct a regional missed scan index Lsx; if the regional missed scan index Lsx is lower than a preset defect threshold, the first image or the second image is judged to be qualified, and the images are aggregated into a third image set and sent to the second recognition optimization module; If the area scan miss index Lsx is higher than or equal to the preset defect threshold, the first image or the second image is discarded; The scanning optimization module includes an image registration unit and an image missed scan information calculation unit; The image registration unit is used to align different scanning results, compare the first image with the second image, and calculate the difference value of the i-th pixel in the registered differential image by the following formula: : ; In the formula, Indicates that the first image scan is The pixel value of Indicates that the second image is scanned at The pixel value of >T, the pixel is counted into the total number of difference pixels N; The image missing scan information calculation unit is used to calculate the difference value of the i-th pixel in the registered differential image. , the regional scan miss index Lsx is calculated by the following formula: ; ; In the formula, It indicates the density of the difference value in the difference area, which is used to judge the concentration of the difference in the area. It is calculated by the ratio of the difference value to the area size. N indicates the total number of difference pixels. represents the difference value of the i-th pixel in the registered differential image, Rs represents the area of ​​the difference region, is the sum of all difference values ​​in the difference region, represents the area of ​​the ith difference region, which is used to evaluate the severity of the missed scanning area; Through contour detection in image processing technology, the difference area is identified and its area is calculated; , and represents the weight coefficient; The centering optimization module is used to collect and obtain the tilt-related data of the text line in the third image set through the Hough transform algorithm, and after feature extraction, respectively obtain the text centerline to edge distance F and the text line tilt angle JD of each image in the third image set, and analyze and obtain the rotation index XZCz and the black edge area Hb according to the trained correction prediction model; and associate the rotation index XZCz with the black edge area Hb to obtain the first correction index Dy; An evaluation module pre-sets a first evaluation threshold Z and a second evaluation threshold R, performs comparative analysis on the first correction index Dy, comprehensively evaluates the relative influence of the black edge area generated after each image is rotated on the scanned document, and generates corresponding correction angle instructions and shearing instructions; The printing module is used to send a printing command to start the printing operation after executing the corresponding correction angle instruction and cutting instruction.

2. The automatic scanning printing system according to claim 1, characterized in that: The scanning storage module includes a scanning unit and a pre-processing unit; The scanning unit scans the same document to be scanned at least twice through an optical sensor and a scanning glass plate built into the scanner and an automatic paper feeder to obtain a first image and a second image; The preprocessing unit is used to perform pre-image preprocessing on the first image and the second image, and includes: S11, removing noise from the image, including median filtering, Gaussian filtering or wavelet denoising; S12, enhancing the contrast and clarity of the image, using histogram equalization, adaptive histogram equalization or contrast stretching method to perform enhancement processing to improve OCR recognition performance; S13, detecting edge features in the image; S14. Use optical character recognition (OCR) technology to extract text from the preprocessed first image and the second image, convert the text into an editable text format, and store the text as a first standby text.

3. The automatic scanning-based printing system according to claim 1, characterized in that: The scanning optimization module also includes a first judgment unit and a first adjustment unit; The first judgment unit is used to compare the regional scan miss index Lsx with a preset defect threshold to obtain the following judgment results, including: If the area scan miss index Lsx is less than the preset defect threshold, the first image or the second image is judged to be qualified, a first qualified printing mark is generated, the mark is aggregated into a third image set, and sent to the second recognition optimization module; If the area scan miss index Lsx is higher than or equal to the preset defect threshold, the first image or the second image is judged to be unqualified, including image partial blur, blank, and partial data loss problems, and a first abnormal printing mark is generated; The first adjustment unit is used to generate a first rejection command according to the first abnormal printing mark, to reject the first image or the second image, and to generate a rescan command until a first qualified printing mark is generated.

4. The automatic scanning-based printing system according to claim 1, characterized in that: The centering optimization module includes a collection unit, a feature extraction unit and a model building unit; The acquisition unit is used to acquire the tilt-related data of the text lines in the third image set in real time by using the Hough transform algorithm; The feature extraction unit is used to extract the text centerline to edge distance feature and the text line tilt angle feature; The model building unit is used to use image processing technology, including edge detection and geometric analysis, to obtain the text centerline to edge distance F and the text line inclination angle JD of each image; the convolutional neural network establishes a correction prediction model to analyze and obtain the rotation index XZCz and the black edge area Hb.

5. The printing system based on automatic scanning according to claim 4, characterized in that: The black border area Hb is calculated by the following formula: ; ; ; In the formula, Indicates the width of the image after simulated rotation. represents the height of the image after simulated rotation; W represents the width of the original image in the third image set, H represents the height of the original image in the third image set; JD represents the tilt angle of the text line in the original image, It is the cosine value of the text line tilt angle JD, which represents the horizontal component corresponding to the rotation angle. It is the sine value of the text line tilt angle JD, indicating the vertical component corresponding to the text line tilt angle JD.

6. The automatic scanning-based printing system according to claim 5, characterized in that: The centering optimization module further includes a correlation module for obtaining a first correction index Dy by correlating the rotation index XZCz and the black edge area Hb through the following correlation calculation: ; In the formula, and They represent the weight coefficients of the rotation index XZCz and the black border area Hb respectively.

7. The printing system based on automatic scanning according to claim 6, characterized in that: The evaluation module includes a first evaluation unit and a second strategy unit; The first evaluation unit is used to preset a first evaluation threshold Z and a second evaluation threshold R, wherein the first evaluation threshold Z>the second evaluation threshold R; The first correction index Dy is compared and evaluated with the first evaluation threshold Z and the second evaluation threshold R respectively to generate the following evaluation results, including: The first correction index Dy is less than the second evaluation threshold R, indicating that after adjustment according to the text line tilt angle JD, the relative impact strength is normal. At this time, the adjusted image meets the printing requirements and no further adjustment is required. The second strategy unit generates a first angle adjustment instruction to correct the image for the value of the text line tilt angle JD; The second evaluation threshold R≤the first correction index Dy≤the first evaluation threshold Z, indicating that the relative impact strength is abnormal after adjustment according to the text line tilt angle JD; at this time, further adjustment is required, and the second strategy unit generates a second angle adjustment instruction to correct the image with the value of the text line tilt angle JD*70%; and generates a first clipping instruction according to the black edge area Hb generated after the adjustment; The first correction index Dy>the first evaluation threshold Z, indicating that the relative impact intensity is abnormal after adjustment according to the text line inclination angle JD. At this time, further adjustment is required, and the second strategy unit generates a third angle adjustment instruction to correct the image with the value of the text line inclination angle JD*30%. And a second shearing instruction is generated according to the black border area Hb generated after the adjustment.

8. A printing method based on automatic scanning, applied to a printing system based on automatic scanning according to any one of claims 1 to 7, characterized in that: The following steps are included: Step 1: Scan the storage module for processing; use the scanning unit to scan the same document at least twice through the built-in optical sensor and scanning glass plate of the scanner and the automatic paper feeder to obtain the first image and the second image, and pre-process the first image and the second image through the OCR technology, including denoising, enhancement and edge detection; Step 2, processing of the scanning optimization module: the pre-processed first image and the second image are identified by the image comparison algorithm, and the regional missed scan area features are extracted to construct the regional missed scan index Lsx, and then it is determined whether the regional missed scan index Lsx is lower than the preset defect threshold. If it is lower, it is qualified and summarized into the third image set; otherwise, it is eliminated and re-scanned; Step 3: Obtain the tilt-related data of the text lines in the third image set through the Hough transform algorithm, extract feature data, obtain the distance F from the text centerline to the edge and the tilt angle JD of the text line in each image; according to the trained correction prediction model, analyze and obtain the rotation index XZCz and the black edge area Hb, and obtain the first correction index Dy by correlation calculation; Step 4: Processing of the evaluation module: presetting a first evaluation threshold Z and a second evaluation threshold R, performing comparative analysis on the first correction index Dy, and generating corresponding correction angle instructions and shearing instructions; Step 5: Processing of the printing module: After executing the corresponding angle correction instructions and cutting instructions, a printing command is sent to start the printing operation.