An image recognition method based on product label information

An image recognition method combining contrast processing and template creation with affine transformation solves the problem of automated recognition of product label information at any angle, improving recognition efficiency and accuracy while reducing reliance on manual data entry.

CN117079290BActive Publication Date: 2025-11-18BEIJING AEROSPACE PROPULSION INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310920691.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2025-11-18
Estimated Expiration
2043-07-25

AI Technical Summary

Technical Problem

Existing technologies are not applicable enough for product label information recognition. They cannot accurately identify characters from any shooting angle, and manual data entry is inefficient and prone to errors.

Method used

An image recognition method based on product label information is adopted, which combines contrast processing, template creation, geometric matching and affine transformation with machine vision recognition technology to achieve automated recognition of product label information.

Benefits of technology

It enables accurate identification of product label information from any shooting angle, improving identification efficiency and accuracy, and reducing reliance on manual data entry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117079290B_ABST
    Figure CN117079290B_ABST
Patent Text Reader

Abstract

The application relates to an image recognition method based on product label information, which comprises the following steps: acquiring label images of products of the same batch; pre-processing the label images; taking any one of the label images as a reference image, creating an attribute part corresponding to label content interested by a user as a template; matching the template to obtain a matching area of the remaining label images; locating the matching area of the label images in the remaining label images; further locating an ROI area of the label images; performing character segmentation and character recognition on information in the ROI; and performing post-processing on the characters and uploading the characters. The method is suitable for various label types, can recognize label content interested by any user, and can accurately locate and recognize product information at any shooting angle. The method realizes automatic, rapid and accurate entry of product label information, greatly improves on-site work efficiency and improves the accuracy of the entered information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition and machine vision technology, and relates to an image recognition method based on product label information. Background Technology

[0002] With the rapid development of image processing and machine vision technologies, new directions have emerged in the field of product testing. Currently, the amount of product data entry is increasing, and key information such as product part numbers requires manual copying, leading to low efficiency and a high risk of errors and omissions. Furthermore, because the data is stored on paper documents, unified and effective management of the data is impossible, hindering the efficient conduct of testing.

[0003] Patent CN 109190630.A proposes a character recognition method. This method involves acquiring an image to be recognized, binarizing it, dividing it into several single-character images, and finally inputting these single-character images into a character recognition model for identification. The proposed method can comprehensively cover common Chinese characters and shows good performance in recognizing existing ID cards. However, this method is only suitable for character recognition processes where the template is fixed and the background font size is consistent, imposing many limitations on the labels themselves and lacking universality.

[0004] Patent CN 105956590.A relates to a character recognition method and system for receipts, comprising the following steps: acquiring an image of the receipt to be recognized using a user terminal and uploading it to a server; the server includes a basic recognition library and an extended recognition library; firstly, the basic recognition library is called, and the image is stored in a specific storage area based on the recognition error rate; for images with high error rates, extended character recognition is performed. This method solves the recognition difficulties caused by uncertainties in supermarket receipt printing, and can expand the character library based on recognition accuracy, thus improving the accuracy of receipt recognition. However, it has high requirements for the shooting angle; the recognition accuracy is low for receipt images obtained from arbitrary shooting angles.

[0005] The two methods described above are applicable to different application scenarios. During the experiment, the types of product labels varied, but the shooting scenes were relatively fixed, resulting in fewer uncontrollable factors affecting image formation. Therefore, considering the characteristics of product label types and the experimental process, it is necessary to design a method suitable for image recognition of most product label information, unaffected by the uncertainty of the shooting angle during the experiment, and capable of accurately recognizing characters from any shooting angle. Summary of the Invention

[0006] The technical problem solved by this invention is to overcome the shortcomings of the prior art and propose an image recognition method based on product label information, which is applicable to the vast majority of product labels and can flexibly set templates according to user needs, thereby recognizing information of interest; in addition, by taking into account the uncertainty of the angle during the experimental shooting process, it can accurately recognize characters at any shooting angle.

[0007] The solution of the present invention is: an image recognition method based on product label information, comprising the following steps: S1, acquiring label images of products in the same batch;

[0008] S2. Perform contrast processing on the label image;

[0009] S3. Create a template: Use any tag image as a reference image. The template is a rectangular image block extracted from the reference image. The image information contained in the template is the attribute name corresponding to the tag content that the user is interested in.

[0010] S4. Match the template in the remaining label images after contrast processing, and find the regions in the remaining label images that have the same image information as the template, and record them as the matching regions.

[0011] S5. Locate the label image matching region in the remaining label images;

[0012] S6. According to the relative positional relationship between the known attribute names and the corresponding tag content, perform corresponding coordinate calculations on the vertex coordinates of the tag image matching area to obtain the vertex coordinates of the tag content and locate the ROI area of ​​the tag image.

[0013] S7. Extract the characters within the ROI region of the label image. If the characters within the ROI region are within the value range, proceed to S8; otherwise, replace with a higher resolution product label, perform contrast processing, and proceed to S4.

[0014] S8. Divide the characters within the ROI region according to the set character length, width, and character spacing;

[0015] S9. Use machine vision recognition methods to perform character recognition on the segmented characters;

[0016] S10. Upload the identified characters to the recording system in accordance with the storage format requirements to complete the image recognition of product label information.

[0017] Furthermore, the contrast processing of the label image described in S2 specifically includes:

[0018] Grayscale processing using the component method: For the three color channels R, G, and B in a true-color image, extract the component of one of the color channels and convert it to grayscale.

[0019] The grayscale transformation method is used to process the grayscale label image in the spatial domain. The grayscale value of each pixel of the image I to be processed is reduced according to the same calculation method to enhance the contrast of the image I to obtain the label image F after contrast processing.

[0020] Furthermore, the calculation method using grayscale transformation is as follows:

[0021]

[0022] Where I(i,j) is the gray value of the processed image I at pixel (i,j), F(i,j) is the gray value of the label image F after contrast processing at pixel (i,j), a is the minimum gray value in the processed image I, b is the maximum gray value in the processed image I, c is the preset minimum gray value in the label image F after contrast processing, and d is the preset maximum gray value in the label image F after contrast processing.

[0023] Furthermore, the template creation method described in S3 includes manually creating templates:

[0024] After contrast processing, use the image cropping function in LabVIEW software to manually select the area containing the attribute name corresponding to the label content that the user is interested in, and use the cropped image block as a template to save it.

[0025] The template is a portion of the tag content. If the preview information is correct, the template creation is successful; otherwise, the template will be recreated.

[0026] Furthermore, S4, which describes matching a template in the label image after contrast processing, specifically involves:

[0027] A low-difference sampling algorithm is used to perform a geometric matching process based on shape features, including the extraction and sorting of edge curves and geometric features of the template, the extraction of shape features of the image information contained in the template, and the completion of template feature learning.

[0028] The image information contained in the template is stored in a file. The template feature association mapping is performed between the product label images of this batch and the image information in the template file to obtain the matching degree. When the matching degree between a certain area of ​​the product label image of this batch and the corresponding template file exceeds the threshold, the matching is successful, and the area in the label image that is the same as the image information contained in the template has been found.

[0029] Furthermore, S5, locating the label image matching region in the remaining label images, specifically involves:

[0030] Based on the length and width of the matched template, the size of the rectangular image block represented by the template is obtained;

[0031] In the reference image, an indirect coordinate system is established with the upper left vertex of the rectangular image block represented by the template as the origin O and the downward direction along the edge of the rectangular image block as the y-axis. The x-axis is perpendicular to the y-axis, thus obtaining the reference coordinate system Oxy.

[0032] With the top left vertex of the matching region in the remaining label image as the origin O', and the downward direction along the edge of the matching region as the y' axis, an indirect coordinate system is established, with the x' axis perpendicular to the y' axis, to obtain the label coordinate system O'x'y'.

[0033] Based on the label coordinate system O'x'y', first rotate the reference coordinate system Oxy clockwise by an angle θ, then translate the origin of the coordinate system by x0 along the x-direction and y0 along the y-direction. The coordinate transformation relationship is as follows:

[0034] x'=(x-x0)cosθ+(y-y0)sinθ

[0035] y'=(x-x0)sinθ-(y-y0)cosθ

[0036] Where (x0, y0) are the coordinates of the origin O' of the label coordinate system in the reference coordinate system, (x, y) are the points in the reference coordinate system, and (x', y') are the points in the label coordinate system;

[0037] Based on the size of the rectangular image patch represented by the template and the determined coordinate transformation relationship, the coordinates of each vertex of the matching region in the remaining label image in the reference coordinate system are calculated.

[0038] Furthermore, S6 describes obtaining the vertex coordinates of the tag content, specifically as follows:

[0039] Using the relative positional relationship between a vertex of the attribute name and the top-left vertex of the corresponding tag content, as well as the length and width of the tag content area, as external inputs, the corresponding vertices of the tag image matching area are translated according to the relative positional relationship to obtain the coordinates of the top-left vertex of the tag content area.

[0040] The coordinates of the top-left vertex of the label content area are calculated by adding the coordinates of the top-left vertex of the label content area based on its length and width, thus obtaining the coordinates of each vertex of the label content.

[0041] Furthermore, S9 utilizes machine vision recognition methods to perform character recognition on the segmented characters, specifically including:

[0042] S91. Obtain label image information of the same category and establish a sample library;

[0043] S92. Obtain character features from the sample library, take different character features as input, and character values ​​as output to build a training model for each character;

[0044] S93. Integrate the training models of all characters into a training set for training. When the training times and / or recognition accuracy requirements are met, the training is complete. Input the training results into the trained training set to obtain the character library and save it as a file.

[0045] S94. Call the file generated in S93 to read the training information of the character library, match it with the segmented characters, and set the parameters for recognizing characters, including the character recognition score.

[0046] S95. When the character matching degree output by the algorithm is not lower than the set character recognition score, the corresponding character value is output to complete the character recognition; otherwise, a blank character is output.

[0047] Furthermore, S93 describes integrating the training models of all characters into a training set, with parameters including thresholding parameters, morphological processing parameters, and minimum pixel attribute information for each character.

[0048] The advantages of this invention compared to the prior art are:

[0049] (1) Compared with the prior art, the present invention achieves the function of real-time photography and dynamic identification of label information by using a data acquisition and shooting system and a product information processing and analysis terminal. By using a combination of image processing methods, the contrast between the characters and background areas of the product label is greatly improved.

[0050] (2) Compared with the prior art, the method proposed in this invention has universality and can flexibly set templates according to user needs, thereby identifying information of interest and accurately and effectively identifying most tag types containing attributes and content.

[0051] (3) Compared with the prior art, the method proposed in this invention can accurately locate and identify tag information at any shooting angle through affine transformation processing. The angle range includes 0° to 360°, which greatly improves the convenience and automation of operation.

[0052] (4) Compared with the prior art, the method proposed in this invention can meet the special and specific requirements of experimental input information and can independently train the character library for specific information. Attached Figure Description

[0053] Figure 1 This is a system architecture diagram of the image recognition method according to an embodiment of the present invention;

[0054] Figure 2 This is a flowchart of the image recognition method according to an embodiment of the present invention;

[0055] Figure 3 This is a schematic diagram of the affine transformation principle involved in the image recognition method of this invention. Detailed Implementation

[0056] The present invention will be further described below with reference to the embodiments.

[0057] Figure 1 The diagram below illustrates the system architecture of the method proposed in this invention. An optical sensor converts the external scene (part labels on the product) into electrical signals, which are then converted into image data streams by an image acquisition device. The product information is uploaded to a product processing and analysis terminal via Ethernet for analysis and processing. Finally, control commands are issued through machine vision software, uploading the relevant information to a recording system.

[0058] Example 1

[0059] S1. Organize the products in the same batch to be identified, determine the type of label for the batch of products, and store it in the product information processing and analysis terminal.

[0060] S2. The test personnel begin to enter product information and use the data acquisition and shooting system to take pictures of the product label interface to obtain label images of the same batch of products.

[0061] S3. The product information processing and analysis terminal performs color and contrast preprocessing on the captured images to make the captured product label images clear and with obvious contrast.

[0062] The specific steps for color and contrast preprocessing are as follows:

[0063] S31. Use component method for grayscale processing: For the three color channels R, G, and B in a true color image, extract the component of one of the color channels (e.g., the R color channel) and convert it to grayscale.

[0064] S32. Using grayscale transformation, pixel-wise processing is performed on the grayscale label image in the spatial domain. The grayscale value of each pixel in the processed image I is reduced using the same calculation method to enhance the contrast of the processed image I, resulting in the contrast-processed label image F. The specific calculation method is as follows:

[0065]

[0066] Where I(i,j) is the gray value of the processed image I at pixel (i,j), F(i,j) is the gray value of the label image F after contrast processing at pixel (i,j), a is the minimum gray value in the processed image I, b is the maximum gray value in the processed image I, c is the preset minimum gray value in the label image F after contrast processing, and d is the preset maximum gray value in the label image F after contrast processing. Setting different values ​​of c and d can transform the gray values ​​of the image.

[0067] S4. Manually create templates according to user needs: Use any tag image as a reference image. The template is a rectangular image block extracted from the reference image. The image information contained in the template is the attribute name corresponding to the tag content that the user is interested in.

[0068] For example, the product production date includes the specific year, month, and day numbers, and the corresponding attribute name is "Product Date".

[0069] The specific method for manually creating templates is as follows:

[0070] After contrast processing, use the image cropping function in LabVIEW software to manually select the area containing the attribute names of the label content that the user is interested in, and use the cropped image block as a template to save it.

[0071] S5. This step involves user interaction to determine whether the template creation was successful: After the user manually creates the template, the template is part of the content of the tag. If the template preview information is correct, it will indicate that the template creation was successful and proceed to S6; otherwise, it will proceed to S4 to recreate the template.

[0072] S6. Match the template in the remaining label images after contrast processing, and find the regions in the remaining label images that contain the same image information as the template, and record them as the matching regions.

[0073] The matching template is specifically: a geometric matching process based on shape features is performed using the Low Discrepancy Sampling algorithm, including the extraction and sorting of the edge curves and geometric features of the template, the extraction of the shape features of the image information contained in the template, and the completion of template feature learning;

[0074] The image information contained in the template is stored in a file. The template feature association mapping is performed between the product label images of this batch and the image information in the template file to obtain the matching degree. When the matching degree between a certain area of ​​the product label image of this batch and the corresponding template file exceeds the threshold, the matching is successful, and the area in the label image that is the same as the image information contained in the template has been found.

[0075] S7. Locate the matching region of the label image in the remaining label image: Take the upper left vertex of the rectangular image block represented by the template in the reference image as the origin, and establish a reference coordinate system with the two sides passing through the origin as coordinate axes. Take the upper left vertex of the matching region in the remaining label image as the origin, and establish a label coordinate system with the two sides passing through the origin as coordinate axes. Perform a coordinate transformation from the reference coordinate system to the label coordinate system to obtain the coordinates of the upper left vertex of the matching region in the remaining label image in the reference coordinate system. Calculate the coordinates of each vertex of the matching region in the remaining label image in the reference coordinate system based on the length and width of the template.

[0076] Figure 3 This is a diagram illustrating the coordinate transformation principle involved in the method proposed in this invention. The basic principle is explained below:

[0077] First, based on the length and width of the matched template, the size of the rectangular image block represented by the template is obtained;

[0078] Then, an indirect coordinate system is established in the reference image with the upper left vertex of the rectangular image block represented by the template as the origin O and the downward direction along the edge of the rectangular image block as the y-axis. The x-axis is perpendicular to the y-axis, thus obtaining the reference coordinate system Oxy.

[0079] With the top left vertex of the matching region in the remaining label image as the origin O', and the downward direction along the edge of the matching region as the y' axis, an indirect coordinate system is established, with the x' axis perpendicular to the y' axis, to obtain the label coordinate system O'x'y'.

[0080] Based on the label coordinate system O'x'y', first rotate the reference coordinate system Oxy clockwise by an angle θ, then translate the origin of the coordinate system by x0 along the x-direction and y0 along the y-direction. The coordinate transformation relationship is as follows:

[0081] x'=(x-x0)cosθ+(y-y0)sinθ

[0082] y'=(x-x0)sinθ-(y-y0)cosθ

[0083] Where (x0, y0) are the coordinates of the origin O' of the label coordinate system in the reference coordinate system, (x, y) are the points in the reference coordinate system, and (x', y') are the points in the label coordinate system;

[0084] Based on the size of the rectangular image patch and the determined coordinate transformation relationship, the coordinates of each vertex of the matching region in the remaining label image are calculated.

[0085] In this embodiment, the area containing the tag content that the user is interested in is called the ROI (Region of Interest). The region in the tag image that is the same as the image information contained in the template is matched, that is, the location of the attribute name corresponding to the ROI region in the tag image is found.

[0086] Next, based on the known relative positional relationship between the attribute names and the corresponding tag content, the vertex coordinates of the tag image matching area are calculated accordingly to obtain the vertex coordinates of the tag content and locate the ROI region of the tag image.

[0087] The label described in this invention includes an attribute name and a content portion, including but not limited to the following product label types:

[0088] The content portion is located below the attribute name, or to the right of the attribute name.

[0089] In one embodiment, the relative positional relationship between the lower right vertex of the attribute name and the upper left vertex of the corresponding tag content, as well as the length and width of the tag content area, are used as external inputs. The lower right vertex of the tag image matching area is translated according to the relative positional relationship to obtain the coordinates of the upper left vertex of the tag content area. Then, the coordinates of the upper left vertex of the tag content area are calculated by adding coordinates according to the length and width of the tag content area to obtain the coordinates of each vertex of the tag content.

[0090] The program automatically calculates and records the position information of the ROI region relative to the reference coordinate system. This information does not change with the shooting angle, and when the product label type is fixed, this position information is also fixed. Therefore, based on the transformation relationship between the ROI region and the reference coordinate system, regardless of whether the part label used for inspection is translated or rotated, the same transformation is performed on the ROI used for inspection to ensure that the position of the key information relative to the feature remains unchanged.

[0091] S8. After locating the ROI region of the label image, extract the characters within the ROI region. If the characters within the ROI region are within the value range, no prompt will be given, and proceed directly to S9. If the characters are not within the value range, blank characters will be displayed, and a higher resolution product label needs to be replaced. After contrast processing, return to S6. Alternatively, manually input the attribute information of the product to be identified, and then proceed to S9.

[0092] S9. Extract the ROI region identified by S8 to prepare for character recognition.

[0093] S10. Segment the characters within the ROI region according to preset values, including character length, width, and character spacing.

[0094] S11. Using machine vision recognition methods (Optical Character Recognition, OCR), perform character recognition on the segmented characters; specifically including the following steps:

[0095] S111. Obtain label image information of the same category and establish a sample library;

[0096] S112. Obtain character features from the sample library, take different character features as input, and character values ​​as output to build a training model for each character;

[0097] S113. Set thresholding parameters, morphological processing parameters, and minimum pixel attribute information for characters to integrate the training models of all characters into a training set. Use the training set for training. When the training times and / or recognition accuracy requirements are met, the training is complete. Input the training results into the trained training set to obtain the character library and save it as a file.

[0098] S114. Call the file generated in S113 to read the training information of the character library, match it with the segmented characters, and set the parameters for recognizing characters, including the character recognition score.

[0099] S115. When the character matching degree output by the algorithm is not lower than the set character recognition score, the corresponding character value is output to complete the character recognition; otherwise, a blank character is output.

[0100] S12. Post-process the recognized characters according to the storage format requirements (e.g., extract a specific number of digits from all recognized characters) and upload them to the recording system.

[0101] S13. Complete the image recognition of product label information.

[0102] The image recognition method based on product label information proposed in this invention is applicable to the vast majority of product labels and can flexibly set templates according to user needs, thereby recognizing information of interest; in addition, taking into account the uncertainty of the shooting angle during the experimental shooting process, it can accurately recognize characters at any shooting angle.

[0103] Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make possible changes and modifications to the technical solutions of the present invention by utilizing the methods and techniques disclosed above without departing from the spirit and scope of the present invention. Therefore, any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solutions of the present invention shall fall within the protection scope of the technical solutions of the present invention.

Claims

1. An image recognition method based on product label information, characterized in that, Includes the following steps: S1. Obtain label images of products from the same batch; S2. Perform contrast processing on the label image; S3. Create a template: Use any tag image as a reference image. The template is a rectangular image block extracted from the reference image. The image information contained in the template is the attribute name corresponding to the tag content that the user is interested in. S4. Match the template in the remaining label images after contrast processing, and find the regions in the remaining label images that have the same image information as the template, and record them as the matching regions. S5. Locate the label image matching region in the remaining label images; S6. According to the relative positional relationship between the known attribute names and the corresponding tag content, perform corresponding coordinate calculations on the vertex coordinates of the tag image matching area to obtain the vertex coordinates of the tag content and locate the ROI area of ​​the tag image. S7. Extract the characters within the ROI region of the label image. If the characters within the ROI region are within the value range, proceed to S8; otherwise, replace with a higher resolution product label, perform contrast processing, and proceed to S4. S8. Divide the characters within the ROI region according to the set character length, width, and character spacing; S9. Use machine vision recognition methods to perform character recognition on the segmented characters; S10. Upload the identified characters to the recording system in accordance with the storage format requirements to complete the image recognition of product label information; S4 describes matching the template in the label image after contrast processing, specifically as follows: A low-difference sampling algorithm is used to perform a geometric matching process based on shape features, including the extraction and sorting of edge curves and geometric features of the template, the extraction of shape features of the image information contained in the template, and the completion of template feature learning. The image information contained in the template is stored in a file. The template feature association mapping is performed between the product label images of this batch and the image information in the template file to obtain the matching degree. When the matching degree between a certain region of the product label image of this batch and the corresponding template file exceeds the threshold, the matching is successful and the region in the label image that is the same as the image information contained in the template has been found. S6 describes obtaining the coordinates of each vertex of the tag content, specifically as follows: Using the relative positional relationship between a vertex of the attribute name and the top-left vertex of the corresponding tag content, as well as the length and width of the tag content area, as external inputs, the corresponding vertices of the tag image matching area are translated according to the relative positional relationship to obtain the coordinates of the top-left vertex of the tag content area. The coordinates of the top-left vertex of the label content area are calculated by adding the coordinates of the top-left vertex of the label content area based on its length and width, thus obtaining the coordinates of each vertex of the label content.

2. The image recognition method based on product label information according to claim 1, characterized in that, The contrast processing of the label image described in S2 is specifically as follows: Grayscale processing using the component method: For the three color channels R, G, and B in a true-color image, extract the component of one of the color channels and convert it to grayscale. The grayscale transformation method is used to process the grayscale label image in the spatial domain. The grayscale value of each pixel of the image I to be processed is reduced according to the same calculation method to enhance the contrast of the image I to obtain the label image F after contrast processing.

3. The image recognition method based on product label information according to claim 2, characterized in that, The calculation method using grayscale transformation is as follows: Where I(i,j) is the gray value of the processed image I at pixel (i,j), F(i,j) is the gray value of the label image F after contrast processing at pixel (i,j), a is the minimum gray value in the processed image I, b is the maximum gray value in the processed image I, c is the preset minimum gray value in the label image F after contrast processing, and d is the preset maximum gray value in the label image F after contrast processing.

4. The image recognition method based on product label information according to claim 1, characterized in that, S3 describes a template creation method that includes manual template creation: After contrast processing, use the image cropping function in LabVIEW software to manually select the area containing the attribute name corresponding to the label content that the user is interested in, and use the cropped image block as a template to save it. The template is a portion of the tag content. If the preview information is correct, the template creation is successful; otherwise, the template will be recreated.

5. The image recognition method based on product label information according to claim 1, characterized in that, S5 describes locating the label image matching region in the remaining label images, specifically as follows: Based on the length and width of the matched template, the size of the rectangular image block represented by the template is obtained; In the reference image, an indirect coordinate system is established with the upper left vertex of the rectangular image block represented by the template as the origin O and the downward direction along the edge of the rectangular image block as the y-axis. The x-axis is perpendicular to the y-axis, thus obtaining the reference coordinate system Oxy. With the top left vertex of the matching region in the remaining label image as the origin O', and the downward direction along the edge of the matching region as the y' axis, an indirect coordinate system is established, with the x' axis perpendicular to the y' axis, to obtain the label coordinate system O'x'y'. Based on the label coordinate system O'x'y', first rotate the reference coordinate system Oxy clockwise by an angle θ, then translate the origin of the coordinate system by x0 along the x-direction and y0 along the y-direction. The coordinate transformation relationship is as follows: x′=(x-x0)cosθ+(y-y0)sinθ y′=(x-x0)sinθ-(y-y0)cosθ Where (x0, y0) are the coordinates of the origin O' of the label coordinate system in the reference coordinate system, (x, y) are the points in the reference coordinate system, and (x', y') are the points in the label coordinate system; Based on the size of the rectangular image patch represented by the template and the determined coordinate transformation relationship, the coordinates of each vertex of the matching region in the remaining label image in the reference coordinate system are calculated.

6. The image recognition method based on product label information according to claim 1, characterized in that, S9 uses machine vision recognition methods to perform character recognition on the segmented characters, specifically including: S91. Obtain label image information of the same category and establish a sample library; S92. Obtain character features from the sample library, take different character features as input, and character values ​​as output to build a training model for each character; S93. Integrate the training models of all characters into a training set for training. When the training times and / or recognition accuracy requirements are met, the training is complete. Input the training results into the trained training set to obtain the character library and save it as a file. S94. Call the file generated in S93 to read the training information of the character library, match it with the segmented characters, and set the parameters for recognizing characters, including the character recognition score. S95. When the character matching degree output by the algorithm is not lower than the set character recognition score, the corresponding character value is output to complete the character recognition; otherwise, a blank character is output.

7. The image recognition method based on product label information according to claim 6, characterized in that, S93 describes integrating the training models of all characters into a training set, and setting parameters including thresholding parameters, morphological processing parameters, and minimum pixel attribute information of characters.

Citation Information

Patent Citations

  • Method and system for detecting appearance quality of printed matter

    CN113706464A

  • Character recognition method and system based on industrial equipment label and storage medium

    CN113971726A