[go: up one dir, main page]

CN119721087A - A display module two-dimensional code image processing method and device - Google Patents

A display module two-dimensional code image processing method and device Download PDF

Info

Publication number
CN119721087A
CN119721087A CN202411784059.4A CN202411784059A CN119721087A CN 119721087 A CN119721087 A CN 119721087A CN 202411784059 A CN202411784059 A CN 202411784059A CN 119721087 A CN119721087 A CN 119721087A
Authority
CN
China
Prior art keywords
area
dimensional code
image
target
roi
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411784059.4A
Other languages
Chinese (zh)
Inventor
蒲大杭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Truly Opto Electronics Ltd
Original Assignee
Truly Opto Electronics Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Truly Opto Electronics Ltd filed Critical Truly Opto Electronics Ltd
Priority to CN202411784059.4A priority Critical patent/CN119721087A/en
Publication of CN119721087A publication Critical patent/CN119721087A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention provides a two-dimensional code image processing method and device for a display module. The method comprises the steps of photographing based on a code scanning gun to obtain an image, segmenting an ROI (region of interest) and preprocessing the ROI, screening pixel area size, minimum circumscribed rectangle length and width and rectangle similarity characteristics of the ROI to determine a target area, intercepting target image target_image of the target area, segmenting a black information area and a white background area after median filtering noise reduction processing, assigning a pixel gray value of the black information area to 0 and a pixel gray value of the background area to 255, enhancing contrast of the two-dimensional code area, and extracting two-dimensional code information by utilizing the enhanced image of the two-dimensional code area. The two-dimensional code area of the product is selected by dividing the ROI area, the two-dimensional code information and the white background are subjected to binarization processing to enhance the contrast, and the problems of unsuccessful recognition caused by uneven illumination and fuzzy images are solved.

Description

Display module two-dimensional code image processing method and device
Technical Field
The invention relates to the technical field of image processing, in particular to a method, equipment, an electronic device and a storage medium for processing a two-dimensional code image of a display module.
Background
In the display touch control production line, a matrix type code scanning gun is often arranged on the production line to identify, identify and record two-dimensional codes on products on the production line, so that the products can be traced in later periods. Because products on the assembly line are mobile, and the product placement positions and angles are different, when the two-dimensional code is identified by photographing through the code scanning gun, the conditions that the two-dimensional code position cannot be identified, the illumination of the two-dimensional code is uneven, and the identification is unsuccessful due to image blurring often exist.
Disclosure of Invention
The technical problem to be solved by the embodiment of the application is to facilitate the discrimination of the position of the two-dimensional code and the processing of the two-dimensional code image under the conditions of uneven illumination and blurred image of the two-dimensional code, thereby facilitating the subsequent identification of the two-dimensional code information.
The first aspect of the invention provides a two-dimensional code image processing method of a display module, which comprises the following steps:
The method comprises the steps of shooting based on a code scanning gun to obtain an image, segmenting an ROI region and preprocessing the ROI region;
the method comprises the steps of screening pixel area size, minimum circumscribed rectangle length and width and rectangle similarity characteristics of an ROI region respectively to determine a target region, wherein the target region is a two-dimensional code region;
Intercepting a target image of the target area, performing median filtering noise reduction treatment, and performing maximum inter-class variance method OTSU on the target image, solving an optimal segmentation threshold K of two-dimensional code information and a white background, and segmenting a black information area and a white background area;
The gray value of the pixel in the black information area is assigned to 0, the gray value of the pixel in the background area is assigned to 255, and the contrast of the two-dimensional code area is enhanced;
and extracting the two-dimensional code information by utilizing the enhanced image of the two-dimensional code area.
Further, the segmenting the ROI area and performing ROI area preprocessing includes:
carrying out a maximum inter-class variance method OTSU on the image, and dividing an ROI region;
performing expansion operation and erosion operation on the ROI region to enable the edge of the ROI region to be flat and smooth, and performing filling operation on all the ROI region to fill gaps inside the region.
Further, the filtering the pixel area size, the minimum circumscribed rectangle length and width and the rectangle similarity characteristic of the ROI area to determine the target area includes:
And screening out the area with the rectangle similarity larger than 0.9 and the number of the pixel length and the number of the area in the predetermined range by utilizing the characteristics that the two-dimensional code of the same product is rectangular in appearance characteristic, the number of the pixels with the length and the width and the pixel area of the two-dimensional code are unchanged, and judging the area as a target area.
Further, the screening out the area with the rectangle similarity greater than 0.9 and the number of the pixel length and the width and the number of the area within the predetermined range is determined as the target area, including:
and screening out the Area with the rectangle similarity larger than 0.9 and the Area larger than 0.9 and smaller than 1.1, and judging the Area as the target Area.
In addition, a second aspect of the present invention provides a two-dimensional code image processing apparatus, the apparatus including an acquisition and segmentation module, a screening module, a first processing module, a second processing module, and an extraction module, wherein:
the acquisition and segmentation module is used for acquiring images based on photographing of the code scanning gun, segmenting out the ROI region and preprocessing the ROI region;
the screening module is used for screening the pixel area size, the minimum circumscribed rectangle length and width and the rectangle similarity characteristics of the ROI area respectively to determine a target area, wherein the target area is a two-dimensional code area;
the first processing module is used for intercepting a target image target_image of the target area, carrying out median filtering noise reduction processing, carrying out a maximum inter-class variance method OTSU on the target image target_image, solving an optimal segmentation threshold K of two-dimensional code information and a white background, and segmenting a black information area and a white background area;
The second processing module is used for assigning the gray value of the pixel of the black information area to 0, assigning the gray value of the pixel of the background area to 255 and enhancing the contrast of the two-dimensional code area;
and the extraction module is used for extracting the two-dimensional code information by utilizing the enhanced image of the two-dimensional code area.
Further, the acquisition and segmentation module is further configured to:
carrying out a maximum inter-class variance method OTSU on the image, and dividing an ROI region;
performing expansion operation and erosion operation on the ROI region to enable the edge of the ROI region to be flat and smooth, and performing filling operation on all the ROI region to fill gaps inside the region.
Further, the screening module is further configured to:
And screening out the area with the rectangle similarity larger than 0.9 and the number of the pixel length and the number of the area in the predetermined range by utilizing the characteristics that the two-dimensional code of the same product is rectangular in appearance characteristic, the number of the pixels with the length and the width and the pixel area of the two-dimensional code are unchanged, and judging the area as a target area.
Further, the screening out the area with the rectangle similarity greater than 0.9 and the number of the pixel length and the width and the number of the area within the predetermined range is determined as the target area, including:
and screening out the Area with the rectangle similarity larger than 0.9 and the Area larger than 0.9 and smaller than 1.1, and judging the Area as the target Area.
Further, a third aspect of the present invention provides an electronic device comprising one or more processors, a memory for storing one or more computer programs configured to be executed by the one or more processors, the programs comprising steps for performing the display module two-dimensional code image processing method according to the first aspect.
Further, a fourth aspect of the present invention provides a storage medium storing a computer program, the program being loaded and executed by a processor to implement the steps of the display module two-dimensional code image processing method according to the first aspect above.
According to the scheme, an image is obtained by photographing based on a code scanning gun, an ROI area is segmented, ROI area preprocessing is conducted, the ROI area is screened for pixel area size, minimum circumscribed rectangular length and width and rectangular similarity characteristics, a target area is determined, the target area is a two-dimensional code area, a target image of the target area is intercepted, after median filtering noise reduction processing is conducted, a black information area and a white background area are segmented, the gray value of a pixel of the black information area is assigned to be 0, the gray value of a pixel of the background area is assigned to be 255, contrast of the two-dimensional code area is enhanced, and two-dimensional code information extraction is conducted by utilizing the image of the enhanced two-dimensional code area. Compared with the prior art, the method has the advantages that the two-dimensional code area of the product is screened out by dividing the ROI area, the contrast is enhanced by carrying out binarization processing on the two-dimensional code information and the white background, and the problems of unsuccessful identification caused by uneven illumination and fuzzy images are solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a two-dimensional code image processing method of a display module disclosed by the embodiment of the invention;
fig. 2 is a schematic diagram of an image obtained by photographing based on a code scanning gun according to an embodiment of the invention;
FIG. 3 is a schematic image of a segmented ROI area as disclosed in an embodiment of the present invention;
FIG. 4 is a subjective illustration of filling all ROI areas as disclosed in an embodiment of the present invention;
FIG. 5 is a schematic diagram of image segmentation results in a template creation process according to an embodiment of the present invention;
FIG. 6 is a schematic image of a target area disclosed in an embodiment of the present invention;
FIG. 7 is a schematic diagram of a black information area and a white background area according to an embodiment of the present invention;
FIG. 8 is a pre-enhancement two-dimensional code image disclosed in an embodiment of the present invention;
fig. 9 is an enhanced two-dimensional code image disclosed in an embodiment of the present invention.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs, the terms used in the description of this application are for the purpose of describing particular embodiments only and are not intended to be limiting of the application, and the terms "comprising" and "having" and any variations thereof in the description of this application and the claims and the above description of the drawings are intended to cover non-exclusive inclusions. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
It should be noted that the term "plurality" as used herein means two or more.
The implementation details of the technical scheme of the embodiment of the application are described in detail below:
Referring to fig. 1, fig. 1 is a schematic diagram of the overall hardware structure of the device structure of the present embodiment. The hardware structure of the device in this embodiment includes:
A first aspect of the present embodiment provides a method for processing a two-dimensional code image of a display module, as shown in fig. 1, which is a flowchart of a method for processing a two-dimensional code image of a display module in this example. The method comprises the following steps:
s101, shooting based on a code scanning gun to obtain an image, segmenting an ROI region and preprocessing the ROI region;
Specifically, in this embodiment, when the product passes through the photographing range of the area array code scanning gun visual area, the code scanning gun photographs and takes an image. As shown in fig. 2, an image obtained by photographing based on the code scanning gun in this example is shown.
Further, in S101, the segmenting the ROI area and performing ROI area preprocessing includes:
carrying out a maximum inter-class variance method OTSU on the image, and dividing an ROI region;
performing expansion operation and erosion operation on the ROI region to enable the edge of the ROI region to be flat and smooth, and performing filling operation on all the ROI region to fill gaps inside the region.
Further, in this embodiment, the maximum inter-class variance method OTSU is performed on the image to segment the ROI area (region of interest), as shown in fig. 3, which is an image of the ROI area segmented in this example, wherein the red area in fig. 3. The method comprises the steps of obtaining a gray value of each pixel on an image through inputting the image, obtaining an optimal foreground segmentation threshold K by using a maximum inter-class variance method OTSU, wherein the foreground is a region with higher gray brightness of a two-dimensional code in the image, performing threshold segmentation processing by using the threshold K, and finally segmenting a region with high brightness, wherein the region comprises a two-dimensional code region and other regions, the region is called as an ROI region (red region in fig. 3), and the next fine segmentation is needed.
Further, in this embodiment, the above ROI area (red area in fig. 3) is subjected to dilation operation and erosion operation to make the edge of the ROI area flat and smooth, and then all the ROI areas are subjected to filling operation to fill the gaps inside the areas. Fig. 4 is a subjective view showing the filling of all ROI areas in this example. The region with the edge or the inside missing part of the ROI is completely filled by the morphological expansion algorithm and the erosion algorithm processing through the ROI, the region with the edge protruding of the ROI is cut by the erosion algorithm, and finally the region is completely processed by the gap filling algorithm in the region, so that the region processed by the morphological algorithm is more complete, and the subsequent screening of the target region (two-dimensional code region) is facilitated. The red region edges will be smoother before and after processing.
S102, screening pixel area size, minimum circumscribed rectangle length and width and rectangle similarity characteristics of the ROI area respectively to determine a target area, wherein the target area is a two-dimensional code area;
Further, in S102, the filtering the pixel area size, the minimum circumscribed rectangle length and width, and the rectangle similarity characteristic of the ROI area, to determine the target area includes:
And screening out the area with the rectangle similarity larger than 0.9 and the number of the pixel length and the number of the area in the predetermined range by utilizing the characteristics that the two-dimensional code of the same product is rectangular in appearance characteristic, the number of the pixels with the length and the width and the pixel area of the two-dimensional code are unchanged, and judging the area as a target area.
Further, the method includes the steps of screening out the Area with the rectangle similarity larger than 0.9 and the number of pixel lengths and widths and the number of areas of the Area within a preset range, judging the Area as a target Area, and setting the preset Area value as Area, screening out the Area with the rectangle similarity larger than 0.9 and the Area larger than 0.9 x Area smaller than 1.1 x Area, and judging the Area as the target Area.
Specifically, in this embodiment, the ROI area is screened for the pixel area size, the minimum circumscribed rectangle length and width, and the rectangle similarity characteristics, and finally the target area is selected as the two-dimensional code area. Fig. 5 is a schematic diagram of the target area screened according to the present embodiment.
The target area screening principle is that the two-dimensional code label of the same product has certain size and shape unchanged characteristics because the target of the code scanning test is a two-dimensional code. The ROI Area in the right graph includes a rectangular two-dimensional code Area and other areas (the gray level of the other areas is similar to the gray level of the two-dimensional code Area), the outline characteristic that the two-dimensional code is rectangular, the number length of pixels with the length and the width and the pixel Area of the two-dimensional code are unchanged, the similarity of the rectangular is larger than 0.9 (the maximum value is 1), the number of the pixels with the length and the width and the number of the Area are within a certain range, for example, the Area set value is Area, and the Area is judged to be the two-dimensional code Area as long as the Area with the Area larger than 0.9 x Area smaller than 1.1 x Area is selected in the Area.
S103, intercepting a target image of the target area, performing median filtering noise reduction processing, and performing maximum inter-class variance method OTSU on the target image, solving an optimal segmentation threshold K of two-dimensional code information and a white background, and segmenting a black information area and a white background area;
Specifically, in this embodiment, an image target_image of a target area (as shown in fig. 6, which is an image schematic diagram of the target area) is captured, median filtering and noise reduction are performed, and then the maximum inter-class variance method OTSU is performed on the image target_image, so as to obtain an optimal segmentation threshold K of two-dimensional code information and a white background, and a black information area and a white background area are segmented. Fig. 7 is a schematic diagram of the present embodiment, in which a black information area and a white background area are separated, wherein a red area is a black information area, and a green area is a white background area.
After the final area of the two-dimensional code is selected through screening, the image information in the area is processed, and the black printed area and the white area are separated by utilizing the OTSU algorithm because the information of the two-dimensional code comprises white background and black printed information.
S104, assigning a gray value of a pixel of the black information area to 0, assigning a gray value of a pixel of the background area to 255, and enhancing the contrast of the two-dimensional code area;
Specifically, in this embodiment, the gray value of the pixel in the black information area is assigned to 0, and the gray value of the pixel in the background area is assigned to 255, so as to enhance the contrast ratio of the two-dimensional code. Fig. 8 is a two-dimensional code image before enhancement, and fig. 9 is a two-dimensional code image after enhancement.
S105, extracting two-dimensional code information by using the enhanced image of the two-dimensional code area.
According to the embodiment, the two-dimensional code decoding program is carried by the code scanning camera, the enhanced two-dimensional code image is transmitted to the decoding program, so that the decoding efficiency can be improved, and the decoding success rate can be improved.
Furthermore, the present example provides a calculation process of the algorithm as follows:
* OTSU algorithm extracts bright ROI region
binary_threshold(Image, ROI_Region, 'max_separability', 'light', UsedThreshold)
* The expansion corrosion algorithm fills the rugged edge part of the cut and segmented region
closing_rectangle1 (ROI_Region, RegionClosing, MaskWidth, MaskHeight,)
opening_rectangle1(RegionClosing, RegionOpening, MaskWidth, MaskHeight)
connection(RegionOpening, ConnectedRegions)
* Filling algorithm fills gaps inside region
fill_up(ConnectedRegions, RegionFillUp)
* Screening algorithm screens target area (two-dimension code area)
select_shape(RegionFillUp, SelectedRegions, ['area', 'rectangularity', 'width', 'height'], 'and', [Area*0.9, 0.9, width*0.9, height*0.9], [Area *1.1, 1.0, Width*1.1, Height*1.1])
* Extracting an image of a target region
reduce_domain(Image, SelectedRegions, target_image)
* Black region of OTSU extraction target image
binary_threshold(target_image, Black_Region, 'max_separability', 'dark', UsedThreshold)
* Assigning each pixel gray value of the black region to 0
paint_region(Black_Region, target_image, ImageResult, 0, 'fill')
* Dividing the white background area and assigning each pixel gray value of the area to 255
difference(SelectedRegions, Black_Region, White_Region)
paint_region(White _Region, ImageResult, ImageResult, 255, 'fill')。
In summary, in this embodiment, an image is obtained by photographing based on a code scanning gun, an ROI area is segmented and is preprocessed, the ROI area is screened for pixel area size, minimum circumscribed rectangle length and width and rectangle similarity characteristics, a target area is determined, the target area is a two-dimensional code area, a target image target_image of the target area is intercepted, after median filtering noise reduction processing is performed, a black information area and a white background area are segmented, the gray value of the black information area pixel is assigned to 0, the gray value of the background area pixel is assigned to 255, the contrast of the two-dimensional code area is enhanced, and the two-dimensional code information is extracted by using the enhanced two-dimensional code area image. Compared with the prior art, the method has the advantages that the two-dimensional code area of the product is screened out by dividing the ROI area, the contrast is enhanced by carrying out binarization processing on the two-dimensional code information and the white background, and the problems of unsuccessful identification caused by uneven illumination and fuzzy images are solved.
In addition, a second aspect of the present embodiment provides a two-dimensional code image processing apparatus, the apparatus including a collection and segmentation module, a screening module, a first processing module, a second processing module, and an extraction module, wherein:
the acquisition and segmentation module is used for acquiring images based on photographing of the code scanning gun, segmenting out the ROI region and preprocessing the ROI region;
the screening module is used for screening the pixel area size, the minimum circumscribed rectangle length and width and the rectangle similarity characteristics of the ROI area respectively to determine a target area, wherein the target area is a two-dimensional code area;
the first processing module is used for intercepting a target image target_image of the target area, carrying out median filtering noise reduction processing, carrying out a maximum inter-class variance method OTSU on the target image target_image, solving an optimal segmentation threshold K of two-dimensional code information and a white background, and segmenting a black information area and a white background area;
The second processing module is used for assigning the gray value of the pixel of the black information area to 0, assigning the gray value of the pixel of the background area to 255 and enhancing the contrast of the two-dimensional code area;
and the extraction module is used for extracting the two-dimensional code information by utilizing the enhanced image of the two-dimensional code area.
Further, the acquisition and segmentation module is further configured to:
carrying out a maximum inter-class variance method OTSU on the image, and dividing an ROI region;
performing expansion operation and erosion operation on the ROI region to enable the edge of the ROI region to be flat and smooth, and performing filling operation on all the ROI region to fill gaps inside the region.
Further, the screening module is further configured to:
And screening out the area with the rectangle similarity larger than 0.9 and the number of the pixel length and the number of the area in the predetermined range by utilizing the characteristics that the two-dimensional code of the same product is rectangular in appearance characteristic, the number of the pixels with the length and the width and the pixel area of the two-dimensional code are unchanged, and judging the area as a target area.
Further, the screening out the area with the rectangle similarity greater than 0.9 and the number of the pixel length and the width and the number of the area within the predetermined range is determined as the target area, including:
and screening out the Area with the rectangle similarity larger than 0.9 and the Area larger than 0.9 and smaller than 1.1, and judging the Area as the target Area.
In addition, the embodiment of the application also discloses an electronic device, which comprises one or more processors and a memory, wherein the memory is used for storing one or more computer programs, and the electronic device is characterized in that the computer programs are configured to be executed by the one or more processors, and the programs comprise the steps of the two-dimensional code image processing method for the display module according to the first aspect.
In addition, the embodiment of the application also provides a storage medium, wherein the storage medium stores a computer program, and the program is loaded and executed by a processor to realize the steps of the display module two-dimensional code image processing method according to the first aspect.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The elements described as separate components may or may not be physically separate, and as such, those skilled in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, where the elements and steps of the examples are generally described functionally in the foregoing description of the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a grid device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (10)

1. The method for processing the two-dimensional code image of the display module is characterized by comprising the following steps:
The method comprises the steps of shooting based on a code scanning gun to obtain an image, segmenting an ROI region and preprocessing the ROI region;
the method comprises the steps of screening pixel area size, minimum circumscribed rectangle length and width and rectangle similarity characteristics of an ROI region respectively to determine a target region, wherein the target region is a two-dimensional code region;
Intercepting a target image of the target area, performing median filtering noise reduction treatment, and performing maximum inter-class variance method OTSU on the target image, solving an optimal segmentation threshold K of two-dimensional code information and a white background, and segmenting a black information area and a white background area;
The gray value of the pixel in the black information area is assigned to 0, the gray value of the pixel in the background area is assigned to 255, and the contrast of the two-dimensional code area is enhanced;
and extracting the two-dimensional code information by utilizing the enhanced image of the two-dimensional code area.
2. The method for processing the two-dimensional code image of the display module according to claim 1, wherein the steps of dividing the ROI area and preprocessing the ROI area include:
carrying out a maximum inter-class variance method OTSU on the image, and dividing an ROI region;
performing expansion operation and erosion operation on the ROI region to enable the edge of the ROI region to be flat and smooth, and performing filling operation on all the ROI region to fill gaps inside the region.
3. The method of claim 2, wherein the filtering the ROI area for pixel area size, minimum circumscribed rectangle length and width, and rectangle similarity characteristics, respectively, to determine the target area comprises:
And screening out the area with the rectangle similarity larger than 0.9 and the number of the pixel length and the number of the area in the predetermined range by utilizing the characteristics that the two-dimensional code of the same product is rectangular in appearance characteristic, the number of the pixels with the length and the width and the pixel area of the two-dimensional code are unchanged, and judging the area as a target area.
4. The method for processing a two-dimensional code image of a display module according to claim 3, wherein the selecting the region having a rectangular similarity greater than 0.9 and a number of pixel lengths and widths and a number of areas within a predetermined range, the determining the region as the target region, comprises:
and screening out the Area with the rectangle similarity larger than 0.9 and the Area larger than 0.9 and smaller than 1.1, and judging the Area as the target Area.
5. The two-dimensional code image processing device is characterized by comprising a collection and segmentation module, a screening module, a first processing module, a second processing module and an extraction module, wherein:
the acquisition and segmentation module is used for acquiring images based on photographing of the code scanning gun, segmenting out the ROI region and preprocessing the ROI region;
the screening module is used for screening the pixel area size, the minimum circumscribed rectangle length and width and the rectangle similarity characteristics of the ROI area respectively to determine a target area, wherein the target area is a two-dimensional code area;
the first processing module is used for intercepting a target image target_image of the target area, carrying out median filtering noise reduction processing, carrying out a maximum inter-class variance method OTSU on the target image target_image, solving an optimal segmentation threshold K of two-dimensional code information and a white background, and segmenting a black information area and a white background area;
The second processing module is used for assigning the gray value of the pixel of the black information area to 0, assigning the gray value of the pixel of the background area to 255 and enhancing the contrast of the two-dimensional code area;
and the extraction module is used for extracting the two-dimensional code information by utilizing the enhanced image of the two-dimensional code area.
6. The two-dimensional code image processing apparatus according to claim 5, wherein the acquisition and segmentation module is further configured to:
carrying out a maximum inter-class variance method OTSU on the image, and dividing an ROI region;
performing expansion operation and erosion operation on the ROI region to enable the edge of the ROI region to be flat and smooth, and performing filling operation on all the ROI region to fill gaps inside the region.
7. The two-dimensional code image processing apparatus of claim 6, wherein the screening module is further configured to:
And screening out the area with the rectangle similarity larger than 0.9 and the number of the pixel length and the number of the area in the predetermined range by utilizing the characteristics that the two-dimensional code of the same product is rectangular in appearance characteristic, the number of the pixels with the length and the width and the pixel area of the two-dimensional code are unchanged, and judging the area as a target area.
8. The two-dimensional code image processing apparatus according to claim 7, wherein the area, in which the degree of similarity of the screening rectangle is greater than 0.9 and the number of pixel lengths and widths and the number of areas of the area are within a predetermined range, is determined as the target area, comprises:
and screening out the Area with the rectangle similarity larger than 0.9 and the Area larger than 0.9 and smaller than 1.1, and judging the Area as the target Area.
9. An electronic device comprising one or more processors, a memory for storing one or more computer programs, characterized in that the computer programs are configured to be executed by the one or more processors, the programs comprising method steps for performing the display module two-dimensional code image processing method according to any one of claims 1-4.
10. A storage medium storing a computer program loaded and executed by a processor to implement the display module two-dimensional code image processing method steps of any one of claims 1-4.
CN202411784059.4A 2024-12-06 2024-12-06 A display module two-dimensional code image processing method and device Pending CN119721087A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411784059.4A CN119721087A (en) 2024-12-06 2024-12-06 A display module two-dimensional code image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411784059.4A CN119721087A (en) 2024-12-06 2024-12-06 A display module two-dimensional code image processing method and device

Publications (1)

Publication Number Publication Date
CN119721087A true CN119721087A (en) 2025-03-28

Family

ID=95099211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411784059.4A Pending CN119721087A (en) 2024-12-06 2024-12-06 A display module two-dimensional code image processing method and device

Country Status (1)

Country Link
CN (1) CN119721087A (en)

Similar Documents

Publication Publication Date Title
Azam et al. Automatic license plate detection in hazardous condition
Gllavata et al. A robust algorithm for text detection in images
US8335402B1 (en) Method and system for detecting and recognizing text in images
Yang et al. An adaptive logical method for binarization of degraded document images
EP1693782B1 (en) Method for facial features detection
CN111680690B (en) Character recognition method and device
CN118275449B (en) Copper strip surface defect detection method, device and equipment
US20070253040A1 (en) Color scanning to enhance bitonal image
CN108830857B (en) An Adaptive Binarization Segmentation Method for Chinese Inscriptions on Inscriptions
CN109815762B (en) Method and storage medium for remotely identifying two-dimensional code
CN113033558B (en) A text detection method, device and storage medium for natural scenes
EP2034436A1 (en) Method for non-photorealistic rendering
CN113469921B (en) Image defect repairing method, system, computer device and storage medium
CN112508024A (en) Intelligent identification method for embossed seal font of electrical nameplate of transformer
CN117745552A (en) Self-adaptive image enhancement method and device and electronic equipment
CN117437248A (en) A disease area segmentation method for blueberry quality detection
US20030169946A1 (en) Unsupervised scene segmentation
CN115984863A (en) Image processing method, device, equipment and storage medium
CN112634240A (en) Thyroid ultrasound image interference interface automatic identification and removal method based on threshold segmentation
CN110930358A (en) Solar panel image processing method based on self-adaptive algorithm
CN119721087A (en) A display module two-dimensional code image processing method and device
CN117765287A (en) Image target extraction method combining LWR and density clustering
CN110633705A (en) Low-illumination imaging license plate recognition method and device
CN114913099A (en) Method and system for processing video file
JPH10285399A (en) Image binarization method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination