Image restoration method and system based on sRGB standard, and storage medium

By adopting an image restoration method based on the sRGB standard in image processing, the grayscale histogram is parsed and the decoding transformation of preset rules is performed, the problem of high QR code recognition failure rate is solved, and effective restoration and recognition of unclear QR code images is achieved.

CN119558334APending Publication Date: 2025-03-04广东德智矩阵科技有限公司 +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411488653.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The prior art cannot provide an effective image restoration method based on the sRGB standard, resulting in a high failure rate for system identification of QR codes during production and processing.

Method used

The target image of the target area is acquired by the camera, the grayscale histogram of the target image is analyzed, the linear color space value and nonlinear image digital signal are obtained, and the decoding and transformation is performed according to the preset rules. Preset rules include gamma encoding, offset value, maximum grayscale value, light and dark area segmentation threshold and smoothing factor.

Benefits of technology

This method can effectively restore the QR code image or QR code image without a good lighting system to the background color, and improve the success rate of image decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558334A_ABST
    Figure CN119558334A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of computer vision, and provides an image restoration method and system based on the sRGB standard and a storage medium, and the method comprises the steps: collecting a target image of a target region through a camera, and analyzing a gray histogram of the target image, obtaining a linear color space value and a nonlinear image digital signal, and carrying out decoding transformation according to a preset rule; wherein the preset rule is # imgabs0 #; g'is a gray value of gamma coding; g is a linear gray value; o is a deviation value; m is the maximum gray value of the byte picture; t is a light and dark area segmentation threshold value in the transformed image; s is a smoothing factor, and the value range of # imgabs 1 # is 0.1-1; through the steps of the invention, the image can be restored by selecting a proper G value, o, t and m value, and a clear pattern can be restored after the image with small background difference and less light is processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision technology, and in particular relates to an image restoration method, system and storage medium based on the sRGB standard. Background Art

[0002] A QR code is a black and white graphic that is distributed in two dimensions according to a certain pattern and consists of specific geometric shapes. Each black and white square represents a binary bit, where black represents "1" and white represents "0". These binary bits are combined to form various data information, including text, URLs, pictures, audio and video, etc. When a camera is used to scan a QR code, light is reflected from the QR code, and the CMOS photosensitive element converts the received light signal into an electrical signal. These electrical signals are then decoded into the binary data represented by the QR code. By parsing this data, we can obtain the information stored in the QR code.

[0003] Traditional QR code decoding algorithms require that the QR code be well illuminated, the image has a clear black-and-white contrast, and the edges of the QR code module are clear. However, in actual use, there are many complex situations. For example, in underground parking lots, the QR code does not have a good lighting system, and it is necessary to hold a mobile phone and take a close-up photo to decode it. For another example, in industrial applications, laser QR codes are gradually becoming mainstream. Due to the fact that the color of the QR code is close to the color of the background material, the camera image has no obvious contrast, and the QR code and the background are even integrated and almost invisible. This causes a lot of trouble for the correct decoding of the QR code. Therefore, an image restoration method based on the sRGB standard is used to solve the above problems. Summary of the invention

[0004] The purpose of the present invention is to provide an image restoration method, system and storage medium based on the sRGB standard, aiming to solve the problem that the failure rate of system recognition of two-dimensional codes is high during the production and processing process because the prior art cannot provide an effective image restoration method based on the sRGB standard.

[0005] In one aspect, the present invention provides an image restoration method based on the sRGB standard, the method comprising the following steps: Acquire a target image of a target area by using a camera; Analyze the grayscale histogram of the target image, obtain the linear color space value and the nonlinear image digital signal and perform decoding transformation according to the preset rules; The preset rules are: ; Where: G' is the gray value of gamma encoding; G is the linear gray value; o is the offset value; m is the maximum gray value of the byte image; t is the threshold for segmenting the light and dark areas in the transformed image; s is the smoothing factor, The value range is between 0.1-1.

[0006] In the image restoration method based on the sRGB standard of the present invention, s is calculated by the following formula: Right now ; Where s is the transition calculation at the edge of the image after the pixels in the four-neighborhood format are normalized, which is used to restrain the shock wave effect that appears at the feature edge.

[0007] In the image restoration method based on the sRGB standard described in the present invention, the G value can adopt the sRGB standard value 1.0 / 2.4, or can be set manually.

[0008] The image restoration method based on the sRGB standard of the present invention, before executing the setting of the G value, the method also includes establishing a color lookup table lut(256)=I / 255.0 with a grayscale value range of 0-255 in a byte format image, wherein I is the byte grayscale value range.

[0009] On the other hand, the present invention also provides a computer control system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0010] On the other hand, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0011] The beneficial effect of the present invention is that for a QR code image without a good lighting system, or due to the fact that the color of the QR code image is close to the background material color, resulting in image decoding failure, the image can be restored by the method steps provided by this solution. For images with small background differences and little light, a clear pattern can be restored after processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is a logic flow chart of an image processed by an image restoration method based on the sRGB standard provided in the first embodiment of the present invention.

[0013] Figure 2 This is the original image before being processed by the image restoration method based on the sRGB standard provided in the first embodiment of the present invention.

[0014] Figure 3 This is an effect diagram obtained by processing the original image using the image restoration method based on the sRGB standard provided in the first embodiment of the present invention. DETAILED DESCRIPTION

[0015] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0016] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments: Embodiment 1

[0017] Figure 1 The implementation process of the image restoration method based on the sRGB standard provided in the first embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown. The specific steps are described in detail as follows: Step 1: Use the camera to capture the target image of the target area. For example, the captured original QR code image is as follows: Figure 2 In (1) and (2), the original image is not clear and basically unrecognizable due to insufficient light; Step 2: Analyze the grayscale histogram of the target image, obtain the linear color space value and the nonlinear image digital signal, and perform decoding transformation according to the preset rules; The preset rules are: Where: G' is the gray value of gamma encoding; G is the linear gray value; o is the offset value; m is the maximum gray value of the byte image, that is, 255; t is the threshold for segmenting the light and dark areas in the transformed image, which is used to segment the light and dark changes in the image; s is the smoothing factor, γ ranges from 0.1 to 1, the commonly used value is 0.5±Δ, Δ takes any decimal between 0 and 0.1, and different values ​​can be selected according to different needs in practice.

[0018] Where s is calculated by the following formula: Right now ; Where s is the transition calculation at the edge of the image after the pixels in the four-neighborhood format are normalized, which is used to restrain the shock wave effect that appears at the feature edge.

[0019] Furthermore, the G value may adopt the sRGB standard value 1.0 / 2.4, or may be set manually, for example, may be set to 0.1.

[0020] Furthermore, before executing the step of setting the G value, the method further includes establishing a color lookup table lut(256)=I / 255.0 with a grayscale value range of 0-255 for the byte format image, wherein I is the grayscale value range of the byte.

[0021] When actually applied to the system, a database of multiple parameter values ​​(G, o, t and m) corresponding to scenes of different brightness and darkness and the linear increase of image-background contrast can be pre-set. The system camera can temporarily obtain the illumination or background contrast of the scene as a trigger, and then select the database corresponding to the scene to call; As an example, G is 0.1, o is 0.01, t is 0.05, and m is 255. After the above steps, Figure 1 The original image is transformed and processed as follows Figure 2 The target image has clear image information at each position in the target image. At this time, traditional recognition equipment and methods can be used for accurate recognition. For scenes with poor lighting conditions and products with oblique light that cannot enter the CMOS photosensitive chip, the image pixels are converted using the method of this solution to completely restore the actual effect of the image, providing a reliable image basis for correct recognition. Embodiment 2

[0022] In an embodiment of the present invention, a computer control system is provided. For ease of description, only parts related to the embodiment of the present invention are shown.

[0023] The computer control system of the embodiment of the present invention comprises a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned image restoration method embodiments based on the sRGB standard are implemented. Embodiment 3

[0024] In an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned image restoration method embodiment based on the sRGB standard are implemented.

[0025] The computer-readable storage medium of the embodiment of the present invention may include any entity or device or recording medium capable of carrying computer program code, for example, ROM / RAM, magnetic disk, optical disk, flash memory and other memories.

[0026] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements 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 restoration method based on the sRGB standard, characterized in that: The method comprises the following steps: Acquire a target image of a target area by using a camera; Analyze the grayscale histogram of the target image, obtain the linear color space value and the nonlinear image digital signal and perform decoding transformation according to the preset rules; The preset rules are: ; Where: G' is the gray value of gamma encoding; G is the linear gray value; o is the offset value; m is the maximum gray value of the byte image; t is the threshold for segmenting the light and dark areas in the transformed image; s is the smoothing factor, The value range is between 0.1-1.

2. The image restoration method based on the sRGB standard as claimed in claim 1, characterized in that: s is calculated by the following formula: Right now ; In the formula, s is the transition calculation at the edge of the image light and dark changes after the pixels in the four-neighborhood format are normalized, which is used to restrain the shock wave effect that appears at the feature edge.

3. The image restoration method based on the sRGB standard as claimed in claim 2, characterized in that: The G value can adopt the sRGB standard value 1.0 / 2.4, or can be set manually.

4. The image restoration method based on the sRGB standard as claimed in claim 3, characterized in that: Before executing the setting of the G value, the method further includes establishing a color lookup table lut(256)=I / 255.0 with a grayscale value range of 0-255 in a byte format image, wherein I is the grayscale value range of the byte.

5. A computer control system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.