Image preprocessing and image enhancement method suitable for self-service printing terminal

Through the image preprocessing and enhancement method of the self-service printing terminal, the subject contour detection, contour rotation correction and morphological processing are used to solve the image quality problems caused by device jitter, low light environment and complex background during image acquisition, and realize the image quality problems. Efficient image processing and high-quality printing in a variety of scenarios have improved the user experience.

CN119168928APending Publication Date: 2024-12-20BEIJING MEDICAL POST INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411273564.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing self-service printing terminals are susceptible to device jitter, low-light environment, ambient light and complex backgrounds during image acquisition, resulting in image blur, noise, color distortion and tilt. The existing image processing technology lacks multi-scene adaptability and real-time affects user experience.

Method used

Image preprocessing and enhancement methods, including subject contour detection, contour rotation correction, background cropping and morphological processing, using Canny edge detection algorithm, adaptive noise filtering and bilateral filters, CLAHE algorithm, dynamic exposure compensation and white balance correction and other technologies to automatically process images to improve image quality and adaptability.

Benefits of technology

It realizes high-quality preprocessing and enhancement of images in different environments, reduces the impact of equipment and environment on image quality, improves the convenience and processing efficiency of self-service terminals, ensures high-quality printouts, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168928A_ABST
    Figure CN119168928A_ABST
Patent Text Reader

Abstract

The invention provides an image preprocessing and image enhancement method suitable for a self-service printing terminal, and aims to solve the problem of unstable image acquisition quality in the self-service printing terminal. The method comprises two core steps of image preprocessing and image enhancement: firstly, automatically identifying a main body object in an image through a contour detection algorithm, and performing rotation correction on the image to standardize the direction of the main body; then, the background area is cut off, and only the main body image is reserved; thirdly, noise points and background colors are removed through morphological processing, and the image contrast and definition are further optimized through a color extraction and fusion algorithm; the method can automatically process the acquired image in complex environments such as low light and strong light, and the image quality is remarkably improved, so that the image is suitable for direct printing. Through the method, the self-service printing terminal can output the high-quality image close to the copying level, the method has the advantages of automation, rapid processing, multi-scene adaptation and the like, and the user experience is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing systems, and in particular to an image preprocessing and image enhancement method suitable for a self-service printing terminal. Background Art

[0002] With the rapid development of the Internet of Things (IoT) and artificial intelligence (AI) technologies, self-service terminal devices have been widely used in various public and commercial places. Especially in the fields of office, education, retail, etc., self-service printing terminals have become an indispensable part of people's daily life. Users can quickly complete document printing, copying, scanning and other operations through these terminals without manual intervention, which greatly improves efficiency and convenience.

[0003] Although self-service printing terminals bring convenience to users in terms of functionality, in actual applications, image quality issues have become one of the main pain points affecting user experience. Most existing self-service printing terminals rely on users' own mobile devices (such as smartphones) or built-in image acquisition devices (such as high-speed scanners) for image acquisition. However, due to external factors such as hardware limitations of the acquisition device, improper user operation, and ambient lighting, the acquired images often have the following problems:

[0004] The images taken or scanned by the user may be blurred due to device shaking, inaccurate focus or unreasonable shooting distance, which will affect the subsequent printing quality.

[0005] Images taken in low-light environments are prone to a large amount of noise, which can cause blurred image details and even make it impossible to identify the subject. Especially when high-definition document copies are required, noise can seriously affect the printing effect.

[0006] Users often place printed materials, such as ID cards, invoices or other documents, randomly, resulting in different degrees of tilt of the main objects in the captured images. This tilt not only affects the aesthetics of the print, but may also cause some content to be unable to be fully displayed.

[0007] Ambient light (such as strong light, backlight or shadow) has a significant impact on image acquisition. The acquired image may have serious color distortion, especially for important documents or certificates. Color distortion will affect the accurate communication of information.

[0008] When users use mobile devices to take photos of documents, they often bring in complex backgrounds, such as desktops, other objects, and even the user's hands. Complex backgrounds not only affect the beauty of the image, but also make it difficult for self-service printing devices to accurately identify and print out the required document content.

[0009] Although some existing image processing technologies can handle some problems (such as denoising, contrast enhancement, simple rotation correction, etc.), they often have the following limitations:

[0010] Existing image processing algorithms are mostly designed for specific scenes, lacking adaptability to different lighting conditions and acquisition effects of different devices, resulting in unsatisfactory processing results in complex scenes. For example, although some denoising algorithms can eliminate noise, they may cause loss of image details; and image enhancement algorithms often rely too much on the quality of the original image. When the quality of the original image is poor, the enhancement effect is limited.

[0011] Self-service terminal systems require real-time image processing, that is, to complete image processing and printing in a short time while the user is waiting. If the processing time is too long, the user experience will be greatly reduced. However, fast processing often sacrifices processing results, resulting in insufficient image optimization.

[0012] For some existing image processing technologies, users need to perform multiple steps of manual adjustments (such as adjusting brightness, rotation angle, etc.), which not only increases the difficulty of operation, but also easily leads to user misoperation, affecting image quality.

[0013] In order to solve the above problems, it is particularly necessary to develop an image preprocessing and image enhancement method suitable for self-service printing terminals. The method needs to be automated, efficient, and adaptable to multiple scenarios, and be able to intelligently preprocess and enhance the collected images in different environments (such as low light, strong light, and complex backgrounds) to ensure that the image quality of the final print output is close to the photocopy level and improve the user experience. Summary of the invention

[0014] The purpose of the present invention is to provide an image preprocessing and image enhancement method suitable for a self-service printing terminal in view of the deficiencies in the prior art, so as to solve the problems raised in the background technology.

[0015] To achieve the above object, the present invention provides the following technical solution: an image preprocessing and image enhancement method suitable for a self-service printing terminal, comprising the following steps:

[0016] Image acquisition: collect images to be printed;

[0017] Subject contour detection: The target object in the image is detected by edge detection algorithm to generate multiple contours;

[0018] Contour rotation correction: Calculate the minimum enclosing rectangle of the contour and rotate the image to standardize the orientation of the target object;

[0019] Background cropping: Crop unnecessary background areas based on the detected target object.

[0020] As a preferred technical solution of the present invention, the contour detection uses the Canny edge detection algorithm, which specifically includes the following steps:

[0021] Input image I(x,y), where I is a grayscale image;

[0022] Calculate the gradient magnitude Among them I x and I y are the gradients in the horizontal and vertical directions respectively;

[0023] The gradient amplitude is binarized according to the threshold to obtain a binary edge image.

[0024] As a preferred technical solution of the present invention, the contour rotation correction comprises the following steps: for each detected contour, calculating the minimum circumscribed rectangle;

[0025] Get the rotation angle θ of the circumscribed rectangle; adjust the image rotation angle to θ′=90°-θ so that the target object is arranged vertically.

[0026] As a preferred technical solution of the present invention, in the background cutting step, the cutting method is:

[0027] Calculate the circumscribed rectangle of the maximum contour R = {(x1, y1), (x2, y2), (x3, y3), (x4, y4)};

[0028] According to the coordinates of the circumscribed rectangle, cut out the main area I sub ,in:

[0029]

[0030] As a preferred technical solution of the present invention, a method for removing background color is included, and the specific steps are:

[0031] Perform color analysis on the cropped image and calculate the average value of the background color Among them C i is the color value of the background pixel, n is the number of background pixels;

[0032] The background pixel color value and C bg Pixels whose difference exceeds the threshold are marked as foreground pixels.

[0033] As a preferred technical solution of the present invention, after removing the background color, a morphological operation is performed on the image, including the following steps of performing a closing operation on the image using a structural element S:

[0034]

[0035] Where ⊕ is the expansion operation, For corrosion operation.

[0036] As a preferred technical solution of the present invention, the structure element S is a 1×1 rectangular structure element, which is used to smooth the edge of the target object and eliminate small noise points in the background.

[0037] As a preferred technical solution of the present invention, it further includes a background color extraction step, extracting the background color and performing weighted average fusion on the background area, specifically: extracting the color value C of the background area bg , perform weighted fusion processing on the background area:

[0038] C new (x,y)=αC bg (x,y)+(1-α)C(x,y)

[0039] Where α is the background weight coefficient.

[0040] As a preferred technical solution of the present invention, in the weighted fusion step of extracting the background color and performing weighted average fusion on the background area, the weight coefficient α is adaptively adjusted according to the contrast between the foreground and the background in the image:

[0041]

[0042] Among them C fg Foreground color value.

[0043] As a preferred technical solution of the present invention, the processed image can be directly applied to high-quality printing of a self-service printing terminal, and the image finally generated meets the objective function of the following formula:

[0044]

[0045] Among them, Q(I) is the image quality assessment function, w ij is the weight, I(i,j) is the pixel value, C bg (i,j) is the background pixel value.

[0046] Compared with the prior art, the present invention has the following beneficial effects:

[0047] The present invention automatically detects the outline of the subject in the image and performs rotation correction by preprocessing and enhancing the image, so that the image can still be accurately adjusted to the standard horizontal or vertical direction even when it is tilted or blurred. By cutting out the redundant background and removing environmental interference, the clarity and contrast of the generated image can be significantly improved, ensuring that the image output by the self-service printing terminal meets the high-quality printing standard.

[0048] This method has strong environmental adaptability and can effectively process image problems in a variety of environments such as low light, strong light, and complex backgrounds. Whether it is noise interference or color distortion, the algorithm can be intelligently adjusted and enhanced to ensure that the image can obtain good processing effects under various acquisition conditions, greatly reducing the impact of the environment and equipment on image quality.

[0049] The present invention realizes fully automated image processing without manual operation by the user, greatly improving the convenience of use and processing efficiency of the self-service terminal. At the same time, the steps of morphological processing, background removal, image enhancement, etc. are optimized at the algorithm level, so that the image preprocessing and optimization can be completed in a short time, meeting the requirements of the self-service terminal for real-time and high efficiency, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 The present invention is a method flow chart of an image preprocessing and image enhancement method suitable for a self-service printing terminal. DETAILED DESCRIPTION

[0051] 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.

[0052] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings and multiple embodiments.

[0053] In order to better explain the embodiments of the present invention, the following describes in detail the method and system for predicting the efficacy of neoadjuvant chemoradiotherapy for rectal cancer based on magnetic resonance image analysis through several specific examples. Each example covers the complete process from image acquisition and processing to efficacy prediction.

[0054] Implementation 1: Basic image preprocessing and enhancement

[0055] See also Figure 1 This embodiment is based on the basic image preprocessing and enhancement method of the self-service printing terminal, and includes the following steps: Image acquisition uses a mobile device (such as a smart phone or a high-speed scanner) to collect the image to be printed. The collected image may contain uneven background, tilted main objects and noise. Subject contour detection uses the Canny edge detection algorithm to detect the external contour of the collected image. The detected contour may be the edge of multiple objects.

[0056] The edge detection steps are as follows:

[0057]

[0058] Among them I x and I y They are the image gradients in the horizontal and vertical directions respectively. By setting the threshold, meaningful edge contours are retained.

[0059] Contour simplification and area calculation:

[0060] The detected contours are simplified to reduce the number of contour points and retain the main geometric features.

[0061] Then the area of ​​each contour is calculated, and the largest contour is selected as the main contour of the target object.

[0062] Image rotation correction:

[0063] Calculate the minimum enclosing rectangle of the largest contour and obtain its rotation angle θ. By rotating the image, the target object is aligned vertically with the coordinate axis:

[0064] θ′=90°-θ

[0065] Background Clipping

[0066] This step standardizes the collected image and ensures the consistency of subsequent processing. The image is cropped according to the circumscribed rectangle of the largest contour to remove the background area. The cropped image only retains the main object part, forming a sub-image.

[0067] Background removal:

[0068] Perform background color analysis on the cropped image and calculate the color average C of the background pixels bg , and clear the background color.

[0069] Binarization is performed based on the difference between background pixels and subject pixels, as follows:

[0070]

[0071] Where T is the threshold that determines whether a pixel belongs to the background.

[0072] Morphological processing:

[0073] Perform morphological closing and smoothing operations on the background-cleared image to remove noise and disconnected parts, using the structural element S for the operation:

[0074]

[0075] Among them, the dilation operation ⊕ is used to expand the foreground area, and the corrosion operation Used to remove small noise.

[0076] Image enhancement and fusion:

[0077] The processed image is subjected to background color extraction and overlay processing. First, the background color C is extracted. bg , and then perform weighted fusion of the foreground and background:

[0078] C final (x,y)=αC fg (x,y)+(1-α)C bg (x,y)

[0079] Where α is the weighting coefficient of foreground and background, which can be dynamically adjusted according to the contrast between foreground and background.

[0080] Implementation 2: Image enhancement processing in low light environment

[0081] See also Figure 1 In low-light environments, the collected images often have problems such as more noise and uneven brightness. This implementation optimizes the image contrast and clarity for image processing in low-light environments.

[0082] Image acquisition

[0083] In low-light conditions, images captured using a high-sensitivity camera are usually accompanied by higher noise.

[0084] Image Denoising:

[0085] Use the adaptive noise removal algorithm to preprocess the image, first smooth the image through a bilateral filter:

[0086]

[0087] Among them, G s and G r are the Gaussian weights in the spatial domain and the grayscale domain respectively, and N(x,y) is the pixel neighborhood.

[0088] Contrast enhancement enhances image contrast through adaptive histogram equalization (CLAHE) algorithm, making the target object clearer.

[0089] The operation steps of CLAHE are:

[0090] I enhanced (x,y)=CLAHE(I smooth (x,y)

[0091] Contour detection and background processing:

[0092] The subsequent steps are similar to the first implementation, including contour detection, background clipping, morphological processing, etc., to ensure that the target area is clearly displayed and the background is effectively removed.

[0093] Implementation 3: Multi-subject Image Processing

[0094] See also Figure 1 When the captured image contains multiple subjects (such as multiple bills or certificates), it is necessary to process the contours of the multiple subjects and enhance them separately. This implementation describes in detail how to handle such a situation.

[0095] Subject contour detection: Use contour detection algorithm to detect multiple subjects in the image and obtain multiple contours. Use area calculation method to select multiple large area contours as multiple subjects for subsequent processing.

[0096] Multi-subject correction and cropping: Calculate the minimum bounding rectangle of each subject outline and perform separate rotation correction. Each subject is cropped into an independent sub-image.

[0097] Individual enhancement processing: Each cropped subject image is subjected to background removal, morphological processing and image enhancement to generate multiple enhanced sub-images. Finally, a final image containing multiple subjects is synthesized, which is suitable for multi-page printing or display at self-service terminals.

[0098] Implementation 4: Image processing in strong light environment

[0099] See also Figure 1 In strong light or backlight conditions, images are prone to overexposure or color distortion. This embodiment processes images in strong light environments using dynamic exposure compensation and color correction technology.

[0100] Exposure compensation:

[0101] Use the adaptive exposure compensation algorithm to adjust the brightness value of the image. By analyzing the local brightness value in the image, dynamically adjust the brightness of the over-bright area to make the image uniform overall. The pixel value adjustment formula after compensation is:

[0102]

[0103] Among them, L mean is the local brightness mean of the image, and β is the compensation coefficient.

[0104] Color Correction:

[0105] Color correction is performed on overexposed areas, and a white balance adjustment algorithm is used to restore the true color. The corrected color value is calculated as follows:

[0106]

[0107] Where γ is the correction coefficient, C is the color value of the image, and R, G, and B are the values ​​of the red, green, and blue channels respectively.

[0108] Subsequent processing:

[0109] After exposure compensation and color correction, the image undergoes contour detection, background removal, morphological processing, and enhancement steps to ultimately generate a high-quality print image.

[0110] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in the field. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An image preprocessing and image enhancement method suitable for a self-service printing terminal, characterized in that: The following steps are involved: Image acquisition: collect images to be printed; Subject contour detection: The target object in the image is detected by edge detection algorithm to generate multiple contours; Contour rotation correction: Calculate the minimum enclosing rectangle of the contour and rotate the image to standardize the orientation of the target object; Background cropping: Crop unnecessary background areas based on the detected target object.

2. The image preprocessing and image enhancement method applicable to a self-service printing terminal according to claim 1, characterized in that: The contour detection uses the Canny edge detection algorithm, which specifically includes the following steps: Input image I(x,y), where I is a grayscale image; Calculate the gradient magnitude Among them I x and I y are the gradients in the horizontal and vertical directions respectively; The gradient amplitude is binarized according to the threshold to obtain a binary edge image.

3. The image preprocessing and image enhancement method applicable to a self-service printing terminal according to claim 1, characterized in that: The contour rotation correction comprises the following steps: for each detected contour, calculating the minimum circumscribed rectangle; Get the rotation angle θ of the circumscribed rectangle; adjust the image rotation angle to θ′=90°-θ so that the target object is arranged vertically.

4. The image preprocessing and image enhancement method applicable to a self-service printing terminal according to claim 1, characterized in that: In the background cutting step, the cutting method is: Calculate the circumscribed rectangle of the maximum contour R = {(x1, y1), (x2, y2), (x3, y3), (x4, y4)}; According to the coordinates of the circumscribed rectangle, the main area Isub is cut out, where:

5. The image preprocessing and image enhancement method applicable to a self-service printing terminal according to claim 1, characterized in that: Including a method for removing the background color, the specific steps are: Perform color analysis on the cropped image and calculate the average value of the background color Among them C i is the color value of the background pixel, n is the number of background pixels; The background pixel color value and C bg Pixels whose difference exceeds the threshold are marked as foreground pixels.

6. The image preprocessing and image enhancement method applicable to a self-service printing terminal according to claim 5, characterized in that: After removing the background color, the image is subjected to morphological operations, including the following steps to close the image using the structural element S: in For expansion operation, For corrosion operation.

7. The image preprocessing and image enhancement method applicable to a self-service printing terminal according to claim 6, characterized in that: The structure element S is a 1×1 rectangular structure element, which is used to smooth the edge of the target object and eliminate small noise points in the background.

8. The image preprocessing and image enhancement method applicable to a self-service printing terminal according to claim 1, characterized in that: It further includes a background color extraction step, extracting the background color and performing weighted average fusion on the background area, specifically: extracting the color value C of the background area bg , perform weighted fusion processing on the background area: C new (x,y)=αC bg (x,y)+(1−α)C(x,y) Where α is the background weight coefficient.

9. The image preprocessing and image enhancement method applicable to a self-service printing terminal according to claim 8, characterized in that: In the weighted fusion step of extracting the background color and performing weighted average fusion on the background area, the weight coefficient α is adaptively adjusted according to the contrast between the foreground and background in the image: Among them C fg Foreground color value.

10. The image preprocessing and image enhancement method applicable to a self-service printing terminal according to claim 1, characterized in that: The processed image can be directly applied to high-quality printing at the self-service printing terminal, and the final generated image meets the objective function of the following formula: Among them, Q(I) is the image quality assessment function, w ij is the weight, I(i,j) is the pixel value, C bg (i,j) is the background pixel value.