Hand bag bar code printing position detection method and device and storage medium

By analyzing the barcode area of ​​the base point A and Base point B in the barcode position detection, the detection data reliability caused by the slight deformation of the barcode attachment items is insufficient, and a more accurate barcode position detection is achieved.

CN119378584AActive Publication Date: 2025-01-28CHUANGSAIJIE TECH CO LTD

Patent Information

Application Number
CN202411381706.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-28
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

The existing barcode position detection technology cannot accurately monitor the barcode position when the edges of the barcode attached items appear slightly deformed, resulting in insufficient reliability of the detection data.

Method used

By obtaining the base points A and base point B in the position detection diagram, analyze and determine the barcode area, calculate the difference between the characteristics of the barcode and the standard feature value to determine whether the barcode area is offset.

Benefits of technology

Improve the accuracy and reliability of the barcode position detection, and accurately determine whether the barcode area is offset when the barcode attachment is slightly deformed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378584A_ABST
    Figure CN119378584A_ABST
Patent Text Reader

Abstract

The invention discloses a hand bag bar code printing position detection method and device and a storage medium, and relates to the technical field of printing position detection, and the method comprises the following steps: obtaining a tiled image of a hand bag; analyzing all the tiled images by using a hand bag correction method, and acquiring a base point A and a base point B in the position detection image based on design data of the hand bag; acquiring a barcode feature value corresponding to the barcode region based on the base point A and the base point B, acquiring a standard feature value of the barcode region based on the design data, and judging whether the barcode region deviates based on the standard feature value and the barcode feature value; the method is used for solving the problem that the existing position detection technology cannot accurately monitor the position of the bar code under the condition that the bar code attachment is deformed, and the reliability of the detection data is insufficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of printing position detection, in particular to a method, a device and a storage medium for detecting the printing position of a barcode on a handbag. Background Art

[0002] A barcode is a graphic identifier that expresses a set of information by arranging multiple black bars and blanks of varying widths according to certain coding rules. Common barcodes are parallel lines of black and white bars with very different reflectivity. Barcodes can indicate a lot of information such as the country of origin, manufacturer, product name, production date, book classification number, mail origin and destination, category, date, etc., and are therefore widely used in many fields such as commodity circulation, book management, postal management, and banking systems.

[0003] In the existing barcode position detection technology, the barcode position is usually detected by the position of the barcode relative to the object to which the barcode is attached. However, when the edge of the object to which the barcode is attached is slightly deformed, the barcode may also be deformed, resulting in the failure of the barcode. For example, in a patent application with publication number CN104268499A, a barcode mark detection method for a barcoded commodity is disclosed. The method is to take a photo of the barcoded commodity to obtain a barcoded commodity image; perform gradient transformation on the barcoded commodity image to obtain a gradient image; locate the barcode position in the barcoded commodity image; perform ostu dynamic threshold segmentation on the barcode area image to form a binary image; and perform corrosion operation on the obtained binary image to obtain a mark shape. When the method locates the barcode position in the barcode commodity image, the object to which the barcode is attached may have a slight edge deformation, resulting in the failure of the barcode. The existing position detection technology has the problem of insufficient data reliability in barcode position detection when the barcode attachment is deformed. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the prior art to at least a certain extent, by obtaining base point A and base point B in a position detection map, using base point A and base point B to analyze the position detection map, and obtaining a barcode area in the position detection map based on the analysis result, so as to solve the problem that the existing position detection technology cannot accurately monitor the barcode position when the barcode attachment is deformed, and the reliability of the detection data is insufficient.

[0005] To achieve the above objectives, in a first aspect, the present application provides a method for detecting a barcode printing position on a handbag, comprising the following steps:

[0006] When the barcode printing position detection is performed, tile images of all handbags are obtained based on the detection data and recorded as tile image 1 to tile image p respectively;

[0007] All tile images are analyzed using a handbag correction method, and a position detection map and a position error image corresponding to each tile image are obtained based on the analysis results;

[0008] Based on the design data of the handbag, a base point A and a base point B in the position detection map are obtained, the position detection map is analyzed using the base point A and the base point B, and a barcode area in the position detection map is obtained based on the analysis result;

[0009] The barcode feature value corresponding to the barcode area is obtained based on the base point A and the base point B, the standard feature value of the barcode area is obtained based on the design data, and whether the barcode area is offset is determined based on the standard feature value and the barcode feature value.

[0010] Further, all tiled images are analyzed using the handbag correction method, and based on the analysis results, a position detection map and a position error image corresponding to each tiled image are obtained, including the following sub-steps:

[0011] Perform grayscale processing on any tiled image and convert the tiled image into a grayscale image;

[0012] Binarize the grayscale image to obtain a binary image;

[0013] Get the image with pixel value 0 from the binary image and set it as the outline of the handbag;

[0014] Establish a plane rectangular coordinate system and make the lower left corner of the handbag outline coincide with the origin of the plane rectangular coordinate system;

[0015] When the outline of the handbag coincides with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, the tiled image corresponding to the outline of the handbag is marked as a position detection image;

[0016] When the handbag outline does not coincide with the horizontal axis or the vertical axis of the plane rectangular coordinate system, the handbag outline is rotated with the coordinate origin as the center until the handbag outline coincides with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, and the tiled image corresponding to the rotated handbag outline is marked as a position detection image;

[0017] If the handbag outline cannot be rotated so that the handbag outline coincides with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, the tiled image corresponding to the handbag outline is marked as a position error image.

[0018] Furthermore, the binarization process includes: setting a binarization threshold, obtaining pixel values ​​of all pixels in the grayscale image, and taking the average value of all pixel values ​​as the binarization threshold;

[0019] The pixels in the grayscale image whose grayscale values ​​are higher than or equal to the binarization threshold are assigned a value of 255, and the pixels in the grayscale image whose grayscale values ​​are lower than the binarization threshold are assigned a value of 0.

[0020] Further, obtaining base point A and base point B in the position detection map based on the design data of the handbag, analyzing the position detection map using base point A and base point B, and obtaining the barcode area in the position detection map based on the analysis result includes the following sub-steps:

[0021] Acquire design data of the handbag, wherein the design data includes a position of a design point A, a position of a design point B, a printed barcode, and a barcode printing position in the handbag;

[0022] Establish a rectangular coordinate system of the detection plane with the lower left corner of the position detection diagram as the center;

[0023] The position of the design point A and the position of the design point B are obtained from the design data, and the position of the design point A and the position of the design point B are marked as base point A and base point B on the position detection diagram to obtain the coordinates of the base point A (xA, yA) and the coordinates of the base point B (xB, yB);

[0024] Obtain the plane distance between design point A and design point B from the design data and set it as the standard distance;

[0025] Obtain the plane distance between base point A and base point B, set it as the base point distance, and when the base point distance is not equal to the standard distance, set the position detection image as the position error image;

[0026] When the base point distance is equal to the standard distance, the barcode pixels are acquired from the position detection image to obtain the barcode area.

[0027] Furthermore, the barcode pixel acquisition includes: grayscale processing and binarization of the position detection image;

[0028] For any pixel point m with a pixel value of 0 in the binary image, the pixels in the eight neighborhoods of the pixel point m are recorded as neighboring pixel points 1 to 8, and the grayscale values ​​of the neighboring pixel points 1 to 8 are obtained respectively. When the grayscale value of any neighboring pixel point is the same as the grayscale value of the pixel point m, the neighboring pixel point and the pixel point m are recorded as the undetermined barcode pixel points;

[0029] Perform grayscale processing and binarization processing on the barcode pattern in the design data, extract all pixel points with a pixel value of 0, and set them as the barcode template;

[0030] Use SSDA method to perform template matching on barcode templates among all the pixels of pending barcodes;

[0031] Set the successfully matched pending barcode pixel point as the barcode pixel point.

[0032] Further, obtaining a barcode feature value corresponding to the barcode area based on base point A and base point B, obtaining a standard feature value of the barcode area based on the design data, and judging whether the barcode area is offset based on the standard feature value and the barcode feature value include the following sub-steps:

[0033] Mark the coordinates of the barcode area to obtain the coordinates of the four corner points of the barcode area, which are set as corner point 1 (x1, y1), corner point 2 (x2, y2), corner point 3 (x3, y3) and corner point 4 (x4, y4). Corner point 1 and corner point 2 are the upper left corner and upper right corner of the barcode area, respectively, and corner point 3 and corner point 4 are the lower left corner and lower right corner of the barcode area, respectively.

[0034] Connect base point A with corner point 1 and corner point 2, obtain the angle value of the connecting line, and set it as the angle value of base point A;

[0035] Connect base point B with corner points 3 and 4, obtain the angle value of the connecting line, and set it as the angle value of base point B;

[0036] Substitute the corner point coordinates, base point coordinates, base point A angle value and base point B angle value into the barcode characteristic value formula The barcode feature value is calculated in, where K is the barcode feature value, RA is the angle value of base point A, and RB is the angle value of base point B;

[0037] Get the standard feature value. When the barcode feature value is equal to the standard feature value, it is determined that the barcode area has no offset.

[0038] When the barcode feature value is not equal to the standard feature value, the barcode area offset is determined.

[0039] Furthermore, obtaining the standard characteristic value includes the following sub-steps:

[0040] A coordinate system is established for the handbag in the design data, and the coordinates of the design point A and the design point B are obtained to obtain the design point A (aA, bA) and the design point B (aB, bB);

[0041] Mark the coordinates of the printed barcode to obtain the coordinates of the four corner points of the printed barcode, which are set as design point 1 (a1, b1), design point 2 (a2, b2), design point 3 (a3, b3) and design point 4 (a4, b4);

[0042] Connect design point A with design point 1 and design point 2, obtain the angle value of the connecting line, and set it as the angle value of design point A;

[0043] Connect design point B with design point 3 and design point 4, obtain the angle value of the connecting line, and set it as the angle value of design point B;

[0044] Substitute the design point coordinates, the angle value of design point A and the angle value of design point B into the standard eigenvalue formula The standard eigenvalue is calculated in , where K0 is the standard eigenvalue, RA' is the angle value of design point A, and RB' is the angle value of design point B.

[0045] In a second aspect, an electronic device includes a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method as described in any one of the above claims are executed.

[0046] In a third aspect, a storage medium stores a computer program thereon, wherein when the computer program is executed by a processor, the steps in the method as described in any one of the above claims are executed.

[0047] Beneficial effects of the present invention: The present invention first collects handbag tile images, uses the handbag correction method to analyze all tile images, and obtains the position detection map and the position error image corresponding to each tile image based on the analysis result; the advantage is that the handbag correction method is used to analyze the collected handbag tile images, which can not only correct the normal tile images, ensure the correct direction of the position detection map, and provide accurate processing data for subsequent processing; it can also eliminate the handbag tile images due to damage or folding, thereby improving the acquisition speed of the position detection map;

[0048] The present invention also obtains base point A and base point B in the position detection map through the design data of the handbag, uses base point A and base point B to analyze the position detection map, and obtains the barcode area in the position detection map based on the analysis result. The advantage is that the positions of base point A and base point B on the position detection map are relative. By judging the distance between base point A and base point B, it is possible to quickly judge whether the position detection map is deformed, thereby improving the accuracy of subsequent acquisition of the barcode area.

[0049] The present invention obtains the barcode feature value corresponding to the barcode area based on base point A and base point B, obtains the standard feature value of the barcode area based on design data, and judges whether the barcode area is offset based on the standard feature value and the barcode feature value. The advantage of the present invention is that the barcode feature value of a normal barcode based on base point A and base point B is fixed, and the standard barcode feature value and the barcode feature value are used to judge whether the barcode area is offset, thereby improving the rationality and accuracy of barcode position detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a flow chart of the steps of the present invention;

[0051] Figure 2 It is a schematic diagram of design data of the present invention;

[0052] Figure 3 It is a schematic diagram of base points and corner points of the present invention;

[0053] Figure 4 It is a schematic diagram of the design points and corner points of the present invention;

[0054] Figure 5 A schematic diagram of the structure of an electronic device. DETAILED DESCRIPTION

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

[0056] Example 1

[0057] See also Figure 1 As shown, the present application provides a method for detecting the barcode printing position of a handbag, comprising the following steps:

[0058] Step S1, when performing barcode printing position detection, obtain tile images of all handbags based on detection data, and record them as tile image 1 to tile image p respectively;

[0059] Step S2, using the handbag correction method to analyze all tile images, and based on the analysis results, obtaining a position detection map and a position error image corresponding to each tile image;

[0060] Step S2 includes the following sub-steps:

[0061] Step S201, grayscale processing is performed on any tile image to convert the tile image into a grayscale image;

[0062] Step S202, binarizing the grayscale image to obtain a binary image;

[0063] Step S202 includes: step S2021, setting a binarization threshold, obtaining pixel values ​​of all pixel points in the grayscale image, and taking the average value of all pixel values ​​as the binarization threshold; in the specific implementation process, when the tiled image is obtained, there is a large color difference between the placement plane of the handbag and the handbag, so taking the average value of the pixel values ​​as the binarization threshold can directly distinguish the handbag from the placement plane, which is convenient for subsequent contour extraction;

[0064] Step S2022, assigning a value of 255 to the pixel points in the gray value image whose gray value is greater than or equal to the binarization threshold, and assigning a value of 0 to the pixel points in the gray value image whose gray value is less than the binarization threshold; in the specific implementation process, after the image is binarized, the entire image presents an obvious black and white effect, making the image very simple and easy to analyze and process.

[0065] Step S203, obtaining an image with a pixel value of 0 from the binary image and setting it as the outline of the handbag;

[0066] Step S204, establishing a plane rectangular coordinate system, aligning the lower left corner of the handbag outline with the origin of the plane rectangular coordinate system;

[0067] Step S205, when the outline of the handbag coincides with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, the tiled image corresponding to the outline of the handbag is marked as a position detection image; in the specific implementation process, the handbag is a quadrilateral with two handles, and only the bottom edge and the side edge of the handbag can simultaneously meet the condition of coinciding with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, so the outline of the handbag can be adjusted to a required angle by establishing a plane rectangular coordinate system and rotating the outline of the handbag;

[0068] Step S206, when the handbag outline does not coincide with the horizontal axis or the vertical axis of the plane rectangular coordinate system, the handbag outline is rotated with the coordinate origin as the center until the handbag outline coincides with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, and the tiled image corresponding to the rotated handbag outline is marked as a position detection image;

[0069] Step S207, if the handbag outline cannot be rotated to make the handbag outline coincide with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, the tiled image corresponding to the handbag outline is marked as a position error image; in the specific implementation process, when the acquired tiled image is folded or missing, it will cause edge deformation, so the handbag outline cannot be rotated to make the handbag outline coincide with both the horizontal axis and the vertical axis of the plane rectangular coordinate system.

[0070] Step S3, obtaining base point A and base point B in the position detection map based on the design data of the handbag, analyzing the position detection map using base point A and base point B, and obtaining a barcode area in the position detection map based on the analysis result;

[0071] Step S3 includes the following sub-steps:

[0072] Step S301, see Figure 2As shown, the design data of the handbag is obtained, and the design data includes the position of the design point A, the position of the design point B, the printed barcode and the barcode printing position in the handbag; in the specific implementation process, the design point A is set at the midpoint of the line connecting the two handles of the handbag, and the design point B is set at the midpoint of the bottom of the handbag. The barcode printing position can be adjusted according to actual conditions. For example, the barcode printing position in this embodiment is set at the lower right corner of the handbag;

[0073] Step S302, see Figure 4 As shown, a rectangular coordinate system of the detection plane is established with the lower left corner of the position detection diagram as the center;

[0074] Step S303, obtaining the position of the design point A and the position of the design point B from the design data, marking the position of the design point A and the position of the design point B as base point A and base point B on the position detection diagram, and obtaining the coordinates of the base point A (xA, yA) and the coordinates of the base point B (xB, yB); in the specific implementation process, for example, the coordinates of the base point A obtained in a plane rectangular coordinate system are (15, 20), and the coordinates of the base point B are (15, 0);

[0075] Step S304, obtaining the plane distance between the design point A and the design point B from the design data, and setting it as the standard distance; in a specific implementation process, for example, in a design data, the plane distance between the design point A and the design point B is 20, then the obtained standard distance is 20;

[0076] Step S305, obtaining the plane distance between the base point A and the base point B, setting it as the base point distance, and when the base point distance is not equal to the standard distance, setting the position detection image as the position error image;

[0077] Step S306, when the base point distance is equal to the standard distance, the barcode pixels are acquired from the position detection image to obtain the barcode area;

[0078] Step S306 includes: step S3061, grayscale processing and binarization of the position detection image;

[0079] Step S3062, for any pixel point m in the binary image whose pixel value is 0, the pixel points in the eight neighborhoods of the pixel point m are respectively recorded as neighboring pixel points 1 to neighboring pixel points 8, and the grayscale values ​​of the neighboring pixel points 1 to neighboring pixel points 8 are respectively obtained. When the grayscale value of any neighboring pixel point is the same as the grayscale value of the pixel point m, the neighboring pixel point and the pixel point m are recorded as pending barcode pixel points; in the specific implementation process, for example, the pixel value of a pixel point m is obtained to be 23, and the pixel values ​​of the neighboring pixel points 1 to neighboring pixel points 8 of the pixel point are 10, 12, 30, 23, 33, 13, 24 and 22 respectively, among which the grayscale value of the neighboring pixel point 4 is the same as the grayscale value of the pixel point m, and the neighboring pixel point 4 and the pixel point m are recorded as pending barcode pixel points;

[0080] Step S3063, grayscale processing and binarization processing are performed on the barcode pattern in the design data, and all pixel points with a pixel value of 0 are extracted and set as the barcode template;

[0081] Step S3064, using the SSDA method to perform template matching on the barcode template among all the undetermined barcode pixels;

[0082] Step S3065, setting the successfully matched pending barcode pixel point as the barcode pixel point.

[0083] Step S4, obtaining a barcode feature value corresponding to the barcode area based on base point A and base point B, obtaining a standard feature value of the barcode area based on the design data, and determining whether the barcode area is offset based on the standard feature value and the barcode feature value;

[0084] Step S4 includes the following sub-steps:

[0085] Step S401, see Figure 3 As shown, the barcode area is marked with coordinates to obtain the coordinates of the four corner points of the barcode area, which are set as corner point 1 (x1, y1), corner point 2 (x2, y2), corner point 3 (x3, y3) and corner point 4 (x4, y4). Corner point 1 and corner point 2 are the upper left corner and upper right corner of the barcode area, respectively, and corner point 3 and corner point 4 are the lower left corner and lower right corner of the barcode area, respectively.

[0086] Step S402, connect the base point A with the corner point 1 and the corner point 2, obtain the angle value of the connecting line, and set it as the angle value of the base point A;

[0087] Step S403, connect the base point B with the corner point 3 and the corner point 4, obtain the angle value of the connection line, and set it as the angle value of the base point B; in the specific implementation process, for example, in a plane rectangular coordinate system, the coordinates of the four corner points of the barcode area are corner point 1 (22, 5), corner point 2 (27, 5), corner point 3 (22, 2) and corner point 4 (27, 2), and the angle value of the base point A is 14°, and the angle value of the base point B is 6°;

[0088] Step S404: Substitute the corner point coordinates, base point coordinates, base point A angle value and base point B angle value into the barcode feature value formula The barcode feature value is calculated in, where K is the barcode feature value, RA is the angle value of base point A, and RB is the angle value of base point B. In a specific implementation, for example, in a plane rectangular coordinate system of a position detection diagram, the coordinates of the four corner points of the barcode area are corner point 1 (22, 6), corner point 2 (27, 6), corner point 3 (22, 3) and corner point 4 (27, 3), respectively. The angle value of base point A is 14°, and the angle value of base point B is 9°, then the barcode feature value K is 2.16.

[0089] Step S405, obtaining standard characteristic values, step S405 includes the following sub-steps:

[0090] Step S4051, establish a coordinate system for the handbag in the design data, obtain the coordinates of the design point A and the design point B, and obtain the design point A (aA, bA) and the design point B (aB, bB);

[0091] Step S4052, marking the coordinates of the printed barcode, obtaining the coordinates of the four corner points of the printed barcode, and setting them as design point 1 (a1, b1), design point 2 (a2, b2), design point 3 (a3, b3) and design point 4 (a4, b4);

[0092] Step S4053, connect the design point A with the design point 1 and the design point 2, obtain the angle value of the connecting line, and set it as the angle value of the design point A;

[0093] Step S4054, connect the design point B with the design point 3 and the design point 4, obtain the angle value of the connecting line, and set it as the angle value of the design point B;

[0094] Step S4055: Substitute the design point coordinates, the angle value of design point A and the angle value of design point B into the standard eigenvalue formula The standard eigenvalue is calculated in , where K0 is the standard eigenvalue, RA' is the angle value of design point A, and RB' is the angle value of design point B. In the specific implementation process, for example, in a plane rectangular coordinate system of a design point data, the coordinates of the four design points in the barcode area are design point 1 (22, 5), design point 2 (27, 5), design point 3 (22, 2) and design point 4 (27, 2), and the angle value of design point A is 14°, and the angle value of design point B is 6°; then the standard eigenvalue K0 is 3.33.

[0095] Step S406, when the barcode characteristic value is equal to the standard characteristic value, it is determined that the barcode area has no offset; in the specific implementation process, for example, when the barcode printing position is detected once, when the barcode characteristic value K is detected to be 3.33 and the standard characteristic value K0 is 3.33, it is determined that the barcode area of ​​the handbag has no offset;

[0096] Step S407, when the barcode feature value is not equal to the standard feature value, determine the barcode area offset; in the specific implementation process, for example, during a barcode printing position detection, when the barcode feature value K is detected to be 2.16 and the standard feature value K0 is 3.33, determine the barcode area offset of the handbag.

[0097] Example 2

[0098] See also Figure 5 As shown, Figure 5The structural schematic diagram of an electronic device is illustrated, and the electronic device may include: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus. The memory stores computer-readable instructions, and the processor may call the instructions in the memory. When the computer-readable instructions are executed by the processor, the steps in a method for detecting the barcode printing position of a handbag are executed to realize the following functions: when performing barcode printing position detection, tile images of all handbags are obtained based on the detection data, and are recorded as tile images 1 to tile images p respectively; all tile images are analyzed using a handbag correction method, and a position detection map and a position error image corresponding to each tile image are obtained based on the analysis results; base points A and B in the position detection map are obtained based on the design data of the handbag, the position detection map is analyzed using base points A and B, and a barcode area in the position detection map is obtained based on the analysis results; a barcode feature value corresponding to the barcode area is obtained based on base points A and B, a standard feature value of the barcode area is obtained based on the design data, and whether the barcode area is offset is determined based on the standard feature value and the barcode feature value.

[0099] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0100] Example 3

[0101] The present application also provides a computer-readable storage medium, and the present application provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method for detecting the barcode printing position of a handbag are executed. Through the above-mentioned technical solution, when the computer program is executed by the processor, the method in any optional implementation of the above-mentioned embodiment is executed to realize the following functions: when the barcode printing position is detected, the tiled images of all handbags are obtained based on the detection data, and are recorded as tiled images 1 to tiled images p respectively; all tiled images are analyzed using the handbag correction method, and the position detection map and position error image corresponding to each tiled image are obtained based on the analysis results; the base point A and the base point B in the position detection map are obtained based on the design data of the handbag, the position detection map is analyzed using the base point A and the base point B, and the barcode area in the position detection map is obtained based on the analysis results; the barcode feature value corresponding to the barcode area is obtained based on the base point A and the base point B, the standard feature value of the barcode area is obtained based on the design data, and the barcode area is judged whether it is offset based on the standard feature value and the barcode feature value.

[0102] Through the description of the above implementation methods, the embodiments of the present invention can be provided as methods, systems or computer program products. Based on such an understanding, the above technical solutions can be essentially or partly contributed to the prior art in the form of software products, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and include several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0103] In the embodiments provided in the present application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of systems, modules and units can be electrical, mechanical or other forms.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for detecting the barcode printing position of a handbag, characterized in that: The steps include: When the barcode printing position detection is performed, tile images of all handbags are obtained based on the detection data and recorded as tile image 1 to tile image p respectively; All tile images are analyzed using a handbag correction method, and a position detection map and a position error image corresponding to each tile image are obtained based on the analysis results; Based on the design data of the handbag, a base point A and a base point B in the position detection map are obtained, the position detection map is analyzed using the base point A and the base point B, and a barcode area in the position detection map is obtained based on the analysis result; The barcode feature value corresponding to the barcode area is obtained based on the base point A and the base point B, the standard feature value of the barcode area is obtained based on the design data, and whether the barcode area is offset is determined based on the standard feature value and the barcode feature value.

2. A method for detecting the barcode printing position of a handbag according to claim 1, characterized in that: Using the handbag correction method to analyze all tile images, and obtaining the position detection map and position error image corresponding to each tile image based on the analysis results includes the following sub-steps: Perform grayscale processing on any tiled image and convert the tiled image into a grayscale image; Binarize the grayscale image to obtain a binary image; Get the image with pixel value 0 from the binary image and set it as the outline of the handbag; Establish a plane rectangular coordinate system and make the lower left corner of the handbag outline coincide with the origin of the plane rectangular coordinate system; When the outline of the handbag coincides with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, the tiled image corresponding to the outline of the handbag is marked as a position detection image; When the handbag outline does not coincide with the horizontal axis or the vertical axis of the plane rectangular coordinate system, the handbag outline is rotated with the coordinate origin as the center until the handbag outline coincides with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, and the tiled image corresponding to the rotated handbag outline is marked as a position detection image; If the handbag outline cannot be rotated so that the handbag outline coincides with both the horizontal axis and the vertical axis of the plane rectangular coordinate system, the tiled image corresponding to the handbag outline is marked as a position error image.

3. A method for detecting the barcode printing position of a handbag according to claim 2, characterized in that: The binarization process includes: setting a binarization threshold, obtaining pixel values ​​of all pixels in the grayscale image, and taking the average value of all pixel values ​​as the binarization threshold; The pixels in the grayscale image whose grayscale values ​​are higher than or equal to the binarization threshold are assigned a value of 255, and the pixels in the grayscale image whose grayscale values ​​are lower than the binarization threshold are assigned a value of 0.

4. A method for detecting the barcode printing position of a handbag according to claim 3, characterized in that: Acquiring base point A and base point B in the position detection map based on the design data of the handbag, analyzing the position detection map using base point A and base point B, and acquiring the barcode area in the position detection map based on the analysis result includes the following sub-steps: Acquire design data of the handbag, wherein the design data includes a position of a design point A, a position of a design point B, a printed barcode, and a barcode printing position in the handbag; Establish a rectangular coordinate system of the detection plane with the lower left corner of the position detection diagram as the center; The position of the design point A and the position of the design point B are obtained from the design data, and the position of the design point A and the position of the design point B are marked as base point A and base point B on the position detection diagram to obtain the coordinates of the base point A (xA, yA) and the coordinates of the base point B (xB, yB); Obtain the plane distance between design point A and design point B from the design data and set it as the standard distance; Obtain the plane distance between base point A and base point B, set it as the base point distance, and when the base point distance is not equal to the standard distance, set the position detection image as the position error image; When the base point distance is equal to the standard distance, the barcode pixels are acquired from the position detection image to obtain the barcode area.

5. A method for detecting the barcode printing position of a handbag according to claim 4, characterized in that: The barcode pixel acquisition includes: grayscale processing and binarization of the position detection image; For any pixel point m with a pixel value of 0 in the binary image, the pixels in the eight neighborhoods of the pixel point m are recorded as neighboring pixel points 1 to 8, and the grayscale values ​​of the neighboring pixel points 1 to 8 are obtained respectively. When the grayscale value of any neighboring pixel point is the same as the grayscale value of the pixel point m, the neighboring pixel point and the pixel point m are recorded as the undetermined barcode pixel points; Perform grayscale processing and binarization processing on the barcode pattern in the design data, extract all pixel points with a pixel value of 0, and set them as the barcode template; Use SSDA method to perform template matching on barcode templates among all the pixels of pending barcodes; Set the successfully matched pending barcode pixel point as the barcode pixel point.

6. A method for detecting the barcode printing position of a handbag according to claim 5, characterized in that: Obtaining a barcode feature value corresponding to the barcode area based on base point A and base point B, obtaining a standard feature value of the barcode area based on design data, and determining whether the barcode area is offset based on the standard feature value and the barcode feature value include the following sub-steps: Mark the coordinates of the barcode area to obtain the coordinates of the four corner points of the barcode area, which are set as corner point 1 (x1, y1), corner point 2 (x2, y2), corner point 3 (x3, y3) and corner point 4 (x4, y4). Corner point 1 and corner point 2 are the upper left corner and upper right corner of the barcode area, respectively, and corner point 3 and corner point 4 are the lower left corner and lower right corner of the barcode area, respectively. Connect base point A with corner point 1 and corner point 2, obtain the angle value of the connecting line, and set it as the angle value of base point A; Connect base point B with corner points 3 and 4, obtain the angle value of the connecting line, and set it as the angle value of base point B; Substitute the corner point coordinates, base point coordinates, base point A angle value and base point B angle value into the barcode characteristic value formula The barcode feature value is calculated in, where K is the barcode feature value, RA is the angle value of base point A, and RB is the angle value of base point B; Get the standard feature value. When the barcode feature value is equal to the standard feature value, it is determined that the barcode area has no offset. When the barcode feature value is not equal to the standard feature value, the barcode area offset is determined.

7. A method for detecting the barcode printing position of a handbag according to claim 6, characterized in that: Obtaining standard eigenvalues ​​includes the following sub-steps: A coordinate system is established for the handbag in the design data, and the coordinates of the design point A and the design point B are obtained to obtain the design point A (aA, bA) and the design point B (aB, bB); Mark the coordinates of the printed barcode to obtain the coordinates of the four corner points of the printed barcode, which are set as design point 1 (a1, b1), design point 2 (a2, b2), design point 3 (a3, b3) and design point 4 (a4, b4); Connect design point A with design point 1 and design point 2, obtain the angle value of the connecting line, and set it as the angle value of design point A; Connect design point B with design point 3 and design point 4, obtain the angle value of the connecting line, and set it as the angle value of design point B; Substitute the design point coordinates, the angle value of design point A and the angle value of design point B into the standard eigenvalue formula The standard eigenvalue is calculated in , where K0 is the standard eigenvalue, RA' is the angle value of design point A, and RB' is the angle value of design point B.

8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 7 are executed.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are executed.

Citation Information

Patent Citations

  • Method for detecting barcode tags of commodities with barcodes

    CN104268499A

  • Graph identification code identification method and device, storage medium and electronic equipment

    CN111428707A

  • Trademark label detection method, trademark label detection model, trademark label detection device, equipment and storage medium

    CN111783653A

  • Automatic acquisition and identification method and device for cigarette 32-bit bar code

    CN112836541A

  • Normalization detection method for packaging character images on assembly line

    CN115511769A

Cited By

  • Intelligent identification and verification method and system for two-dimensional code production labeling position

    CN120146076A