Object information verification method and device, computer device, and storage medium

By using reference pointers of preset components for image data processing during image code label information verification, the problem of high resource consumption is solved, and efficient and accurate information verification is achieved.

CN117095400BActive Publication Date: 2026-02-24LONGSE ELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310845744.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2026-02-24
Estimated Expiration
2043-07-10

AI Technical Summary

Technical Problem

Existing technologies consume too many resources and are inefficient when verifying graphic code label information and outer packaging information.

Method used

By acquiring the image of the target object to be identified, and using the reference pointer of the preset component to reference the image data for text identification, the graphic code label and object number are identified, avoiding direct copying of image data to reduce resource consumption.

Benefits of technology

It effectively reduces resource consumption, improves the efficiency and accuracy of information verification, and reduces the need for buffer space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117095400B_ABST
    Figure CN117095400B_ABST
Patent Text Reader

Abstract

The application relates to an object information verification method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: obtaining a to-be-recognized image obtained by photographing a target object; referencing image data corresponding to a preset component according to a reference pointer corresponding to the preset component in the to-be-recognized image; performing text identification recognition on the referenced image data to obtain an object number identification result corresponding to the target object; identifying a graphic code label on the surface of the target object to obtain a target object number corresponding to the target object; and obtaining a verification result of the target object according to an actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object. The method can reduce resource consumption in the information verification process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an object information verification method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] On the production line, in order to better manage the products on the production line, graphic code labels are added to the outer packaging of the products, and the information on the graphic code labels is verified against the information on the outer packaging of the products.

[0003] With the development of computer technology, related technologies, in the process of verifying the information on graphic code labels and outer packaging, will automatically identify the information on the outer packaging using images to compare it with the information on the graphic code labels. At the same time, in order to improve the verification speed and accuracy, multiple processing channels are opened in practical applications, which requires multiple original pixel-format images of the outer packaging, resulting in significant resource consumption.

[0004] Therefore, the relevant technologies suffer from high resource consumption during the process of verifying the information on the graphic code label and the outer packaging. Summary of the Invention

[0005] Therefore, it is necessary to provide an object information verification method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can reduce resource consumption in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides a method for verifying object information. The method includes:

[0007] Acquire the image to be identified obtained by photographing the target object;

[0008] Based on the reference pointer corresponding to the preset component in the image to be identified, reference the image data corresponding to the preset component;

[0009] The referenced image data is subjected to text identifier recognition to obtain the object number recognition result corresponding to the target object;

[0010] Identify the graphic code label on the surface of the target object to obtain the target object number corresponding to the target object;

[0011] The verification result of the target object is obtained based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

[0012] In one embodiment, identifying the graphic code label on the surface of the target object to obtain the target object number corresponding to the target object includes:

[0013] Identify the graphic code label on the surface of the target object to obtain the target object number and the target color corresponding to the target object;

[0014] The step of obtaining the verification result of the target object based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object includes:

[0015] The image to be identified in the initial color space is converted to a different color space to obtain the converted image to be identified in the target color space.

[0016] Identify the color information of the target object in the converted image to be identified to obtain the color recognition result corresponding to the target object;

[0017] The verification result of the target object is obtained based on the actual color represented by the color recognition result corresponding to the target object and the target color corresponding to the target object, as well as the actual object number represented by the object number recognition result corresponding to the target object and the target object number corresponding to the target object.

[0018] In one embodiment, the preset component is a luminance component; the image data is a grayscale image to be identified corresponding to the image to be identified; the step of performing text identifier recognition on the referenced image data to obtain the object number recognition result corresponding to the target object includes:

[0019] The grayscale value distribution of the grayscale image to be identified is statistically analyzed to obtain the grayscale histogram corresponding to the target object;

[0020] Based on the first target threshold determined by the grayscale histogram, the referenced grayscale image to be identified is binarized to obtain the target binarized image corresponding to the target object;

[0021] The target binarized image is referenced according to the reference pointer corresponding to the target binarized image, and the text identifier recognition is performed on the referenced target binarized image to obtain the object number recognition result.

[0022] In one embodiment, the step of binarizing the referenced grayscale image to be identified based on a first target threshold determined according to the grayscale histogram to obtain a target binarized image corresponding to the target object includes:

[0023] The referenced grayscale image to be identified is binarized according to the first target threshold to obtain the binarized image corresponding to the target object;

[0024] The binarized image is referenced according to the reference pointer corresponding to the binarized image;

[0025] A morphological opening operation is performed on the referenced binarized image to obtain the target binarized image.

[0026] In one embodiment, the step of referencing the target binarized image according to the reference pointer corresponding to the target binarized image, and performing text identifier recognition on the referenced target binarized image to obtain the object number recognition result includes:

[0027] The referenced target binarized image is subjected to vertical projection processing and horizontal projection processing respectively to obtain a first vertical projection histogram and a horizontal projection histogram;

[0028] The second target threshold is determined based on the peak and valley values ​​of the first vertical projection histogram and the peak and valley values ​​of the horizontal projection histogram.

[0029] Based on the second target threshold, text location region segmentation is performed in the referenced target binarized image to obtain the text recognition image;

[0030] The text to be recognized image is referenced according to the reference pointer corresponding to the text to be recognized image;

[0031] The referenced image to be identified is subjected to text identifier recognition to obtain the object number recognition result.

[0032] In one embodiment, the step of performing text identifier recognition on the referenced image to be recognized to obtain the object number recognition result includes:

[0033] The referenced image of the text to be recognized is vertically projected to obtain a second vertical projection histogram;

[0034] Based on the third target threshold determined by the second vertical projection histogram, the referenced text recognition image is segmented into character position regions to obtain multiple character images to be recognized;

[0035] Based on the reference pointer corresponding to each of the character images to be recognized, the corresponding character image to be recognized is referenced; the reference pointer corresponding to each character image to be recognized points to each template character image in the template character image set;

[0036] The similarity between the referenced character image to be identified and each template character image is calculated to obtain the identification result corresponding to each character image to be identified;

[0037] Based on the identification result corresponding to the number of each character image to be identified, the object number identification result corresponding to the target object is obtained.

[0038] Secondly, this application also provides an object information verification device. The device includes:

[0039] The acquisition module is used to acquire the image to be identified obtained by taking a picture of the target object;

[0040] The referencing module is used to reference the image data corresponding to the preset component based on the reference pointer corresponding to the preset component in the image to be identified;

[0041] The first identification module is used to perform text identifier recognition on the referenced image data to obtain the object number recognition result corresponding to the target object;

[0042] The second identification module is used to identify the graphic code label on the surface of the target object and obtain the target object number corresponding to the target object.

[0043] The verification module is used to obtain the verification result of the target object based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

[0044] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0045] Acquire the image to be identified obtained by photographing the target object;

[0046] Based on the reference pointer corresponding to the preset component in the image to be identified, reference the image data corresponding to the preset component;

[0047] The referenced image data is subjected to text identifier recognition to obtain the object number recognition result corresponding to the target object;

[0048] Identify the graphic code label on the surface of the target object to obtain the target object number corresponding to the target object;

[0049] The verification result of the target object is obtained based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

[0050] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0051] Acquire the image to be identified obtained by photographing the target object;

[0052] Based on the reference pointer corresponding to the preset component in the image to be identified, reference the image data corresponding to the preset component;

[0053] The referenced image data is subjected to text identifier recognition to obtain the object number recognition result corresponding to the target object;

[0054] Identify the graphic code label on the surface of the target object to obtain the target object number corresponding to the target object;

[0055] The verification result of the target object is obtained based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

[0056] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0057] Acquire the image to be identified obtained by photographing the target object;

[0058] Based on the reference pointer corresponding to the preset component in the image to be identified, reference the image data corresponding to the preset component;

[0059] The referenced image data is subjected to text identifier recognition to obtain the object number recognition result corresponding to the target object;

[0060] Identify the graphic code label on the surface of the target object to obtain the target object number corresponding to the target object;

[0061] The verification result of the target object is obtained based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

[0062] The aforementioned object information verification method, apparatus, computer equipment, storage medium, and computer program product acquire an image to be identified obtained by photographing the target object; reference image data corresponding to a preset component in the image to be identified by referencing a reference pointer; perform text identification on the referenced image data to obtain the object number identification result corresponding to the target object; identify the graphic code label on the surface of the target object to obtain the target object number corresponding to the target object; and obtain the verification result of the target object based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

[0063] In this way, during the process of identifying the object number corresponding to the target object, the image data corresponding to the preset component in the image to be identified corresponding to the target object is referenced by the reference pointer of the preset component to perform text identification recognition, instead of directly copying the image data corresponding to the preset component. This avoids the situation where a large amount of buffer space and resources are required due to the need to re-extract the image data corresponding to the preset component, thereby effectively reducing resource consumption during the process of verifying the information of the target object. Attached Figure Description

[0064] Figure 1 This is a flowchart illustrating an object information verification method in one embodiment;

[0065] Figure 2 This is a schematic diagram of the segmentation of an initial high-resolution image in one embodiment;

[0066] Figure 3 A schematic diagram illustrating the establishment of reference pointers for luminance components in an image to be identified in one embodiment;

[0067] Figure 4 This is a flowchart illustrating an object information verification method in another embodiment;

[0068] Figure 5 This is a flowchart illustrating another object information verification method in one embodiment;

[0069] Figure 6 This is a structural block diagram of an object information verification device in one embodiment;

[0070] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0071] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0072] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0073] In one embodiment, such as Figure 1 As shown, an object information verification method is provided. This embodiment illustrates the method applied to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0074] Step S110: Obtain the image to be identified obtained by taking a picture of the target object.

[0075] The target object is the object whose information needs to be verified. In practical applications, the target object can be the outer packaging box. For outer packaging boxes of different specifications and appearances, it is necessary to verify whether the information corresponding to the graphic code label on the surface of the outer packaging box matches the specification and appearance information of the outer packaging box.

[0076] In practice, the terminal can acquire an initial high-resolution image of the target object captured by the camera. Since high resolution leads to a large amount of image computation, which in turn affects performance, while low resolution leads to pixel blurring and difficulty in recognition, in order to obtain a high-quality image and retain effective information in the image, the terminal can perform data cropping on the initial high-resolution image to extract an image with smaller width and height as the image to be recognized.

[0077] Specifically, the terminal can use an image extraction thread to remove a fixed-width (w1) and height (h1) bounding box from the outer perimeter of the initial high-resolution image, and the resulting center image is used as the image to be recognized. Therefore, the image to be recognized retains high resolution while reducing the amount of image data. For ease of understanding by those skilled in the art, Figure 2 A schematic diagram of segmentation of an initial high-resolution image is provided.

[0078] Step S120: Referencing the image data corresponding to the preset component according to the reference pointer corresponding to the preset component in the image to be identified.

[0079] In the specific implementation, in order to minimize the buffer space of the image, the terminal can establish a thread based on the image pointer in C language, establish reference pointers for the preset components in the image to be recognized in the initial color space, and then reference the image data corresponding to the preset components according to the reference pointers corresponding to the preset components, instead of directly extracting the image data corresponding to the preset components and copying it.

[0080] Step S130: Perform text identifier recognition on the referenced image data to obtain the object number recognition result corresponding to the target object.

[0081] In practice, if the referenced image data contains the actual object number on the surface of the target object, the terminal can perform text identifier recognition on the referenced image data to obtain the object number recognition result of the actual object number on the surface of the target object. The actual object number on the surface of the target object is used to represent the text identifier corresponding to the target object.

[0082] Step S140: Identify the graphic code label on the surface of the target object to obtain the target object number corresponding to the target object.

[0083] The graphic code label can be a QR code label.

[0084] The graphic code can be attached to the surface of the target object or printed on the surface of the target object.

[0085] In practice, the terminal can identify the graphic code label on the surface of the target object, obtain the ID information corresponding to the graphic code label, and query the target object number corresponding to the target object in the object information system database based on the ID information.

[0086] In practical applications, when the graphic code label is a QR code label, the terminal can parse the QR code label using the zbar algorithm to obtain the ID information corresponding to the QR code label.

[0087] Step S150: Based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object, the verification result of the target object is obtained.

[0088] In practice, the terminal can obtain the information verification result of the target object based on the actual object number represented by the object number identification result corresponding to the target object, and the target object number corresponding to the target object.

[0089] In the above object information verification method, an image to be identified is obtained by taking a picture of the target object; the image data corresponding to the preset component is referenced according to the reference pointer corresponding to the preset component in the image to be identified; the referenced image data is subjected to text identification recognition to obtain the object number recognition result corresponding to the target object; the graphic code label on the surface of the target object is identified to obtain the target object number corresponding to the target object; and the verification result of the target object is obtained according to the actual object number represented by the object number recognition result corresponding to the target object and the target object number corresponding to the target object.

[0090] In this way, during the process of identifying the object number corresponding to the target object, the image data corresponding to the preset component in the image to be identified corresponding to the target object is referenced by the reference pointer of the preset component to perform text identification recognition, instead of directly copying the image data corresponding to the preset component. This avoids the situation where a large amount of buffer space and resources are required due to the need to re-extract the image data corresponding to the preset component, thereby effectively reducing resource consumption during the process of verifying the information of the target object.

[0091] In one embodiment, identifying a graphic code label on the surface of a target object to obtain the target object number corresponding to the target object includes: identifying a graphic code label on the surface of a target object to obtain the target object number corresponding to the target object and the target color corresponding to the target object.

[0092] The verification result of the target object is obtained based on the actual object number represented by the object number recognition result corresponding to the target object and the target object number corresponding to the target object. This includes: performing color space conversion on the image to be identified in the initial color space to obtain the converted image to be identified in the target color space; identifying the color information of the target object in the converted image to be identified to obtain the color recognition result corresponding to the target object; and obtaining the verification result of the target object based on the actual color represented by the color recognition result corresponding to the target object and the target color corresponding to the target object, as well as the actual object number represented by the object number recognition result corresponding to the target object and the target object number corresponding to the target object.

[0093] The initial color space can be the YUV color space, and the target color space can be the HSL color space.

[0094] In the specific implementation, during the process of identifying the graphic code label on the surface of the target object and obtaining the target object number corresponding to the target object, the terminal can identify the graphic code label on the surface of the target object and obtain the ID information corresponding to the graphic code label. Based on the ID information, the terminal queries the target object number corresponding to the target object and the target color corresponding to the target object in the object information system database.

[0095] Furthermore, in the process of obtaining the verification result of the target object based on the actual object number represented by the object number recognition result and the target object number corresponding to the target object, in order to more conveniently analyze the color features of the target object, the terminal can convert the image to be identified in the YUV color space to obtain the converted image to be identified in the HSL color space. The converted image to be identified in the HSL color space can use 360 ​​degrees to represent color, so the terminal can identify the color information of the target object in the converted image to be identified, obtain the color recognition result corresponding to the target object, and temporarily store the color recognition result in the main thread. Then, the terminal can obtain the verification result of the target object based on the actual color represented by the color recognition result and the target color corresponding to the target object, as well as the actual object number represented by the object number recognition result and the target object number corresponding to the target object.

[0096] In practical applications, after obtaining the ID information corresponding to the graphic code label, determining the color recognition result of the target object, and the object number recognition result of the target object, the terminal can use the ID information as condition 1, the aforementioned color recognition result as condition 2, and the aforementioned object number recognition result as condition 3. Based on condition 1, the terminal queries the object information system database for the target color and the target object number corresponding to the target object. The object information system database compares the query results with conditions 2 and 3 to obtain the information verification result of the target object, and returns the information verification result. The information verification result is also automatically statistically analyzed, thereby automating the comparison, verification, and statistical analysis of the color recognition result and the object number recognition result of the target object with the graphic code label information on the surface of the target object.

[0097] In the process of returning information verification results and automatically statistically analyzing them, the object information system database can return the verification results to the terminal's processing thread. This processing thread can then split the verification results into two paths: one for output, which can be shown to the user interface or hardware devices; and the other for analysis. After analysis, the processing thread adds additional information to the verification results and stores these results in the object information system database's statistical table for final statistical analysis.

[0098] The technical solution of this embodiment obtains the target object number and the target color by recognizing the graphic code label on the surface of the target object; performs color space conversion on the image to be recognized in the initial color space to obtain the converted image to be recognized in the target color space; identifies the color information of the target object in the converted image to be recognized to obtain the color recognition result corresponding to the target object; and obtains the verification result of the target object based on the actual color represented by the color recognition result corresponding to the target object and the target color corresponding to the target object, as well as the actual object number represented by the object number recognition result corresponding to the target object and the target object number corresponding to the target object.

[0099] Thus, by converting the image to be recognized in the initial color space into the converted image to be recognized in the target color space, the color recognition result corresponding to the target object can be accurately identified; by using the actual color represented by the color recognition result corresponding to the target object, the actual object number represented by the object number recognition result corresponding to the target object, and the graphic code label on the surface of the target object, the information of the target object can be accurately verified.

[0100] In one embodiment, the preset component is the luminance component; the image data is the grayscale image to be identified corresponding to the image to be identified; text identification is performed on the referenced image data to obtain the object number identification result corresponding to the target object, including: statistically analyzing the grayscale value distribution of the referenced grayscale image to be identified to obtain the grayscale histogram corresponding to the target object; binarizing the referenced grayscale image to be identified according to a first target threshold determined based on the grayscale histogram to obtain the target binarized image corresponding to the target object; referencing the target binarized image according to the reference pointer corresponding to the target binarized image, and performing text identification on the referenced target binarized image to obtain the object number identification result.

[0101] In the specific implementation, the image to be recognized is in YUV format. To perform subsequent text feature extraction, the color information in the image needs to be discarded, retaining only the grayscale information. Therefore, the terminal needs to establish a reference pointer for the luminance component in the image to be recognized; that is, the preset component in the image to be recognized is the luminance component (Y component), and the image data corresponding to the luminance component is the grayscale image to be recognized. For ease of understanding by those skilled in the art, Figure 3 A schematic diagram is provided for establishing reference pointers to the luminance components in the image to be identified.

[0102] Thus, during the process of performing text identifier recognition on the referenced image data to obtain the object number recognition result corresponding to the target object, the terminal can statistically analyze the grayscale value distribution of the referenced grayscale image to be recognized, and obtain the grayscale histogram corresponding to the target object. Then, the terminal can input the grayscale histogram and the reference pointers corresponding to the luminance components into the preprocessing thread. According to the preprocessing thread, an intermediate threshold is determined based on the peak and valley values ​​of the grayscale histogram as the first target threshold. Based on the first target threshold, the grayscale image to be recognized referenced by the reference pointers corresponding to the luminance components is binarized to obtain the target binarized image corresponding to the target object. Then, the terminal can reference the target binarized image according to the reference pointers corresponding to the target binarized image, and perform text identifier recognition on the referenced target binarized image to obtain the object number recognition result.

[0103] In this embodiment, the preset component is the luminance component; the image data is the grayscale image to be identified corresponding to the image to be identified; by statistically analyzing the grayscale value distribution of the referenced grayscale image to be identified, a grayscale histogram corresponding to the target object is obtained; based on a first target threshold determined by the grayscale histogram, the referenced grayscale image to be identified is binarized to obtain a target binarized image corresponding to the target object; the target binarized image is referenced by a reference pointer corresponding to the target binarized image, and text identification is performed on the referenced target binarized image to obtain the object number identification result. Thus, by using a first target threshold determined by the grayscale histogram corresponding to the target object, the grayscale image to be identified referenced by the reference pointer corresponding to the luminance component is binarized to obtain the target binarized image corresponding to the target object. Therefore, the terminal can reference the target binarized image based on the reference pointer corresponding to the target binarized image, and accurately extract text features based on the target binarized image, effectively improving the identification accuracy of the object number identification result corresponding to the target object. Furthermore, by binarizing the referenced grayscale image to be identified and performing text identification on the referenced target binarized image, image data is not re-extracted, which can effectively reduce memory overhead and resource consumption.

[0104] In one embodiment, binarizing a referenced grayscale image to be identified based on a first target threshold determined by a grayscale histogram to obtain a target binarized image corresponding to the target object includes: binarizing the referenced grayscale image to be identified based on the first target threshold to obtain a binarized image corresponding to the target object; referencing the binarized image based on a reference pointer corresponding to the binarized image; and performing a morphological opening operation on the referenced binarized image to obtain the target binarized image.

[0105] In specific implementation, during the process of binarizing the referenced grayscale image to be identified based on a first target threshold determined by the grayscale histogram to obtain the target binarized image corresponding to the target object, the terminal can, according to the preprocessing thread, binarize the referenced grayscale image to be identified based on the first target threshold to obtain the binarized image corresponding to the target object. Then, the terminal can establish a reference pointer for the obtained binarized image and reference the binarized image according to the reference pointer. Morphological opening operations are performed on the referenced binarized image to remove bright isolated pixels, filtering out some interfering pixel areas, resulting in a new binarized image, which serves as the target binarized image corresponding to the target object. This ensures that the target binarized image is the binarized image corresponding to the main region containing the text location area in the grayscale image to be identified. Thus, the terminal can reference the target binarized image according to the reference pointer and perform text identification recognition on the referenced target binarized image to obtain the object number recognition result.

[0106] The technical solution of this embodiment involves binarizing the referenced grayscale image to be identified according to a first target threshold to obtain a binarized image corresponding to the target object; referencing the binarized image according to the reference pointer corresponding to the binarized image; and performing a morphological opening operation on the referenced binarized image to obtain the target binarized image. In this way, by performing a morphological opening operation on the binarized image, bright island pixels can be removed to filter out some interfering pixel areas, so that text identification can be accurately performed based on the obtained target binarized image, effectively improving the accuracy of the object number recognition result corresponding to the target object.

[0107] In one embodiment, referencing a target binarized image based on a reference pointer corresponding to the target binarized image, and performing text identifier recognition on the referenced target binarized image to obtain an object number recognition result, includes: performing vertical projection processing and horizontal projection processing on the referenced target binarized image to obtain a first vertical projection histogram and a horizontal projection histogram; determining a second target threshold based on the peak and valley values ​​of the first vertical projection histogram and the peak and valley values ​​of the horizontal projection histogram; performing text location region segmentation in the referenced target binarized image based on the second target threshold to obtain a text recognition image; referencing the text recognition image based on the reference pointer corresponding to the text recognition image; and performing text identifier recognition on the referenced text recognition image to obtain an object number recognition result.

[0108] The text location region is the location region on the surface of the target object in the grayscale image to be identified, where the actual object number is located.

[0109] In the specific implementation, the terminal references the target binarized image based on the reference pointer corresponding to the target binarized image, and performs text identification on the referenced target binarized image to obtain the object number identification result. The target binarized image is the binarized image corresponding to the main region of the text location area on the target object. In order to segment the text location area in the target binarized image, the terminal can first perform vertical projection processing and horizontal projection processing on the referenced target binarized image respectively. The target binarized image after vertical projection processing is used as the first vertical projection histogram, and the target binarized image after horizontal projection processing is used as the horizontal projection histogram. Then, the terminal can analyze the location of the text location area on the target object in the target binarized image based on the peak and valley values ​​of the first vertical projection histogram and the peak and valley values ​​of the horizontal projection histogram, obtain an intermediate threshold as the second target threshold, and perform text location area segmentation in the referenced target binarized image based on the second target threshold, that is, segment the text location area in the referenced target binarized image to obtain the text recognition image that retains only the text location area.

[0110] Then, the terminal can store the image to be recognized in a newly created reference pointer. This involves establishing a reference pointer for the image to be recognized, removing unnecessary reference pointers, and obtaining a reference pointer corresponding to the image to be recognized that only retains the text location area, effectively reducing memory overhead. In this way, the terminal can reference the image to be recognized based on the reference pointer, and perform text identification on the referenced image to obtain the object number recognition result corresponding to the target object.

[0111] The technical solution of this embodiment involves performing vertical and horizontal projection processing on the referenced target binarized image to obtain a first vertical projection histogram and a horizontal projection histogram; determining a second target threshold based on the peak and valley values ​​of the first vertical projection histogram and the horizontal projection histogram; segmenting the text location region in the referenced target binarized image based on the second target threshold to obtain a text recognition image; referencing the text recognition image based on the reference pointer corresponding to the text recognition image; and performing text identifier recognition on the referenced text recognition image to obtain the object number recognition result.

[0112] Thus, by analyzing the vertical and horizontal projection histograms of the target binarized image, the location of the text region within the image can be determined, thus establishing a second target threshold. Based on this threshold, the text region can be accurately segmented within the target binarized image, resulting in a text recognition image that retains only the text region. Furthermore, by performing text identifier recognition on this image, the object number corresponding to the target object can be accurately identified. Additionally, by using a reference pointer to the text recognition image, text identifier recognition can be performed without needing to copy the image again, saving resource space and effectively reducing resource consumption.

[0113] In one embodiment, performing text identifier recognition on the referenced text recognition image to obtain an object number recognition result includes: vertically projecting the referenced text recognition image to obtain a second vertical projection histogram; segmenting the referenced text recognition image into character position regions based on a third target threshold determined by the second vertical projection histogram to obtain multiple character images to be recognized; referencing the corresponding character image to be recognized according to the reference pointers corresponding to each character image to be recognized; the reference pointers corresponding to each character image to be recognized pointing to each template character image in the template character image set; calculating the similarity between the referenced character image to be recognized and each template character image to obtain the number recognition result corresponding to each character image to be recognized; and obtaining the object number recognition result corresponding to the target object based on the number recognition result corresponding to each character image to be recognized.

[0114] In practical applications, the actual object number on the surface of the target object can be a numeric number, and the target object number corresponding to the target object can also be a numeric number.

[0115] To simplify the template character images, font templates similar to 0-9 and the numerical numbers on the surface of the packaging box can be used as template character images in the template character image set, and the template character image set can be stored in a digital template database.

[0116] The text location region includes multiple character location regions, which are the locations of each character that makes up the actual object number on the surface of the target object in the image to be recognized.

[0117] In specific implementation, during the process of the terminal performing text identification on the referenced image to be identified and obtaining the object number recognition result, the terminal can perform vertical projection on the referenced image to be identified, using the vertically projected image as a second vertical projection histogram. A third target threshold is determined based on the peak and valley values ​​of the second vertical projection histogram. Based on the third target threshold, the referenced image to be identified is segmented into character position regions, that is, the character position regions that make up the text position regions in the image to be identified are segmented to obtain the character images corresponding to each character position region (when the actual object number on the surface of the target object is a numerical number, this character image is a numerical image). Then, the terminal can establish new reference pointers for each character image and obtain the mapping relationship between each character that makes up the actual object number in the original image (the grayscale image to be identified) and its corresponding character position region. Thus, the terminal can reference the corresponding character image according to the reference pointers corresponding to each character image to perform normalization processing on each referenced character image, and use the normalized character image as the character image to be identified, obtaining the character image to be identified for each character.

[0118] Then, the terminal can establish reference pointers for each character image to be recognized, and the reference pointer corresponding to each character image to be recognized will point to each template character image in the template character image set. Specifically, the terminal can establish references between each character image to be recognized and each template character image. For example, the terminal can establish a nine-grid reference between each character image to be recognized and each template character image. Specifically, the terminal can equally divide the character image to be recognized into nine regions to obtain nine character sub-images to be recognized in the character image to be recognized. At the same time, the template character image can equally divide into nine regions to obtain nine template character sub-images in the template character image. The image size of the character image to be recognized and the template character image are equal. Then, for any character image to be recognized, the terminal can establish references between the nine character sub-images to be recognized in that character image and the template character sub-images in each template character image that belong to the same position region. That is, the reference pointer corresponding to each character sub-image to be recognized in that character image points to the template character sub-images in the template character image that belong to the same position region, thus obtaining a character image to be recognized with added position structure information. In practical applications, the terminal can also divide the character image to be recognized and the template character image into other numbers of equally divided regions.

[0119] Thus, in the process of referencing the corresponding character image according to the reference pointer of each character image to be recognized, the terminal can, for any character image to be recognized, refer to the corresponding sub-image of the character to be recognized according to the reference pointer of each sub-image of the character image to be recognized. In the process of calculating the similarity between the referenced character image to be recognized and each template character image, the similarity between the referenced sub-image of the character to be recognized and the template character sub-image belonging to the same position region pointed to by the corresponding reference pointer is calculated to obtain the similarity between the referenced sub-image of the character to be recognized and the corresponding template character sub-image. Thus, the terminal can obtain the total similarity between any character image to be recognized and the template character image based on the similarity between each sub-image of the character image to be recognized and the corresponding template character sub-image in the template character image. Then, the terminal can determine the total similarity between any character image to be recognized and each template character image using the same method, sort the total similarity between any character image to be recognized and each template character image, and take the character in the template character image with the highest total similarity as the number recognition result corresponding to any character image to be recognized. Thus, by incorporating positional and structural information into the images during the image similarity comparison process, the reliability of the identification results can be effectively improved.

[0120] Ultimately, the terminal can obtain the object number recognition result corresponding to the target object based on the recognition result corresponding to the number of each character image to be recognized.

[0121] The technical solution of this embodiment involves vertically projecting the referenced text recognition image to obtain a second vertical projection histogram; segmenting the referenced text recognition image into character position regions based on a third target threshold determined by the second vertical projection histogram to obtain multiple character images to be recognized; referencing the corresponding character image according to the reference pointers corresponding to each character image to be recognized; pointing each reference pointer to a template character image in the template character image set; calculating the similarity between the referenced character image to be recognized and each template character image to obtain the number recognition result corresponding to each character image to be recognized; and obtaining the object number recognition result corresponding to the target object based on the number recognition result corresponding to each character image to be recognized.

[0122] Thus, by segmenting the character location regions in the image to be recognized, multiple character images to be recognized are obtained. The similarity between these character images and each template character image in the template character image set is then calculated. This allows for accurate identification of the corresponding number in each character image. Furthermore, the object number of the target object can be accurately identified using the identification results of the corresponding number in each character image. In addition, by using reference pointers to the corresponding character images for image similarity calculation, image data is not re-extracted, effectively reducing memory overhead and resource consumption.

[0123] In another embodiment, such as Figure 4 As shown, an object information verification method is provided. Taking the application of this method to the aforementioned terminal as an example, the method includes the following steps:

[0124] Step S410: Obtain the image to be identified obtained by taking a picture of the target object.

[0125] Step S420: Referencing the image data corresponding to the preset component according to the reference pointer corresponding to the preset component in the image to be identified.

[0126] Step S430: Statistically analyze the grayscale value distribution of the referenced grayscale image to be identified to obtain the grayscale histogram corresponding to the target object.

[0127] Step S440: Based on the first target threshold determined by the grayscale histogram, the referenced grayscale image to be identified is binarized to obtain the target binarized image corresponding to the target object.

[0128] Step S450: Referencing the target binarized image according to the reference pointer corresponding to the target binarized image, and performing text identification recognition on the referenced target binarized image to obtain the object number recognition result.

[0129] Step S460: Perform color space conversion on the image to be recognized in the initial color space to obtain the converted image to be recognized in the target color space.

[0130] Step S470: Identify the color information of the target object in the converted image to be identified, and obtain the color recognition result corresponding to the target object.

[0131] Step S480: Identify the graphic code label on the surface of the target object to obtain the target object number and the target color corresponding to the target object.

[0132] Step S490: Based on the actual color represented by the color recognition result corresponding to the target object and the target color corresponding to the target object, and based on the actual object number represented by the object number recognition result corresponding to the target object and the target object number corresponding to the target object, obtain the verification result of the target object.

[0133] It should be noted that the specific limitations of the above steps can be found in the specific limitations of an object information verification method described above.

[0134] In one embodiment, such as Figure 5 As shown, another object information verification method is provided. The target object is an outer packaging box, the surface of which contains an actual object number (in this embodiment, the actual object number is a numerical number) and a graphic code label (in this embodiment, the graphic code label is a QR code label). The terminal can acquire an initial high-resolution image of the outer packaging box captured by a camera, and determine the image to be identified corresponding to the outer packaging box based on the initial high-resolution image. The image to be identified is then converted to a color space to obtain the color recognition result corresponding to the color information of the outer packaging box. Simultaneously, the terminal needs to establish a reference pointer for the luminance component in the image to be identified, so as to reference the image data (i.e., the grayscale image to be identified) corresponding to the luminance component based on the reference pointer. By processing and analyzing the grayscale image to be identified corresponding to the luminance component, a preprocessing result (i.e., the target binarized image) is obtained. Then, the terminal can again perform image data pointer operations based on the preprocessing result. The system references and processes the referenced image data. Specifically, based on the reference pointer corresponding to the target binarized image, it uses the target binarized image for text identification, extracts text features, and obtains multiple character images to be identified. Each character image to be identified is then compared with the template character images in the simplified template character image set (i.e., the minimized template library) to obtain the object number identification result corresponding to the number on the surface of the outer packaging box. Then, the terminal can input the color identification result and the object number identification result into the object information system database for result analysis, store the information verification result in the object information system database, and output the result through the object information system database.

[0135] It should be noted that the specific limitations of the steps in the above method can be found in the specific limitations of an object information verification method described above, and will not be repeated here.

[0136] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0137] Based on the same inventive concept, this application also provides an object information verification device for implementing the object information verification method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more object information verification device embodiments provided below can be found in the limitations of the object information verification method described above, and will not be repeated here.

[0138] In one embodiment, such as Figure 6 As shown, an object information verification device is provided, including: an acquisition module 610, a reference module 620, a first identification module 630, a second identification module 640, and a verification module 650, wherein:

[0139] The acquisition module 610 is used to acquire the image to be identified obtained by taking a picture of the target object.

[0140] The referencing module 620 is used to refer to the image data corresponding to the preset component based on the reference pointer corresponding to the preset component in the image to be identified.

[0141] The first recognition module 630 is used to perform text identifier recognition on the referenced image data to obtain the object number recognition result corresponding to the target object.

[0142] The second identification module 640 is used to identify the graphic code label on the surface of the target object and obtain the target object number corresponding to the target object.

[0143] The verification module 650 is used to obtain the verification result of the target object based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

[0144] In one embodiment, the second identification module 640 is specifically used to identify the graphic code label on the surface of the target object to obtain the target object number and the target color corresponding to the target object; the verification module 650 is specifically used to perform color space conversion on the image to be identified in the initial color space to obtain the converted image to be identified in the target color space; identify the color information of the target object in the converted image to be identified to obtain the color identification result corresponding to the target object; and obtain the verification result of the target object based on the actual color represented by the color identification result corresponding to the target object and the target color corresponding to the target object, and based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

[0145] In one embodiment, the preset component is a luminance component; the image data is a grayscale image to be identified corresponding to the image to be identified; the first identification module 630 is specifically used to statistically analyze the grayscale value distribution of the referenced grayscale image to be identified to obtain a grayscale histogram corresponding to the target object; based on a first target threshold determined by the grayscale histogram, the referenced grayscale image to be identified is binarized to obtain a target binarized image corresponding to the target object; the target binarized image is referenced according to the reference pointer corresponding to the target binarized image, and text identification is performed on the referenced target binarized image to obtain the object number identification result.

[0146] In one embodiment, the first recognition module 630 is specifically configured to perform binarization processing on the referenced grayscale image to be recognized according to the first target threshold to obtain a binarized image corresponding to the target object; reference the binarized image according to the reference pointer corresponding to the binarized image; and perform morphological opening operation on the referenced binarized image to obtain the target binarized image.

[0147] In one embodiment, the first recognition module 630 is specifically configured to perform vertical projection processing and horizontal projection processing on the referenced target binarized image to obtain a first vertical projection histogram and a horizontal projection histogram; determine a second target threshold based on the peak and valley values ​​of the first vertical projection histogram and the peak and valley values ​​of the horizontal projection histogram; perform text location region segmentation in the referenced target binarized image based on the second target threshold to obtain a text recognition image; reference the text recognition image based on the reference pointer corresponding to the text recognition image; and perform text identifier recognition on the referenced text recognition image to obtain the object number recognition result.

[0148] In one embodiment, the first recognition module 630 is specifically configured to: vertically project the referenced text recognition image to obtain a second vertical projection histogram; segment the referenced text recognition image into character position regions based on a third target threshold determined by the second vertical projection histogram to obtain multiple character images to be recognized; reference the corresponding character image to be recognized according to the reference pointers corresponding to each character image to be recognized; the reference pointers corresponding to each character image to be recognized point to each template character image in the template character image set; perform similarity calculation between the referenced character image to be recognized and each template character image to obtain the number recognition result corresponding to each character image to be recognized; and obtain the object number recognition result corresponding to the target object based on the number recognition result corresponding to each character image to be recognized.

[0149] Each module in the aforementioned object information verification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0150] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores verification result data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements an object information verification method.

[0151] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0152] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0153] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0154] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0155] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0156] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0157] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0158] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for verifying object information, characterized in that, The method includes: Acquire the image to be identified obtained by photographing the target object; The image data corresponding to the preset component is referenced according to the reference pointer corresponding to the preset component in the image to be identified; the preset component is the brightness component; the image data is the grayscale image to be identified corresponding to the image to be identified. The method involves performing text identifier recognition on the referenced image data to obtain the object number recognition result corresponding to the target object; including: statistically analyzing the grayscale value distribution of the referenced grayscale image to be identified to obtain a grayscale histogram corresponding to the target object; binarizing the referenced grayscale image to be identified according to a first target threshold determined based on the grayscale histogram to obtain a target binarized image corresponding to the target object; referencing the target binarized image according to the reference pointer corresponding to the target binarized image, and performing text identifier recognition on the referenced target binarized image to obtain the object number recognition result; wherein, the target binarized image is the binarized image corresponding to the main region containing the text location area in the grayscale image to be identified; Identify the graphic code label on the surface of the target object to obtain the target object number corresponding to the target object; The verification result of the target object is obtained based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

2. The method according to claim 1, characterized in that, The process of identifying the graphic code label on the surface of the target object to obtain the target object number corresponding to the target object includes: Identify the graphic code label on the surface of the target object to obtain the target object number and the target color corresponding to the target object; The step of obtaining the verification result of the target object based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object includes: The image to be identified in the initial color space is converted to a different color space to obtain the converted image to be identified in the target color space. The color information of the target object in the converted image to be identified is identified to obtain the color recognition result corresponding to the target object; The verification result of the target object is obtained based on the actual color represented by the color recognition result corresponding to the target object and the target color corresponding to the target object, as well as the actual object number represented by the object number recognition result corresponding to the target object and the target object number corresponding to the target object.

3. The method according to claim 1, characterized in that, The step of binarizing the referenced grayscale image to be identified based on the first target threshold determined by the grayscale histogram to obtain the target binarized image corresponding to the target object includes: The referenced grayscale image to be identified is binarized according to the first target threshold to obtain the binarized image corresponding to the target object; The binarized image is referenced according to the reference pointer corresponding to the binarized image; A morphological opening operation is performed on the referenced binarized image to obtain the target binarized image.

4. The method according to claim 1, characterized in that, The step of referencing the target binarized image based on the reference pointer corresponding to the target binarized image, and performing text identifier recognition on the referenced target binarized image to obtain the object number recognition result includes: The referenced target binarized image is subjected to vertical projection processing and horizontal projection processing respectively to obtain a first vertical projection histogram and a horizontal projection histogram; The second target threshold is determined based on the peak and valley values ​​of the first vertical projection histogram and the peak and valley values ​​of the horizontal projection histogram. Based on the second target threshold, text location region segmentation is performed in the referenced target binarized image to obtain the text recognition image; The text to be recognized image is referenced according to the reference pointer corresponding to the text to be recognized image; The referenced image to be identified is subjected to text identifier recognition to obtain the object number recognition result.

5. The method according to claim 4, characterized in that, The step of performing text identifier recognition on the referenced image to obtain the object number recognition result includes: The referenced image of the text to be recognized is vertically projected to obtain a second vertical projection histogram; Based on the third target threshold determined by the second vertical projection histogram, the referenced text recognition image is segmented into character position regions to obtain multiple character images to be recognized; Based on the reference pointer corresponding to each of the character images to be recognized, the corresponding character image to be recognized is referenced; the reference pointer corresponding to each character image to be recognized points to each template character image in the template character image set; The similarity between the referenced character image to be identified and each template character image is calculated to obtain the identification result corresponding to each character image to be identified; Based on the identification result corresponding to the number of each character image to be identified, the object number identification result corresponding to the target object is obtained.

6. An object information verification device, characterized in that, The device includes: The acquisition module is used to acquire the image to be identified obtained by taking a picture of the target object; The referencing module is used to reference the image data corresponding to the preset component according to the reference pointer corresponding to the preset component in the image to be identified; the preset component is the luminance component; the image data is the grayscale image to be identified corresponding to the image to be identified; The first identification module is used to perform text identifier recognition on the referenced image data to obtain the object number recognition result corresponding to the target object; The first recognition module is specifically used to statistically analyze the grayscale value distribution of the referenced grayscale image to be recognized, and obtain a grayscale histogram corresponding to the target object; according to a first target threshold determined based on the grayscale histogram, the referenced grayscale image to be recognized is binarized to obtain a target binarized image corresponding to the target object; the target binarized image is referenced according to a reference pointer corresponding to the target binarized image, and text identifier recognition is performed on the referenced target binarized image to obtain the object number recognition result; wherein, the target binarized image is a binarized image corresponding to the main region containing the text location area in the grayscale image to be recognized; The second identification module is used to identify the graphic code label on the surface of the target object and obtain the target object number corresponding to the target object. The verification module is used to obtain the verification result of the target object based on the actual object number represented by the object number identification result corresponding to the target object and the target object number corresponding to the target object.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Automatic identification and sorting device for products with identification codes

    CN105013719A

  • Label code consistency checking method and device

    CN109492448A