Product detection method and device, electronic equipment and storage medium
By using text information in product anti-counterfeiting data and macro-external geometric features of text in the image, the problem of image feature point comparison technology is solved, and the equipment cost and maintenance difficulty of high quality in high speed assembly line environment is achieved, and a fast and reliable product is achieved Testing, suitable for industrial production.
Patent Information
- Application Number
- CN202310674478.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2024-12-10
AI Technical Summary
Anti-counterfeiting technology based on image feature point comparison requires high-precision equipment and high-quality image acquisition, which leads to high equipment cost and difficult maintenance, making it difficult to apply in high-speed assembly line production environments.
Anti-counterfeiting detection is carried out using the uniqueness of text information in product anti-counterfeiting data and the macro external geometric features of text in the image, which reduces the requirements for image acquisition quality and can meet the needs using ordinary image acquisition equipment.
It realizes fast and reliable product inspection in a high-speed assembly line production environment, reduces equipment costs and maintenance difficulties, and is suitable for industrial production applications of a certain scale.
Smart Images

Figure CN119107093A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image detection and processing, and in particular to a product detection method, device, electronic device and storage medium. Background Art
[0002] Anti-counterfeiting technology based on image feature point comparison is a method of distinguishing authenticity by identifying special marks (feature points) in product images. This method uses a computer to process images, find unique points in them, and then compare these points with images of authentic products. If the found feature points are very similar to the authentic product, then the product is considered to be authentic; otherwise, it is considered to be a fake. This technology can be applied to the anti-counterfeiting field of various products, such as high-end liquor. By comparing the feature points of product images, the authenticity of the product can be distinguished, thereby protecting the rights and interests of consumers and the reputation of the brand.
[0003] However, the method based on image feature point comparison requires that the shooting quality of the original image is very high, which requires high-precision equipment and high-quality image acquisition technology, resulting in high equipment costs and difficulty in daily maintenance. Summary of the invention
[0004] The purpose of the present disclosure is to provide a product detection method, device, electronic device and storage medium, which can reduce the requirements for image acquisition quality while ensuring detection accuracy, thereby reducing the cost and maintenance difficulty of the acquisition equipment.
[0005] An embodiment of the present disclosure provides a product detection method, in which the original anti-counterfeiting data of the product is stored in an anti-counterfeiting database of the product, and the method comprises: obtaining an actual anti-counterfeiting image of the product to be inspected; processing the actual anti-counterfeiting image to obtain actual text areas of each group of text information contained in the actual anti-counterfeiting image; obtaining circumscribed geometric figures of the actual text areas of each group of text information; obtaining circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected from the anti-counterfeiting database; and performing product authenticity detection according to the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data.
[0006] In a second aspect, an embodiment of the present disclosure further provides a product detection device, in which the original anti-counterfeiting data of the product is stored in an anti-counterfeiting database of the product, and the device comprises: an image acquisition module, used to acquire the actual anti-counterfeiting image of the product to be inspected; a text area acquisition module, used to process the actual anti-counterfeiting image to obtain the actual text areas of each group of text information contained in the actual anti-counterfeiting image; a geometric figure acquisition module, used to acquire the circumscribed geometric figures of the actual text areas of each group of text information; an information acquisition module, used to acquire the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected from the anti-counterfeiting database; and a product detection module, used to perform product authenticity detection according to the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data.
[0007] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the above-mentioned product detection method.
[0008] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned product detection method.
[0009] The disclosed embodiments provide a product detection method, device, electronic device and storage medium. Through the uniqueness of the text information in the product anti-counterfeiting data, the anti-counterfeiting data can be prevented from being counterfeited to a certain extent. At the same time, the authenticity of the product can be detected based on the macroscopic comparison of the external geometric figures of the area occupied by the text information. No detailed feature information of the image is required, so the requirements for image shooting quality are relatively low. Ordinary image acquisition equipment can meet the shooting requirements, and it can be used to quickly capture images in operation scenes such as assembly lines. At the same time, the macroscopic comparison of this geometric figure is fast and reliable, which can meet the product detection needs to a certain extent. The cost and maintenance cost of ordinary image acquisition equipment are low, and it is suitable for the production and application of industrial products of a certain scale. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0011] Figure 1A flowchart of a product detection method provided by an embodiment of the present disclosure;
[0012] Figure 2 A partial schematic diagram of an original anti-counterfeiting image provided by an embodiment of the present disclosure;
[0013] Figure 3 A schematic diagram of three groups of text information of an original anti-counterfeiting image provided by an embodiment of the present disclosure;
[0014] Figure 4 A schematic diagram of three groups of text information of another original anti-counterfeiting image provided by an embodiment of the present disclosure;
[0015] Figure 5 A flowchart of another product detection method provided by an embodiment of the present disclosure;
[0016] Figure 6 A schematic diagram for comparing geometric figures provided in an embodiment of the present disclosure;
[0017] Figure 7 A schematic diagram of the structure of a product detection device provided in an embodiment of the present disclosure;
[0018] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] The technical solution of the present disclosure will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure.
[0020] Traditional anti-counterfeiting technologies such as secret engraving and RFID anti-counterfeiting all have the risk of being cracked and cannot meet the market's demand for high-security anti-counterfeiting. Anti-counterfeiting technologies based on image feature point comparison are difficult to crack, but because this technology requires the image feature points to be compared during the comparison process, it has very high requirements on the image shooting quality. In a high-speed assembly line production environment, it is difficult to acquire high-quality images, and the cost of image acquisition equipment is high. Therefore, anti-counterfeiting technologies based on image feature point comparison are difficult to apply in a high-speed assembly line production environment. Based on this, the embodiments of the present disclosure provide a product detection method, device, electronic device, and storage medium. This technology utilizes the unique anti-counterfeiting information of the text content in the image, combined with the macroscopic external geometric features of the text in the image for anti-counterfeiting detection. On the basis of ensuring the difficulty of image imitation and the accuracy of anti-counterfeiting detection, it reduces the difficulty of image acquisition and is more suitable for a high-speed assembly line production environment.
[0021] An embodiment of the present disclosure provides a product detection method, in which the anti-counterfeiting database of the product stores the original anti-counterfeiting data of the product. The original anti-counterfeiting data may be data corresponding to an original anti-counterfeiting image. As a possible implementation mode, the data may include at least two groups of text information. These groups of text information may be texts of the same type, for example, all are watermark texts, or all are inkjet coded texts, or these groups of text information may be texts of different types, one part of which is watermark text and the other part is inkjet coded text.
[0022] The anti-counterfeiting database can be stored in an electronic device or a cloud server. The execution subject of the product detection method of this embodiment can be an electronic device on the terminal side or a cloud server on the network side. If the anti-counterfeiting database is stored in a cloud server and the execution subject of the product detection method is an electronic device, when the electronic device uses the data in the anti-counterfeiting database, it can access the cloud server through the network. Figure 1 A flow chart of a product detection method is shown, the method comprising:
[0023] Step S102, obtaining an actual anti-counterfeiting image of the product to be inspected.
[0024] The product to be inspected can be a bottle-shaped object or other object on the assembly line. The actual anti-counterfeiting image can be obtained through image acquisition devices such as cameras set up on the assembly line, and the acquired actual anti-counterfeiting image can be uploaded to the cloud service or the electronic device on the assembly line side.
[0025] The above-mentioned anti-counterfeiting image (actual anti-counterfeiting image) is bound to the product, and there is no regularity between the anti-counterfeiting images of each product. The anti-counterfeiting image of each product is different, so it is difficult for counterfeiters to copy the image in batches. Copying the product image of each product one by one will undoubtedly make it very difficult to counterfeit. Therefore, the anti-counterfeiting information based on the anti-counterfeiting image avoids counterfeiting and other operations to a certain extent.
[0026] The above-mentioned original anti-counterfeiting data may include an original anti-counterfeiting image, that is, an anti-counterfeiting image on the product when the product is produced, and the anti-counterfeiting image is relatively clear and complete. The acquisition method of the actual anti-counterfeiting image and the acquisition method of the original anti-counterfeiting image may be the same, and the actual anti-counterfeiting image and the original anti-counterfeiting image may have the same image size, that is, have the same image resolution, to facilitate subsequent detection operations. If the image sizes of the two are different, the actual anti-counterfeiting image may be scaled by image transformation so that the actual anti-counterfeiting image after scaling has the same size as the original anti-counterfeiting image.
[0027] Step S104: Process the actual anti-counterfeiting image to obtain the actual text area of each group of text information contained in the actual anti-counterfeiting image.
[0028] In the process of processing the actual anti-counterfeiting image, a suitable image processing method can be selected according to actual needs, such as performing noise reduction and text information detection processing on the actual anti-counterfeiting image, or directly performing text content recognition and positioning detection processing on the actual anti-counterfeiting image to obtain the actual text area of each group of text information contained in the actual anti-counterfeiting image.
[0029] As a possible implementation, the above-mentioned processing of the actual anti-counterfeiting image to obtain the actual text area of each group of text information contained in the actual anti-counterfeiting image includes: performing text content recognition and positioning detection processing on the actual anti-counterfeiting image to obtain the actual text area of each group of text information contained in the actual anti-counterfeiting image. Among them, the above-mentioned text content recognition process can use a text recognition algorithm (such as OCR, optical character recognition) to recognize different text contents in the image; specifically, it can be implemented by a deep learning method, such as Convolutional Neural Networks (CNN) or Recurrent Neural Network (RNN). The above-mentioned positioning detection can use a text detection algorithm to accurately locate the location of the text in the image. Common text detection algorithms include CTPN (Connectionist Text Proposal Network), EAST (Efficient and Accurate Scene Text Detector, efficient and accurate scene text detector), etc. These algorithms can effectively detect the text area in the image and provide a basis for subsequent image detection.
[0030] Step S106, obtaining the circumscribed geometric figures of the actual text area of each group of text information.
[0031] After obtaining the actual text area of each group of text information, a circumscribed geometric figure can be drawn according to the outermost edge of the actual text area of each group of text information. Among them, the circumscribed geometric figure of the text information refers to a geometric figure composed of lines surrounding the text information, and the circumscribed geometric figure of a group of text information is usually a figure corresponding to the outer edge of the area where the group of text information is located. Taking the area occupied by the text as a rectangle as an example, it can be achieved by calculating the circumscribed rectangle of the actual text area. The circumscribed rectangle can be calculated by solving the maximum or minimum coordinate value of the pixel points in the actual text area, so that the area occupied by the text information is represented on the actual anti-counterfeiting image through the circumscribed rectangle.
[0032] Step S108, obtaining the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected from the anti-counterfeiting database.
[0033] The original anti-counterfeiting data in the anti-counterfeiting database corresponds one-to-one to the product, and each product can be represented by a product identification (ID). Therefore, the target original anti-counterfeiting data can be searched from the anti-counterfeiting database according to the ID of the product to be inspected, and then the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data can be obtained.
[0034] The anti-counterfeiting database may also store circumscribed geometric figures of each group of text information in at least two groups of text information included in the original anti-counterfeiting data. In this embodiment, each group of text information corresponds to a circumscribed geometric figure. Figure 2 The partial schematic diagram of an original anti-counterfeiting image shown in the figure contains four groups of text information. The largest rectangle surrounds the string: 20230512 2022-070AS005658 and the word "Moutai". This information is a coded text. Each number in the text is composed of a 5*8 ink dot array. The ink dots of each number have certain differences and are difficult to be counterfeited. The small rectangle inside the rectangle (behind the Moutai text) contains a group of watermark texts. The lower left corner (where "TAI" is located) and the lower right corner (where "Moutai" is located) of the rectangle are also watermark texts, which are surrounded by rectangles respectively.
[0035] Figure 3 The diagram shows three groups of text information of an original anti-counterfeiting image, wherein three rectangular frames are used to identify circumscribed geometric figures of the three groups of text information, and the areas where the three groups of text information are located overlap each other.
[0036] As a possible implementation, the anti-counterfeiting database may not store the circumscribed geometric figures of the text information. In this way, the anti-counterfeiting database may store the position information of each group of text information in at least two groups of text information included in the original anti-counterfeiting data. The position information may be the coordinate information of the designated point corresponding to each group of text information. The circumscribed geometric figures of the group of text information may be determined based on the coordinate information of the designated point corresponding to the group of text information. In actual use, the circumscribed geometric figures of each group of text information may be calculated in real time based on the position information of each group of text information. Compared with the circumscribed geometric figures of the text information, the position information of the text information in this storage method reduces the amount of data in the anti-counterfeiting database to a certain extent.
[0037] Among the groups of text information contained in the above-mentioned actual anti-counterfeiting image, there may be at least one group of text information that can play an anti-counterfeiting role and also play a role in identifying the identity of the product. Therefore, based on this group of text information, the target original anti-counterfeiting data can be found from the anti-counterfeiting database, and then the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data can be obtained.
[0038] Based on the above-mentioned method of searching the anti-counterfeiting database, obtaining the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected from the anti-counterfeiting database includes: querying the anti-counterfeiting database according to each group of text information contained in the actual anti-counterfeiting image or according to the product identification code of the actual anti-counterfeiting image, and obtaining the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected. If the circumscribed geometric figures corresponding to the text information are stored in the anti-counterfeiting database, the circumscribed geometric figures of the above-mentioned groups of text information can be directly read from the target original anti-counterfeiting data in the anti-counterfeiting database. If the circumscribed geometric figures of the text information are not stored in the anti-counterfeiting database, the circumscribed geometric figures of the text information are calculated according to the position information of the text information in the target original anti-counterfeiting data.
[0039] Step S110 , performing product authenticity detection according to the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data.
[0040] Taking the target original anti-counterfeiting data as the data corresponding to the target original anti-counterfeiting image as an example, the circumscribed geometric figures of the text information in the above actual anti-counterfeiting image and the target original anti-counterfeiting image can both be rectangles, or other geometric figures, such as Figure 4 A schematic diagram of three groups of text information of another original anti-counterfeiting image is shown, wherein the area occupied by the first group of text information is a sector-shaped area, the area where the second group of text information is located is an elliptical area, and the area occupied by the third group of text information is a rectangular area. Therefore, the circumscribed geometric figure of the first group of text information is a sector, the circumscribed geometric figure of the second group of text information is an ellipse, and the circumscribed geometric figure of the third group of text information is a rectangle. The sector of the first group of text information and the ellipse of the second group of text information overlap with each other, and the rectangle of the third group of text information has no intersection with the above-mentioned sectors and ellipses.
[0041] If the circumscribed geometric figures corresponding to the above-mentioned actual anti-counterfeiting image and the circumscribed geometric figures corresponding to the target original anti-counterfeiting data are similar, then the actual anti-counterfeiting image and the target original anti-counterfeiting data are also similar. Therefore, the authenticity of the above-mentioned product to be inspected can be determined based on the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures corresponding to each group of text information in the target original anti-counterfeiting data.
[0042] The above method can prevent the counterfeiting of anti-counterfeiting data to a certain extent through the uniqueness of the text information in the product anti-counterfeiting data. At the same time, the authenticity of the product is detected based on the macro comparison of the external geometric figures in the area occupied by the text information. No detailed feature information of the image is required, so the image shooting quality requirements are relatively low. Ordinary image acquisition equipment can meet the shooting requirements and can be used for fast image acquisition in operation scenes such as assembly lines. At the same time, the macro comparison of this geometric figure is fast and reliable, which can meet the product detection needs to a certain extent. The cost and maintenance cost of ordinary image acquisition equipment are low, which is suitable for the production and application of industrial products of a certain scale.
[0043] In order to further improve the security of the image, at least one of the at least two groups of text information is added with random anti-counterfeiting information, and the random anti-counterfeiting information may be random watermark information, random ink dot information, or random lines or random patterns added to the text information, and the embodiments of the present disclosure do not limit this. By adding random anti-counterfeiting information to the area where the text information is located, each product can be provided with different random anti-counterfeiting information. These random anti-counterfeiting information have no regularity, and it is difficult for counterfeiters to copy the products one by one, making it more difficult to copy the image, thereby improving the security of the product.
[0044] In order to simplify the image generation process while ensuring image security, the at least two sets of text information include at least one set of random watermark text and at least one set of inkjet text; wherein the characters in the inkjet text form a string that identifies the product identity. The combination of random watermark text and inkjet text can further enhance the anti-counterfeiting performance of the above image.
[0045] The above-mentioned inkjet coded text can have the uniqueness of identifying the product identity and can also have the randomness of the anti-counterfeiting function. The characters in the inkjet coded image are composed of ink dots, and the arrangement of the ink dots that make up the same number, the same letter or the same symbol or the size of the ink dots may be different. This difference can further enhance the anti-counterfeiting performance of the image.
[0046] The above anti-counterfeiting image may also include multiple groups of coded texts, among which only one group of coded texts may be used to identify the identity of the product, and the other groups of coded texts are used for anti-counterfeiting functions and / or to identify other information of the product, such as the brand name, origin or taste of the product.
[0047] In order to improve the accuracy of the circumscribed geometric figure, the above-mentioned obtaining the circumscribed geometric figure of the actual text area of each group of text information includes: determining the circumscribed geometric figure of each group of text information according to the preset shape corresponding to each group of text information and the actual text area of each group of text information. The above-mentioned preset shape can be a rectangle, a circle, a sector, a triangle, etc. According to actual application needs, different texts can correspond to different preset shapes, so that Figure 4 For example, the preset shape corresponding to the first group of text information is a sector, so after determining the area occupied by the first group of text information, drawing the area in a sector will more accurately represent the area occupied by the first group of text information. Through the preset shape corresponding to the text information and the actual text area of the text information, the circumscribed geometric figure of each group of text information can be accurately determined.
[0048] As a possible implementation, the above-mentioned determination of the circumscribed geometric figures of each group of text information according to the preset shapes corresponding to each group of text information and the actual text area of each group of text information includes: when the preset shapes corresponding to each group of text information are all rectangles, the circumscribed rectangles corresponding to each group of text information are determined according to the extreme coordinates of the pixel points in the actual text area of each group of text information. The extreme coordinates of the pixel points may include the pixel point coordinates corresponding to the maximum or minimum value of the horizontal coordinate, and may also include the pixel point coordinates corresponding to the maximum or minimum value of the vertical coordinate.
[0049] The above-mentioned circumscribed rectangle can calculate and draw a rectangular box representing the area occupied by each text according to the outermost edge of the text area. The specific method is as follows: by finding the maximum and minimum coordinates (x, y) of the pixel points in the text area, find the outermost edge (bounding box) of the text area; then calculate the coordinates of the four vertices of the rectangular box according to the position and size of the bounding box. Generally, the upper left, lower left, lower right, and upper right points are used to represent the rectangle. Finally, the calculated rectangular box is drawn on the original image (i.e., the actual anti-counterfeiting image mentioned above). When drawing a rectangle, you can also choose different colors and line widths to distinguish different text areas in order to better display and visualize the results.
[0050] The above-mentioned use of a rectangle as the circumscribed geometric figure of the text information is simple to implement, and the circumscribed geometric figures of each group of text information determined thereby will be more accurate.
[0051] As a possible implementation, the above-mentioned target original anti-counterfeiting data includes the target original anti-counterfeiting image. Accordingly, according to the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data, the product authenticity detection includes: calculating the geometric similarity parameters of the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting image; wherein the geometric similarity parameters include at least one of the following: structural similarity parameters, Euclidean distance, correlation coefficient of corresponding points and distance error rate between corresponding points; determining the similarity between the actual anti-counterfeiting image and the target original anti-counterfeiting image according to the calculated geometric similarity parameters; determining the authenticity of the product to be inspected according to the similarity. wherein the above-mentioned structural similarity parameters are usually determined by the local mean, local variance and local covariance between the circumscribed geometric figures. the above-mentioned Euclidean distance is usually determined by calculating the distance between corresponding points in two geometric figures to determine their similarity. the above-mentioned correlation coefficient of corresponding points is usually determined by calculating the correlation coefficient of the distance between corresponding points in two geometric figures to determine their similarity. The error rate between the corresponding points is usually calculated by calculating the error rate of the distance between the corresponding points in two geometric figures to determine their similarity.
[0052] By using the geometric similarity parameters corresponding to the above-mentioned circumscribed geometric figures, the similarity between the actual anti-counterfeiting image and the target original anti-counterfeiting image can be determined relatively accurately, thereby determining the authenticity of the product to be inspected.
[0053] See also Figure 5 A flow chart of another product detection method shown in FIG. 1 , the method comprising:
[0054] Step S502: Acquire the actual anti-counterfeiting image of the product to be inspected.
[0055] Step S504: performing text content recognition and location detection on the actual anti-counterfeiting image to obtain the actual text areas of each group of text information contained in the actual anti-counterfeiting image.
[0056] Step S506, obtaining the circumscribed geometric figures of the actual text area of each group of text information.
[0057] Step S508: searching the anti-counterfeiting database for circumscribed geometric figures of each group of text information in the target original anti-counterfeiting image according to each group of text information contained in the actual anti-counterfeiting image.
[0058] The above steps S502 to S508 can be implemented with reference to the above steps S102 to S108, which will not be repeated here.
[0059] Step S510, drawing circumscribed geometric figures corresponding to each group of text information in the same image template; wherein the image template has the same size as the actual anti-counterfeiting image.
[0060] In this embodiment, based on the circumscribed geometric figures of the actual text area that have been determined, the circumscribed geometric figures of the actual text area of different text information are superimposed. For example, the edges of the circumscribed geometric figures can be superimposed at the pixel level through image processing technology, thereby generating a composite image containing multiple circumscribed geometric figures. Specifically, the process of drawing each circumscribed geometric figure in the image template can be as follows:
[0061] First, a blank image is initialized as an image template, whose size is equal to the original anti-counterfeiting image or the actual anti-counterfeiting image. Usually, the image template is a completely black or completely white image, and the image template is used to store the superposition result of the external geometric figure.
[0062] Second, traverse all external geometric figures, and perform the following operations for each external geometric figure of the determined text; on the image template, draw the corresponding external geometric figure according to the position and size information of the external geometric figure. Usually, the edge of the external geometric figure can be represented by a specific color or pixel value to facilitate distinction and synthesis. Overlay the current external geometric figure with the drawn external geometric figure at the pixel level. In actual operation, the functions provided by the image processing library (such as OpenCV, PIL, etc.) can be used to achieve pixel-level overlay.
[0063] Third, repeat the above step 2: traverse and process all external geometric figures, superimpose them on the image template, and obtain a composite image containing various external geometric figures.
[0064] The process of steps 1 to 3 above is also applicable to the processing of the original anti-counterfeiting image. Through the above process, the circumscribed geometric figure of the original anti-counterfeiting image stored in the anti-counterfeiting database can be presented in the form of a synthetic image. Of course, if the above steps 1 to 3 are not performed, the circumscribed geometric figure can also be directly drawn in the original anti-counterfeiting image or the actual anti-counterfeiting image.
[0065] As a possible implementation, the above-mentioned drawing of the circumscribed geometric figures corresponding to each group of text information in the same image template includes: using the line colors corresponding to each group of text information, the circumscribed geometric figures of each group of text information are drawn in the same image template. Different line colors can more intuitively distinguish the areas occupied by different texts, making different circumscribed geometric figures more obvious. In the case where the lines of different circumscribed geometric figures are superimposed, the pixel value of the superimposed point can be the average of the pixel values of the two lines, or the maximum or minimum value of the pixel values of the two lines.
[0066] Step S512, determining the similarity between the actual anti-counterfeiting image and the target original anti-counterfeiting image based on the circumscribed geometric figures in the image template and the circumscribed geometric figures corresponding to each group of text information in the target original anti-counterfeiting image, and determining the authenticity of the product to be inspected based on the similarity.
[0067] The above step S512 may include, when implemented specifically: obtaining the first positional relationship between the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the second positional relationship between the circumscribed geometric figures corresponding to each group of text information in the target original anti-counterfeiting image; wherein the first positional relationship and the second positional relationship include at least one of the following: the distance between the circumscribed geometric figures, the number of intersections between the circumscribed geometric figures and the coordinates of the intersections, and the relative positional information of the corresponding points between the circumscribed geometric figures; determining the similarity between the actual anti-counterfeiting image and the target original anti-counterfeiting image based on the first positional relationship and the second positional relationship, and determining the authenticity of the product to be inspected based on the similarity. Based on the positional relationship between the circumscribed geometric figures, the similarity between the circumscribed geometric figures containing text information of the two images can be quickly determined from a macroscopic perspective, thereby accurately determining the similarity between the two images and the authenticity of the product to be inspected.
[0068] In the following example, the rectangular composite image to be verified (the composite image of the rectangle corresponding to the above-mentioned actual anti-counterfeiting image) is used to compare the similarity with the composite image of the rectangle of the known authentic product (i.e., the above-mentioned target original anti-counterfeiting image). This embodiment evaluates the similarity between the two images by calculating the structural similarity index (SSIM). The details are as follows:
[0069] The composite image of the rectangle corresponding to the actual anti-counterfeiting image to be verified (hereinafter referred to as image A) and the composite image of the rectangle of the target original anti-counterfeiting image (hereinafter referred to as image B) are preprocessed. The preprocessing may include converting both image A and image B into grayscale images, scaling them to the same size, etc., to facilitate subsequent calculations. The local mean, local variance, and local covariance are calculated on image A and image B, respectively. These statistical information will be used to evaluate the brightness, contrast, and structural similarity between the two images.
[0070] SSIM is calculated using the following formula:
[0071] SSIM(x,y)=[(2*μ x *μ y +C1)*(2*σ xy +C2)] / [(μ x ^2+μ y ^2+C1)*
[0072] (σ x ^2+σ y ^2+C2)]
[0073] Where x and y represent the local windows in image A and image B respectively (i.e., the local areas in the two images), μ x and μ y is the local mean corresponding to the above local window, σ x ^2 and σ y ^2 is the local variance corresponding to the above local window, σ xy is the local covariance corresponding to the above local window, C1 and C2 are constant terms (used to prevent the denominator from being zero).
[0074] The SSIM values of all local windows on image A and image B are averaged to obtain the final SSIM value. This value is between -1 and 1. The closer it is to 1, the more similar the two images are. According to the result of the image similarity index, a threshold is set, for example, 0.8. If the SSIM similarity exceeds the threshold, the product corresponding to the actual anti-counterfeiting image is judged to be a genuine product; otherwise, the product corresponding to the actual anti-counterfeiting image is judged to be a fake product. See Figure 6 The geometric figures shown are compared schematically. Figure 6 The figure above is a schematic diagram of the external geometric figure corresponding to the actual anti-counterfeiting image. Figure 6 The figure below is a schematic diagram of the circumscribed geometric figure corresponding to the target original anti-counterfeiting image. Since the positional relationship (intersection position) of the circumscribed geometric figure of the second set of text information in the two figures is different from that of the circumscribed geometric figure of the first set of text information, the two are not similar. Therefore, the comparison result shows that the product corresponding to the actual anti-counterfeiting image is a fake.
[0075] The above method can prevent the imitation of the image to a certain extent through the uniqueness of the text information on the product anti-counterfeiting image. At the same time, the method of drawing the external geometric figure of the area occupied by the text information in the image in the image template can more flexibly select the comparison parameters when comparing the external geometric image. This method of macroscopic comparison of geometric figures to detect the authenticity of the product does not require detailed feature information of the image, so the image shooting quality requirements are relatively low. Ordinary image acquisition equipment and high-resolution image acquisition equipment can meet the shooting requirements, so it is suitable for rapid image acquisition in operation scenes such as assembly lines. At the same time, the macroscopic comparison of this geometric figure is fast and reliable, which can meet the product detection needs to a certain extent. Because the cost and maintenance cost of ordinary image acquisition equipment are low, it is suitable for the production and application of industrial products of a certain scale.
[0076] The above-mentioned product may be a bottle-shaped object, the original anti-counterfeiting data is the data corresponding to the image on the bottle cap of the bottle-shaped object, and the actual anti-counterfeiting image is the image on the bottle cap of the bottle-shaped object, which can play a role in product identification and anti-counterfeiting. The above-mentioned product may specifically be a bottle-shaped object such as white wine or red wine. These bottle-shaped objects have a relatively fast transmission speed in an assembly line environment. If an image feature comparison method is adopted, the image acquisition device needs to be able to capture the detailed information of the image, which places high requirements on the quality of the image acquisition device. The comparison method of the macroscopic external geometric figures in the embodiment of the present disclosure does not require the detailed information of the image, so the quality requirements of the image acquisition device are lower, thereby reducing the rigid requirements and maintenance difficulty of the assembly line image acquisition device, improving the stability of the equipment operation, simplifying the comparison process, increasing the speed of the comparison, and increasing the economy of the anti-counterfeiting solution.
[0077] Taking the application of the above-mentioned detection method to image anti-counterfeiting on the white wine rubber cap as an example, compared with the image feature point comparison method, the detection technology of the embodiment of the present disclosure has low requirements for image acquisition quality, reduces the difficulty of image acquisition, and is more suitable for high-speed assembly line production environment. Image feature point comparison technology requires high-precision equipment and high-quality image acquisition, which leads to high equipment costs, low equipment stability, and difficulty in daily maintenance. The detection technology of the embodiment of the present disclosure has more advantages in equipment requirements and maintenance difficulty because of its low requirements for image acquisition quality. At the same time, the technology has good stability and reliability, and is suitable for popularization and application.
[0078] Corresponding to the above method, the embodiment of the present disclosure also provides a product detection device, the anti-counterfeiting database of the product stores the original anti-counterfeiting data of the product, the device can be set on the electronic device on the terminal side, can be set on the server on the network side, see Figure 7 , the device includes the following modules:
[0079] An image acquisition module 71 is used to acquire an actual anti-counterfeiting image of the product to be inspected;
[0080] A text region acquisition module 72 is used to process the actual anti-counterfeiting image to obtain the actual text region of each group of text information contained in the actual anti-counterfeiting image;
[0081] A geometric figure acquisition module 73, used for acquiring the circumscribed geometric figure of the actual text area of each group of text information;
[0082] The information acquisition module 74 is used to acquire the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the above-mentioned product to be inspected from the anti-counterfeiting database;
[0083] The product detection module 75 is used to perform product authenticity detection based on the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data.
[0084] The above device can prevent the counterfeiting of anti-counterfeiting data to a certain extent through the uniqueness of the text information in the product anti-counterfeiting data. At the same time, it detects the authenticity of the product based on the macro comparison of the external geometric figures in the area occupied by the text information. No detailed feature information of the image is required, so the image shooting quality requirements are relatively low. Ordinary image acquisition equipment can meet the shooting requirements, and it can be used for fast image acquisition in operation scenes such as assembly lines. At the same time, the macro comparison of this geometric figure is fast and reliable, which can meet the product detection needs to a certain extent. The cost and maintenance cost of ordinary image acquisition equipment are low, and it is suitable for the production and application of industrial products of a certain scale.
[0085] As a possible implementation, the original anti-counterfeiting data includes at least two groups of text information, and accordingly, the original anti-counterfeiting data also includes position information of the at least two groups of text information. Alternatively, the original anti-counterfeiting data includes at least two groups of text information, and the anti-counterfeiting database also stores circumscribed geometric figures of each group of text information in the at least two groups of text information included in the original anti-counterfeiting data.
[0086] At least one of the at least two sets of text information is added with random anti-counterfeiting information. By adding random anti-counterfeiting information in the area where the text information is located, each product can be provided with different random anti-counterfeiting information. These random anti-counterfeiting information have no regularity, and it is difficult for counterfeiters to copy the products one by one, making it more difficult to copy the image, thereby improving the safety of the product.
[0087] The at least two sets of text information include at least one set of random watermark text and at least one set of inkjet text; wherein the characters in the inkjet text form a string that identifies the product identity. The combination of random watermark text and inkjet text can further enhance the anti-counterfeiting performance of the above image.
[0088] The geometric figure acquisition module 73 is also used to determine the circumscribed geometric figures of each group of text information according to the preset shapes corresponding to each group of text information and the actual text area of each group of text information. The circumscribed geometric figures of each group of text information can be accurately determined by the preset shapes corresponding to the text information and the actual text area of the text information.
[0089] The geometric figure acquisition module 73 is also used to determine the circumscribed rectangles corresponding to the respective groups of text information according to the extreme coordinates of the pixel points in the actual text area of the respective groups of text information when the preset shapes corresponding to the respective groups of text information are rectangles. Using a rectangle as the circumscribed geometric figure of the text information is simple to implement, and the circumscribed geometric figure of the respective groups of text information determined will be more accurate.
[0090] The geometric figure acquisition module 73 is also used to draw the circumscribed geometric figures corresponding to the groups of text information in the same image template; wherein the image template is the same size as the actual anti-counterfeiting image. The method of drawing the circumscribed geometric figures of the area occupied by the text information in the image in the image template can more flexibly select the comparison parameters when comparing the circumscribed geometric figures. This method of macroscopic comparison of geometric figures to detect the authenticity of products does not require detailed feature information of the image, so it has low requirements on the image shooting quality.
[0091] The geometric figure acquisition module 73 is also used to use the line colors corresponding to the groups of text information to draw the circumscribed geometric figures of the groups of text information in the same image template. The marking method of different colors is more intuitive.
[0092] The above-mentioned target original anti-counterfeiting data includes the target original anti-counterfeiting image. Accordingly, the product detection module 75 is also used to obtain the first positional relationship between the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the second positional relationship between the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting image; the first positional relationship and the second positional relationship include at least one of the following: the distance between the circumscribed geometric figures, the number of intersections between the circumscribed geometric figures and the coordinates of the intersections, and the relative position information of the corresponding points between the circumscribed geometric figures; the similarity between the actual anti-counterfeiting image and the target original anti-counterfeiting image is determined according to the first positional relationship and the second positional relationship, and the authenticity of the product to be inspected is determined according to the similarity. Based on the positional relationship between the circumscribed geometric figures, the similarity between the circumscribed geometric figures containing text information of the two images can be quickly determined from a macroscopic perspective, and then the similarity between the two images and the authenticity of the product to be inspected can be accurately determined.
[0093] The above-mentioned target original anti-counterfeiting data includes the target original anti-counterfeiting image. Accordingly, the product detection module 75 is also used to calculate the geometric similarity parameters of the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting image; wherein the geometric similarity parameters include at least one of the following: structural similarity parameters, Euclidean distance, correlation coefficient of corresponding points and distance error rate between corresponding points; the similarity between the actual anti-counterfeiting image and the target original anti-counterfeiting image is determined according to the calculated geometric similarity parameters, and the authenticity of the product to be inspected is determined according to the similarity. Through the geometric similarity parameters corresponding to the above-mentioned circumscribed geometric figures, the similarity between the actual anti-counterfeiting image and the target original anti-counterfeiting image and the authenticity of the product to be inspected can be determined more accurately.
[0094] As a possible implementation, the text area acquisition module 72 is also used to perform text content recognition and positioning detection processing on the actual anti-counterfeiting image to obtain the actual text area of each group of text information contained in the actual anti-counterfeiting image. Through text content recognition and positioning detection processing, the actual text area of each group of text information can be determined more accurately.
[0095] As a possible implementation, the information acquisition module 74 is further used to query the anti-counterfeiting database according to each group of text information contained in the actual anti-counterfeiting image or according to the product identification code of the actual anti-counterfeiting image, and obtain the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected. By querying the anti-counterfeiting database through text information or product identification code, the target original anti-counterfeiting data can be obtained very conveniently, and then the circumscribed geometric figures of the text information in the data can be quickly obtained.
[0096] The above-mentioned product is a bottle-shaped object, the original anti-counterfeiting data is the data corresponding to the image on the bottle cap of the bottle-shaped object, and the actual anti-counterfeiting image is the image on the bottle cap of the bottle-shaped object.
[0097] The product detection device provided in the embodiment of the present disclosure has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the product detection device, reference may be made to the corresponding contents in the aforementioned product detection method embodiment.
[0098] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0099] The present disclosure also provides an electronic device, such as Figure 8 FIG. 1 is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 81 and a memory 80, the memory 80 stores computer executable instructions that can be executed by the processor 81, and the processor 81 executes the computer executable instructions to implement the above-mentioned product detection method, as described above. Figure 1 and Figure 5 Corresponding methods, etc.
[0100] exist Figure 8 In the illustrated embodiment, the electronic device further includes a bus 82 and a communication interface 83 , wherein the processor 81 , the communication interface 83 and the memory 80 are connected via the bus 82 .
[0101] Among them, the memory 80 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 83 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 82 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 82 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0102] The processor 81 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 81 or the instruction in the form of software. The above processor 81 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiment of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 81 reads the information in the memory and completes the steps of the product detection method of the above embodiment in combination with its hardware, as described above. Figure 1 and Figure 5 The steps in the corresponding method.
[0103] The embodiments of the present disclosure also provide a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned product detection method. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.
[0104] The computer program products of the product detection method, device and electronic device provided in the embodiments of the present disclosure include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0105] Unless otherwise specifically stated, the relative steps, numerical expressions and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.
[0106] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0107] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0108] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A product detection method, characterized in that: The product anti-counterfeiting database stores original anti-counterfeiting data of the product, and the method comprises: Obtain the actual anti-counterfeiting image of the product to be inspected; Processing the actual anti-counterfeiting image to obtain actual text areas of each group of text information contained in the actual anti-counterfeiting image; Obtaining the circumscribed geometric figures of the actual text areas of each group of text information; Acquire, from the anti-counterfeiting database, circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected; Product authenticity detection is performed based on the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data.
2. The method according to claim 1, characterized in that The original anti-counterfeiting data includes at least two groups of text information, and the original anti-counterfeiting data also includes position information of the at least two groups of text information.
3. The method according to claim 1, characterized in that: The original anti-counterfeiting data includes at least two groups of text information, and the anti-counterfeiting database further stores circumscribed geometric figures of each group of text information in the at least two groups of text information.
4. The method according to claim 2 or 3, characterized in that: At least one of the at least two sets of text information is added with random anti-counterfeiting information.
5. The method according to claim 2 or 3, characterized in that: The at least two groups of text information include at least one group of random watermark text and at least one group of coded text; wherein the characters in the coded text constitute a character string that identifies the identity of the product.
6. The method according to claim 1, characterized in that The circumscribed geometric figures of the actual text area for obtaining each set of text information include: The circumscribed geometric figures of each group of text information are determined according to the preset shapes corresponding to each group of text information and the actual text areas of each group of text information.
7. The method according to claim 6, characterized in that Determining the circumscribed geometric figures of each group of text information according to the preset shapes corresponding to each group of text information and the actual text areas of each group of text information includes: When the preset shapes corresponding to the groups of text information are all rectangles, the circumscribed rectangles corresponding to the groups of text information are determined according to the extreme coordinates of the pixel points in the actual text areas of the groups of text information.
8. The method according to claim 6, characterized in that The method further comprises: Draw circumscribed geometric figures corresponding to each group of text information in the same image template; wherein the image template is the same size as the actual anti-counterfeiting image.
9. The method according to claim 8, characterized in that Drawing the external geometric figures corresponding to each group of text information in the same image template includes: The circumscribed geometric figures of each group of text information are drawn in the same image template respectively using the line colors respectively corresponding to the groups of text information.
10. The method according to claim 1, characterized in that The target original anti-counterfeiting data includes a target original anti-counterfeiting image; and performing product authenticity detection according to the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data includes: Acquire a first positional relationship between circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and a second positional relationship between circumscribed geometric figures of each group of text information in the target original anti-counterfeiting image; the first positional relationship and the second positional relationship include at least one of the following: the distance between circumscribed geometric figures, the number of intersections between circumscribed geometric figures and the coordinates of the intersections, and the relative position information of corresponding points between circumscribed geometric figures; Determining the similarity between the actual anti-counterfeiting image and the target original anti-counterfeiting image according to the first position relationship and the second position relationship; The authenticity of the product to be inspected is determined according to the similarity.
11. The method according to claim 1, characterized in that: The target original anti-counterfeiting data includes a target original anti-counterfeiting image, and performing product authenticity detection according to the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data includes: Calculating geometric similarity parameters of the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting image; wherein the geometric similarity parameters include at least one of the following: structural similarity parameter, Euclidean distance, correlation coefficient of corresponding points and distance error rate between corresponding points; Determining the similarity between the actual anti-counterfeiting image and the target original anti-counterfeiting image according to the calculated geometric similarity parameter; The authenticity of the product to be inspected is determined according to the similarity.
12. The method according to claim 1, characterized in that The actual text area of each group of text information contained in the actual anti-counterfeiting image is obtained by processing the actual anti-counterfeiting image, including: The actual anti-counterfeiting image is subjected to text content recognition and location detection processing to obtain the actual text area of each group of text information contained in the actual anti-counterfeiting image.
13. The method according to claim 1, characterized in that Acquiring the external geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected from the anti-counterfeiting database includes: The anti-counterfeiting database is queried according to each group of text information contained in the actual anti-counterfeiting image or according to the product identification code of the actual anti-counterfeiting image to obtain the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected.
14. The method according to claim 1, characterized in that The product is a bottle-shaped object, the original anti-counterfeiting data is data corresponding to an image on a bottle cap of the bottle-shaped object; and the actual anti-counterfeiting image is an image on a bottle cap of the bottle-shaped object.
15. A product detection device, characterized in that: The product anti-counterfeiting database stores original anti-counterfeiting data of the product, and the device comprises: An image acquisition module, used to acquire the actual anti-counterfeiting image of the product to be inspected; A text region acquisition module, used for processing the actual anti-counterfeiting image to obtain the actual text region of each group of text information contained in the actual anti-counterfeiting image; A geometric figure acquisition module, used for acquiring the circumscribed geometric figures of the actual text areas of each group of text information; An information acquisition module, used for acquiring, from the anti-counterfeiting database, circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data corresponding to the product to be inspected; The product detection module is used to perform product authenticity detection based on the circumscribed geometric figures of each actual text area corresponding to the actual anti-counterfeiting image and the circumscribed geometric figures of each group of text information in the target original anti-counterfeiting data.
16. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 14.
