CN111932283A - Anti-counterfeiting detection method and device - Google Patents

Anti-counterfeiting detection method and device Download PDF

Info

Publication number
CN111932283A
CN111932283A CN202011001066.4A CN202011001066A CN111932283A CN 111932283 A CN111932283 A CN 111932283A CN 202011001066 A CN202011001066 A CN 202011001066A CN 111932283 A CN111932283 A CN 111932283A
Authority
CN
China
Prior art keywords
target
image
commodity
reference image
boundary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011001066.4A
Other languages
Chinese (zh)
Inventor
宋莉华
雷华
比佳·穆萨维
尹笑斐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dayu Dream Technology Co ltd
Original Assignee
Beijing Dayu Dream Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dayu Dream Technology Co ltd filed Critical Beijing Dayu Dream Technology Co ltd
Priority to CN202011001066.4A priority Critical patent/CN111932283A/en
Publication of CN111932283A publication Critical patent/CN111932283A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]

Abstract

The embodiment of the application discloses an anti-counterfeiting detection method and an anti-counterfeiting detection device, wherein the method comprises the following steps: acquiring a target image uploaded by a user, wherein the target image is obtained by shooting a to-be-detected commodity and comprises an identification code to be recognized and a reference line to be recognized on the to-be-detected commodity; calling a reference image corresponding to the to-be-detected commodity according to the identification code to be identified, wherein the reference image is obtained by shooting a legal commodity and comprises an anti-counterfeiting identification code and a reference line on the legal commodity; processing the target image based on the reference image corresponding to the reference image to obtain a target reference image; determining a target boundary and a reference line to be identified in a target reference image; determining a target reference distance according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified; and detecting whether the commodity to be detected is a legal commodity according to the target reference distance and the reference distance, wherein the reference distance is determined according to the reference boundary of the reference image and the reference line in the reference image.

Description

Anti-counterfeiting detection method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to an anti-counterfeit detection method and apparatus.
Background
Under the rapid development environment of economic society, commodities circulating on the market are increasingly abundant, illegal merchants are bred in the environment to counterfeit the commodities which are popular and sold on the market, once the fake commodities circulate on the market, huge economic loss can be brought to legal merchants, unqualified product quality can be caused due to the fact that the technology of the fake merchants is not excessive, and economic loss and even personal injury are brought to consumers purchasing the fake commodities.
In order to prevent counterfeit goods from circulating in the market, legal merchants usually take certain anti-counterfeiting measures. The two-dimension code anti-counterfeiting label is one of the most common anti-counterfeiting modes on the market at present, a legal merchant can stamp the two-dimension code anti-counterfeiting label on a commodity, a consumer can acquire information carried in the two-dimension code by scanning the two-dimension code, and then whether the purchased commodity is a legal commodity is judged according to the information carried in the two-dimension code.
For a counterfeit merchant, the two-dimensional code imprinted on a legal commodity can be completely copied, and then the two-dimensional code is imprinted on a pirated commodity, so that the counterfeit-proof check of a consumer is passed. Therefore, the anti-counterfeiting effect of the two-dimensional code anti-counterfeiting label is still not ideal enough at present, and illegal merchants cannot be effectively restrained from performing counterfeiting activities.
Disclosure of Invention
The embodiment of the application provides an anti-counterfeiting detection method and an anti-counterfeiting detection device, which improve the anti-counterfeiting precision to improve the counterfeiting cost of illegal merchants, thereby effectively inhibiting the illegal merchants from performing counterfeiting activities.
In view of the above, a first aspect of the present application provides an anti-counterfeit detection method, including:
acquiring a target image uploaded by a user; the target image is obtained by shooting a to-be-detected commodity, and the target image comprises an identification code to be identified and a reference line to be identified on the to-be-detected commodity;
calling a reference image corresponding to the to-be-detected commodity according to the to-be-identified identification code; the reference image is obtained by shooting a legal commodity, and the reference image comprises an anti-counterfeiting identification code and a reference line on the legal commodity;
processing the target image based on a reference image corresponding to the reference image to obtain a target reference image; the area corresponding to the target reference image is the same as the area corresponding to the reference image;
determining a target boundary of the target reference image and the reference line to be identified in the target reference image; determining a target reference distance according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified;
detecting whether the commodity to be detected is the legal commodity or not according to the target reference distance and the reference distance; the base reference distance is determined from a base boundary of the base reference image and a base reference line in the base reference image.
Optionally, the determining a target reference distance according to a distance between a pixel point on the target boundary and a pixel point on the reference line to be identified includes:
aiming at each boundary pixel point on the target boundary, determining a plurality of reference pixel points which are positioned on the reference line to be identified and are at the same horizontal position or the same vertical position as the boundary pixel point, and determining a reference distance corresponding to the boundary pixel point according to the respective distances from the plurality of reference pixel points to the boundary pixel point;
and determining the target reference distance according to the respective reference distances corresponding to the boundary pixel points on the target boundary.
Optionally, the determining the reference distance corresponding to the boundary pixel point according to the distance from each of the plurality of reference pixels to the boundary pixel point includes:
calculating a reference distance d corresponding to the boundary pixel point by the following formulaj
Figure BDA0002694323730000021
Wherein, wiIs the weight configured for the ith reference pixel point at the same horizontal position or the same vertical position as the boundary pixel point, djiThe distance between the boundary pixel point and the ith reference pixel point is obtained, and n is the number of the reference pixel points which are positioned at the same horizontal position or the same vertical position as the boundary pixel point;
the determining the target reference distance according to the respective reference distances corresponding to the boundary pixel points on the target boundary includes:
and calculating the average value of the reference distances corresponding to all boundary pixel points on the target boundary, and taking the average value as the target reference distance.
Optionally, the target boundary of the target reference image and the reference line to be identified in the target reference image are determined; determining a target reference distance according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified, comprising:
determining a plurality of target boundaries in the target reference image and a plurality of reference lines to be identified in the target reference image;
and determining a reference line to be identified corresponding to each target boundary, and determining a target reference distance corresponding to the target boundary according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified corresponding to the pixel point.
Optionally, the detecting whether the to-be-detected commodity is the legal commodity according to the target reference distance and the reference distance includes:
calculating a difference between the target reference distance and the benchmark reference distance;
if the difference value is within a preset difference value range, determining that the commodity to be detected is the legal commodity;
and if the difference value exceeds the preset difference value range, determining that the commodity to be detected is not the legal commodity.
Optionally, after the target image uploaded by the user is acquired, the method further includes:
judging whether the definition of the target image meets a preset definition standard or not;
if not, returning a prompt message for re-uploading the target image; if yes, continuing to execute the reference image corresponding to the to-be-detected commodity according to the to-be-identified identification code.
Optionally, after the target image uploaded by the user is acquired, the method further includes:
identifying the identification code to be identified in the target image to obtain target information;
judging whether reference information consistent with the target information exists in reference information prestored in a database; the reference information prestored in the database is information carried in the anti-counterfeiting identification code on the legal commodity;
if not, determining that the commodity to be detected is not the legal commodity; and if so, determining a reference image corresponding to the to-be-detected commodity according to the reference information consistent with the target information.
Optionally, the processing the target image based on the reference image corresponding to the reference image to obtain the target reference image includes:
performing rotation transformation processing on the target image based on the reference image to obtain a reference image with the same direction as the reference image;
and performing image cutting processing on the reference image to obtain the target reference image which comprises an interested area and has the same size as the standard reference image.
Optionally, after the target image uploaded by the user is acquired, the method further includes:
and filtering the light rays and the brightness of the target image and the reference image to enable the light rays and the brightness of the target image to be consistent with the light rays and the brightness of the reference image respectively.
This application second aspect provides an anti-counterfeiting detection device, the device includes:
the target image acquisition module is used for acquiring a target image uploaded by a user; the target image is obtained by shooting a to-be-detected commodity, and the target image comprises an identification code to be identified and a reference line to be identified on the to-be-detected commodity;
the reference image acquisition module is used for calling a reference image corresponding to the to-be-detected commodity according to the identification code to be identified; the reference image is obtained by shooting a legal commodity, and the reference image comprises an anti-counterfeiting identification code and a reference line on the legal commodity;
the target image processing module is used for processing the target image based on a reference image corresponding to the reference image to obtain a target reference image; the area corresponding to the target reference image is the same as the area corresponding to the reference image;
the target distance determining module is used for determining a target boundary of the target reference image and the reference line to be identified in the target reference image; determining a target reference distance according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified;
the commodity detection module is used for detecting whether the commodity to be detected is the legal commodity according to the target reference distance and the reference distance; the base reference distance is determined from a base boundary of the base reference image and a base reference line in the base reference image.
According to the technical scheme, the embodiment of the application has the following advantages:
in the anti-counterfeiting detection method provided by the embodiment of the application, the server can acquire a target image uploaded by a user, wherein the target image is obtained by shooting a to-be-detected commodity by using a terminal device, and comprises an identification code to be identified and a reference line to be identified on the to-be-detected commodity; then, calling a reference image corresponding to the to-be-detected commodity according to the to-be-identified identification code, wherein the reference image is obtained by shooting a legal commodity by a legal merchant and comprises an anti-counterfeiting identification code and a reference line on the legal commodity; then, processing the target image based on a reference image corresponding to the reference image to obtain a target reference image, wherein the area corresponding to the target reference image is the same as the area corresponding to the reference image; further, determining a target boundary and a reference line to be identified of a target reference image, and determining a target reference distance according to the distance between a pixel point on the target boundary and a pixel point on the reference line to be identified; and finally, detecting whether the commodity to be detected is a legal commodity or not according to the target reference distance and the reference distance, wherein the reference distance is determined according to the reference boundary of the reference image and the reference line, and the reference image corresponds to the reference image.
According to the method, the target reference distance corresponding to the target image uploaded by the user and the reference distance corresponding to the reference image uploaded by the legal merchant are determined through pixel-level distance detection, and whether the commodity to be detected by the user is a legal commodity or not is determined according to the difference between the target reference distance and the reference distance. For illegal merchants, if the package of the fake commodities and the package of the genuine commodities are guaranteed to be completely consistent at the pixel level when the illegal merchants manufacture the fake commodities, the fake cost is very high and cannot be achieved basically, and therefore the method provided by the embodiment of the application can effectively prevent the illegal merchants from performing fake activities.
Drawings
Fig. 1 is a schematic flow chart of an anti-counterfeit detection method according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an anti-counterfeit identification code and an identification code to be identified provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of a reference image and a target reference image provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of an anti-counterfeiting detection device provided in an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Aiming at the problem that counterfeiting of illegal merchants is difficult to effectively inhibit in the prior art, the embodiment of the application provides the anti-counterfeiting detection method, and the anti-counterfeiting cost of the illegal merchants is improved by improving the anti-counterfeiting precision, so that the counterfeiting activities of the illegal merchants are effectively inhibited.
Specifically, in the anti-counterfeiting detection method provided by the embodiment of the application, the server can acquire a target image uploaded by a user, wherein the target image is obtained by shooting a to-be-detected commodity by using a terminal device, and comprises an identification code to be identified and a reference line to be identified on the to-be-detected commodity; then, calling a reference image corresponding to the to-be-detected commodity according to the to-be-identified identification code, wherein the reference image is obtained by shooting a legal commodity by a legal merchant and comprises an anti-counterfeiting identification code and a reference line on the legal commodity; then, processing the target image based on a reference image corresponding to the reference image to obtain a target reference image, wherein the area corresponding to the target reference image is the same as the area corresponding to the reference image; further, determining a target boundary and a reference line to be identified of a target reference image, and determining a target reference distance according to the distance between a pixel point on the target boundary and a pixel point on the reference line to be identified; and finally, detecting whether the commodity to be detected is a legal commodity or not according to the target reference distance and the reference distance, wherein the reference distance is determined according to the reference boundary of the reference image and the reference line, and the reference image corresponds to the reference image.
According to the method, the target reference distance corresponding to the target image uploaded by the user and the reference distance corresponding to the reference image uploaded by the legal merchant are determined through pixel-level distance detection, and whether the commodity to be detected by the user is a legal commodity or not is determined according to the difference between the target reference distance and the reference distance. For illegal merchants, if the package of the fake commodities and the package of the genuine commodities are guaranteed to be completely consistent at the pixel level when the illegal merchants manufacture the fake commodities, the fake cost is very high and cannot be achieved basically, and therefore the method provided by the embodiment of the application can effectively prevent the illegal merchants from performing fake activities.
It should be noted that, in practical applications, the anti-counterfeiting detection method provided in the embodiment of the present application may be independently completed by the server, or may be independently completed by the terminal device, that is, independently completed by the anti-counterfeiting detection program running on the terminal device, or may be completed by the server and the terminal device in cooperation with each other, and the present application does not limit any execution main body of the anti-counterfeiting detection method provided in the embodiment of the present application.
The following describes the anti-counterfeit detection method provided by the present application in detail by way of an embodiment of the method.
Referring to fig. 1, fig. 1 is a schematic flow chart of an anti-counterfeiting detection method provided in the embodiment of the present application. The following embodiments are described by taking an execution subject of the method as an example of a server, and as shown in fig. 1, the method includes:
step 101: acquiring a target image uploaded by a user; the target image is obtained by shooting a commodity to be detected, and the target image comprises an identification code to be recognized and a reference line to be recognized on the commodity to be detected.
In practical Application, when a user wants to perform anti-counterfeit detection on a certain to-be-detected commodity to determine whether the to-be-detected commodity is a legal commodity produced by a legal merchant, the user can shoot the to-be-detected commodity through a specific commodity detection Application (APP) or a commodity detection applet in related applications to obtain a target image. For example, if a small commodity detection program is integrated in the WeChat, the user may open the small commodity detection program and turn on a camera of the terminal device to shoot the commodity to be detected.
It should be noted that, in order to ensure that the anti-counterfeit detection can be smoothly performed on the to-be-detected commodity, the commodity detection application or the commodity detection applet can prompt the user to ensure that the photographed target image includes the to-be-identified identification code and the to-be-identified reference line on the to-be-detected commodity before the user photographs the to-be-detected commodity; for example, if the identification code to be recognized included in the to-be-detected commodity is a two-dimensional code, and the reference line to be recognized is a frame line close to the two-dimensional code, after the commodity detection applet is started, the user can be prompted that the image shot by the user includes the two-dimensional code on the commodity and the frame line close to the two-dimensional code.
Certainly, in order to ensure that the target image shot by the user includes the identification code to be recognized and the reference line to be recognized on the commodity to be detected, the commodity detection application or the commodity detection applet can also directly prompt the user to completely shoot the commodity label of the commodity to be detected. The method and the device do not limit the way for prompting the user to shoot the target image, and only need to ensure that the target image shot by the user comprises the identification code to be recognized and the reference line to be recognized on the commodity to be detected.
After the user finishes shooting the target image through the commodity detection application or the commodity detection applet, the commodity detection application or the commodity detection applet can send the shot target image to the server through the network, so that the server can obtain the target image.
After receiving the target image, the server may preliminarily determine whether the target image meets the quality requirement, and if not, feed back the prompt information of the target image uploaded again. Specifically, the server may determine whether the definition of the target image meets a preset definition standard, determine that the target image is qualified if the definition of the target image meets the preset definition standard, perform subsequent anti-counterfeiting detection operation based on the target image, and return prompt information for re-uploading the target image to the commodity detection application or the commodity detection applet if the definition of the target image does not meet the preset definition standard, so as to prompt the target user to re-shoot the target image.
Step 102: calling a reference image corresponding to the to-be-detected commodity according to the to-be-identified identification code; the reference image is obtained by shooting a legal commodity, and the reference image comprises an anti-counterfeiting identification code and a reference line on the legal commodity.
After the server acquires the target image, the server can call a reference image corresponding to the to-be-detected commodity from the database according to the to-be-identified identification code included in the target image. It should be noted that a large number of reference images are stored in the database, different reference images correspond to different legal commodities, the reference images are captured and stored by legal merchants before the legal commodities flow into the market, and the reference images include the anti-counterfeiting identification codes and the reference lines on the corresponding legal commodities.
In specific implementation, the server can identify the identification code to be identified in the target image to obtain the target information carried in the identification code to be identified. Then, whether reference information consistent with the target information exists or not is searched in reference information prestored in a database, wherein the reference information prestored in the database is information carried by the anti-counterfeiting identification code in the reference image stored in the database; if the reference information consistent with the target information can be found, the reference image including the identification code to be identified is stored in the database, namely the reference image of the legal commodity corresponding to the commodity to be detected exists, and then the server can call the reference image including the anti-counterfeiting identification code carrying the target information; on the contrary, if the reference information consistent with the target information cannot be found, it is indicated that the reference image including the identification code to be identified is not stored in the database, that is, a legal commodity corresponding to the commodity to be detected does not exist at all, so that the commodity to be detected can be directly determined to be not a legal commodity, and the anti-counterfeiting detection result is fed back to the user.
Step 103: processing the target image based on a reference image corresponding to the reference image to obtain a target reference image; the region corresponding to the target reference image is the same as the region corresponding to the reference image.
After the server acquires the target image and the reference image, the target image can be processed based on the reference image corresponding to the reference image, so as to obtain the target reference image which is more convenient for executing anti-counterfeiting detection operation.
It should be noted that the reference image is an image only including a region of interest (ROI) in the reference image, where the region of interest may be a minimum region completely including the anti-counterfeit identification code and the reference line, if the reference image itself is an image only including the region of interest, the reference image corresponding to the reference image is the reference image itself, and if the reference image itself is not an image only including the region of interest, the reference image corresponding to the reference image needs to be further acquired.
It should be understood that, in practical applications, the reference image corresponding to the reference image may be stored in the database, and when the target image needs to be processed to obtain the target reference image, the server may directly retrieve the reference image corresponding to the reference image. Of course, if the reference image corresponding to the reference image is not stored in the database, the server needs to perform image cropping processing on the reference image to obtain the reference image including only the region of interest.
Specifically, when the target image is processed based on the reference image, the server may perform rotation transformation on the target image to obtain a reference image having a direction consistent with that of the reference image, and then perform image cropping on the reference image to obtain a target reference image including the region of interest and having the same size as the reference image.
When the server performs rotation transformation processing on the target image, the rotation transformation processing can be performed on the target image according to the positioning area of the anti-counterfeiting identification code in the reference image and the positioning area of the identification code to be identified in the target image. As shown in fig. 2, (a) is an anti-counterfeit identification code in the reference image, and (b) is an identification code to be recognized in the target image, and black square frame regions distributed at three vertex positions of the anti-counterfeit identification code and the identification code to be recognized are positioning regions corresponding to the black square frame regions, the server can perform rotation transformation processing on the target image in a clockwise direction to sequentially obtain the identification codes to be recognized shown in (c), (d) and (e), and since the directions of the positioning regions of the identification code to be recognized shown in (e) and the positioning regions of the anti-counterfeit identification code in the reference image are completely consistent, the target image including the identification code to be recognized shown in (e) obtained through the rotation transformation processing can be considered as the reference image.
Furthermore, the server may perform image cropping processing on the reference image according to the benchmark reference image to obtain a target reference image which includes an area of interest and is the same as the benchmark reference image in size, where the area of interest may be a minimum area completely including the identification code to be identified and the reference line to be identified. In order to facilitate subsequent anti-counterfeiting detection processing, the sizes of the target reference image and the reference image are consistent.
Optionally, in order to better perform the anti-counterfeiting detection processing, the light and the brightness of the target image and the reference image may be further filtered, so that the light and the brightness of the target image are respectively consistent with the light and the brightness of the reference image. Of course, after the target reference image and the reference image are obtained, the light and the brightness of the target reference image and the reference image may be filtered to make the light and the brightness of the target reference image and the reference image consistent.
Step 104: detecting whether the commodity to be detected is the legal commodity or not according to the target reference distance and the reference distance; the base reference distance is determined from a base boundary of a base reference image and a base reference line in the base reference image, the base reference image corresponding to the base image.
After the server obtains the target reference image through the processing, the target boundary of the identification code to be identified in the target reference image and the reference line to be identified in the target reference image can be determined, and further, the target reference distance is determined according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified.
In a specific implementation, the server may detect the target reference image through an edge detection algorithm such as sobel to determine a target boundary of the target reference image, where for the target reference image shown in fig. 3, the target boundary is actually a boundary of the identification code to be identified.
The server can determine a plurality of reference pixel points which are positioned at the same horizontal position or the same vertical position with the boundary pixel point on the reference line to be identified aiming at each boundary pixel point on the target boundary. It should be noted that, at the pixel level, a point on the reference line to be identified, which is at the same horizontal position or the same vertical position as a boundary pixel point, is composed of a plurality of horizontally adjacent or vertically adjacent pixel points, and these horizontally adjacent or vertically adjacent pixel points are the plurality of reference pixel points. Furthermore, the server can determine the reference distance corresponding to the boundary pixel point according to the respective distances from the plurality of reference pixel points to the boundary pixel point; and determining a target reference distance according to the respective reference distances corresponding to all boundary pixel points on the target boundary.
Specifically, taking the target reference image shown in fig. 3 as an example, for each boundary pixel point on the left boundary (i.e. the target boundary) of the two-dimensional code, the server may determine the distance from the boundary pixel point to each reference pixel point on the reference line 301 to be identified, which is located at the same horizontal position as the boundary pixel point, and then calculate the average value of the distances as the reference distance corresponding to the boundary pixel point, and specifically may calculate the reference distance d corresponding to the jth boundary pixel point by the following formulaj
Figure BDA0002694323730000101
Wherein, wiThe weight configured for the ith reference pixel point which is positioned at the same horizontal position with the jth boundary pixel point on the reference line to be identified is increased, and the deeper the color corresponding to the reference pixel point is, the larger the corresponding weight is; djiThe distance between the jth boundary pixel point and the ith reference pixel point is calculated; n is the number of reference pixel points which are positioned at the same horizontal position with the jth boundary pixel point on the reference line to be identified.
The above operations are executed for each boundary pixel point on the target boundary to determine the respective reference distance of each boundary pixel point on the target boundary, and a distance collection can be formed by using the respective reference distances of each boundary pixel point on the target boundary
Figure BDA0002694323730000111
Figure BDA0002694323730000112
Further, the server may calculate an average value of the reference distances included in the distance collection to obtain the target reference distance Mu corresponding to the target boundary.
In order to ensure more accurate anti-counterfeiting verification, the server can determine a plurality of target boundaries and a plurality of reference lines to be identified in the target reference image, further determine the reference line to be identified corresponding to each target boundary, and determine the target reference distance corresponding to the target boundary according to the distance between the pixel points on the target boundary and the pixel points on the reference line to be identified corresponding to the pixel points.
Specifically, taking the target reference image shown in fig. 3 as an example, the server may determine the target reference distance based on the left boundary of the two-dimensional code and the reference line 301 to be recognized, and may also determine the target reference distance based on the upper boundary of the two-dimensional code and the reference line 302 to be recognized, that is, the server may determine, for each boundary pixel point on the upper boundary of the two-dimensional code, a distance from the boundary pixel point to each reference pixel point on the reference line 302 to be recognized, which is located at the same vertical position as the boundary pixel point, and then calculate an average value of the distances as the reference distance corresponding to the boundary pixel point, where a specific calculation manner is similar to the above, and is not described herein again. After the reference distances corresponding to the target boundary points on the target boundary are calculated, a distance set D2 can be formed by using the reference distances corresponding to the boundary pixel points on the target boundary, and an average value of the reference distances in the distance set D2 is calculated as the target reference distance Nu corresponding to the target boundary.
It should be noted that, when the database does not store the reference distance corresponding to the reference image, the server needs to determine the corresponding reference distance based on the reference image in the manner described above, and taking the determination of the reference distance corresponding to each of the two reference boundaries as an example, the server may determine the corresponding reference distance Mo for the left boundary of the two-dimensional code in the reference image, and determine the corresponding reference distance No for the upper boundary of the two-dimensional code in the reference image. Of course, if the database stores the reference distance corresponding to the reference image in advance, the server may directly call the reference distance when performing the anti-counterfeit detection based on the target image uploaded by the user.
Step 105: detecting whether the commodity to be detected is the legal commodity or not according to the target reference distance and the reference distance; the benchmark reference distance is determined according to the target boundary of the anti-counterfeiting identification code in the benchmark image and the benchmark reference line in the benchmark image.
After the server determines the target reference distance and the reference distance, whether the commodity to be detected is a legal commodity can be detected according to the target reference distance and the reference distance.
Specifically, the server may calculate a difference between the target reference distance and the reference distance, and if the difference is within a preset difference range, it may be determined that the commodity to be detected is a legal commodity, otherwise, if the difference exceeds the preset difference range, it may be determined that the commodity to be detected is not a legal commodity.
Still taking the example that the server determines the target reference distances Mu and Nu based on the target reference image and determines the reference distances Mo and No based on the reference image, the server may calculate the absolute value and the value S of the difference corresponding to the two target boundaries by the following formula:
S=|Nu-N0|+|Mu-M0|
when the S is larger than the preset difference range, the commodity to be detected can be determined to be not a legal commodity, and when the S is smaller than or equal to the preset difference range, the commodity to be detected can be determined to be a legal commodity.
It should be understood that the preset difference range may be set according to actual requirements, and the application does not make any specific limitation on the preset difference range.
After the server determines the anti-counterfeiting detection result, namely whether the commodity to be detected is a legal commodity or not, the anti-counterfeiting detection result can be fed back to the commodity detection application or the commodity detection small program, so that the commodity detection application or the commodity detection small program can inform a user whether the currently detected commodity to be detected is a legal commodity or not.
The anti-counterfeiting detection method provided by the embodiment of the application determines a target reference distance corresponding to a target image uploaded by a user and a reference distance corresponding to a reference image uploaded by a legal merchant through pixel-level distance detection, and further determines whether a commodity to be detected by the user is a legal commodity according to the difference between the target reference distance and the reference distance. For illegal merchants, if the package of the fake commodities and the package of the genuine commodities are guaranteed to be completely consistent at the pixel level when the illegal merchants manufacture the fake commodities, the fake cost is very high and cannot be achieved basically, and therefore the method provided by the embodiment of the application can effectively prevent the illegal merchants from performing fake activities.
The embodiment of the present application further provides an anti-counterfeit detection device, refer to fig. 4, and fig. 4 is a schematic structural diagram of the anti-counterfeit detection device provided in the embodiment of the present application. As shown in fig. 4, the apparatus includes:
a target image obtaining module 401, configured to obtain a target image uploaded by a user; the target image is obtained by shooting a to-be-detected commodity, and the target image comprises an identification code to be identified and a reference line to be identified on the to-be-detected commodity;
a reference image obtaining module 402, configured to invoke a reference image corresponding to the to-be-detected commodity according to the identification code to be identified; the reference image is obtained by shooting a legal commodity, and the reference image comprises an anti-counterfeiting identification code and a reference line on the legal commodity;
a target image processing module 403, configured to process the target image based on a reference image corresponding to the reference image to obtain a target reference image; the area corresponding to the target reference image is the same as the area corresponding to the reference image;
a target distance determining module 404, configured to determine a target boundary of the target reference image and the reference line to be identified in the target reference image; determining a target reference distance according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified;
a commodity detection module 405, configured to detect whether the commodity to be detected is the legitimate commodity according to the target reference distance and the reference distance; the base reference distance is determined from a base boundary of the base reference image and a base reference line in the base reference image.
Optionally, the target distance determining module 404 is specifically configured to:
aiming at each boundary pixel point on the target boundary, determining a plurality of reference pixel points which are positioned on the reference line to be identified and are at the same horizontal position or the same vertical position as the boundary pixel point, and determining a reference distance corresponding to the boundary pixel point according to the respective distances from the plurality of reference pixel points to the boundary pixel point;
and determining the target reference distance according to the respective reference distances corresponding to the boundary pixel points on the target boundary.
Optionally, the target distance determining module 404 is specifically configured to:
calculating a reference distance d corresponding to the boundary pixel point by the following formulaj
Figure BDA0002694323730000131
Wherein, wiIs the weight configured for the ith reference pixel point at the same horizontal position or the same vertical position as the boundary pixel point, djiThe distance between the boundary pixel point and the ith reference pixel point is obtained, and n is the number of the reference pixel points which are positioned at the same horizontal position or the same vertical position as the boundary pixel point;
and calculating the average value of the reference distances corresponding to all boundary pixel points on the target boundary, and taking the average value as the target reference distance.
Optionally, the target distance determining module 404 is specifically configured to:
determining a plurality of target boundaries in the target reference image and a plurality of reference lines to be identified in the target reference image;
and determining a reference line to be identified corresponding to each target boundary, and determining a target reference distance corresponding to the target boundary according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified corresponding to the pixel point.
Optionally, the commodity detection module 405 is specifically configured to:
calculating a difference between the target reference distance and the benchmark reference distance;
if the difference value is within a preset difference value range, determining that the commodity to be detected is the legal commodity;
and if the difference value exceeds the preset difference value range, determining that the commodity to be detected is not the legal commodity.
Optionally, the apparatus further comprises:
the definition judging module is used for judging whether the definition of the target image meets a preset definition standard or not after the target image uploaded by the user is obtained; if not, returning a prompt message for re-uploading the target image; if yes, continuing to execute the reference image corresponding to the to-be-detected commodity according to the to-be-identified identification code.
Optionally, the reference image acquiring module 402 is specifically configured to:
identifying the identification code to be identified in the target image to obtain target information;
judging whether reference information consistent with the target information exists in reference information prestored in a database; the reference information prestored in the database is information carried in the anti-counterfeiting identification code on the legal commodity;
if not, determining that the commodity to be detected is not the legal commodity; and if so, determining a reference image corresponding to the to-be-detected commodity according to the reference information consistent with the target information.
Optionally, the target image processing module 403 is specifically configured to:
performing rotation transformation processing on the target image based on the reference image to obtain a reference image with the same direction as the reference image;
and performing image cutting processing on the reference image to obtain the target reference image which comprises an interested area and has the same size as the standard reference image.
Optionally, the apparatus further comprises:
and the image light brightness processing module is used for filtering the light and brightness of the target image and the reference image after the target image uploaded by the user is obtained, so that the light and the brightness of the target image are respectively consistent with the light and the brightness of the reference image.
The anti-counterfeiting detection device provided by the embodiment of the application determines a target reference distance corresponding to a target image uploaded by a user and a reference distance corresponding to a reference image uploaded by a legal merchant through pixel-level distance detection, and further determines whether a commodity to be detected by the user is a legal commodity according to the difference between the target reference distance and the reference distance. For illegal merchants, if the package of the fake commodities and the package of the genuine commodities are guaranteed to be completely consistent at the pixel level when the illegal merchants manufacture the fake commodities, the fake cost is very high and cannot be achieved basically, and therefore the method provided by the embodiment of the application can effectively prevent the illegal merchants from performing fake activities.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing computer programs.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. An anti-counterfeiting detection method, characterized in that the method comprises:
acquiring a target image uploaded by a user; the target image is obtained by shooting a to-be-detected commodity, and the target image comprises an identification code to be identified and a reference line to be identified on the to-be-detected commodity;
calling a reference image corresponding to the to-be-detected commodity according to the to-be-identified identification code; the reference image is obtained by shooting a legal commodity, and the reference image comprises an anti-counterfeiting identification code and a reference line on the legal commodity;
processing the target image based on a reference image corresponding to the reference image to obtain a target reference image; the area corresponding to the target reference image is the same as the area corresponding to the reference image;
determining a target boundary of the target reference image and the reference line to be identified in the target reference image; determining a target reference distance according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified;
detecting whether the commodity to be detected is the legal commodity or not according to the target reference distance and the reference distance; the base reference distance is determined from a base boundary of the base reference image and a base reference line in the base reference image.
2. The method according to claim 1, wherein the determining a target reference distance according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified comprises:
aiming at each boundary pixel point on the target boundary, determining a plurality of reference pixel points which are positioned on the reference line to be identified and are at the same horizontal position or the same vertical position as the boundary pixel point, and determining a reference distance corresponding to the boundary pixel point according to the respective distances from the plurality of reference pixel points to the boundary pixel point;
and determining the target reference distance according to the respective reference distances corresponding to the boundary pixel points on the target boundary.
3. The method of claim 2, wherein determining the reference distance corresponding to the boundary pixel point according to the distance from each of the plurality of reference pixels to the boundary pixel point comprises:
calculating a reference distance d corresponding to the boundary pixel point by the following formulaj
Figure FDA0002694323720000011
Wherein, wiIs the weight configured for the ith reference pixel point at the same horizontal position or the same vertical position as the boundary pixel point, djiThe distance between the boundary pixel point and the ith reference pixel point is obtained, and n is the number of the reference pixel points which are positioned at the same horizontal position or the same vertical position as the boundary pixel point;
the determining the target reference distance according to the respective reference distances corresponding to the boundary pixel points on the target boundary includes:
and calculating the average value of the reference distances corresponding to all boundary pixel points on the target boundary, and taking the average value as the target reference distance.
4. The method according to any one of claims 1 to 3, wherein the determining of the target boundary of the target reference image and the reference line to be identified in the target reference image; determining a target reference distance according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified, comprising:
determining a plurality of target boundaries in the target reference image and a plurality of reference lines to be identified in the target reference image;
and determining a reference line to be identified corresponding to each target boundary, and determining a target reference distance corresponding to the target boundary according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified corresponding to the pixel point.
5. The method according to any one of claims 1 to 3, wherein the detecting whether the commodity to be detected is the legal commodity according to the target reference distance and the reference distance comprises:
calculating a difference between the target reference distance and the benchmark reference distance;
if the difference value is within a preset difference value range, determining that the commodity to be detected is the legal commodity;
and if the difference value exceeds the preset difference value range, determining that the commodity to be detected is not the legal commodity.
6. The method of claim 1, wherein after the obtaining of the target image uploaded by the user, the method further comprises:
judging whether the definition of the target image meets a preset definition standard or not;
if not, returning a prompt message for re-uploading the target image; if yes, continuing to execute the reference image corresponding to the to-be-detected commodity according to the to-be-identified identification code.
7. The method of claim 1, wherein after the obtaining of the target image uploaded by the user, the method further comprises:
identifying the identification code to be identified in the target image to obtain target information;
judging whether reference information consistent with the target information exists in reference information prestored in a database; the reference information prestored in the database is information carried in the anti-counterfeiting identification code on the legal commodity;
if not, determining that the commodity to be detected is not the legal commodity; and if so, determining a reference image corresponding to the to-be-detected commodity according to the reference information consistent with the target information.
8. The method of claim 1, wherein processing the target image based on a reference image corresponding to the reference image to obtain a target reference image comprises:
performing rotation transformation processing on the target image based on the reference image to obtain a reference image with the same direction as the reference image;
and performing image cutting processing on the reference image to obtain the target reference image which comprises an interested area and has the same size as the standard reference image.
9. The method of claim 1, wherein after the obtaining of the target image uploaded by the user, the method further comprises:
and filtering the light rays and the brightness of the target image and the reference image to enable the light rays and the brightness of the target image to be consistent with the light rays and the brightness of the reference image respectively.
10. An anti-counterfeiting detection device, comprising:
the target image acquisition module is used for acquiring a target image uploaded by a user; the target image is obtained by shooting a to-be-detected commodity, and the target image comprises an identification code to be identified and a reference line to be identified on the to-be-detected commodity;
the reference image acquisition module is used for calling a reference image corresponding to the to-be-detected commodity according to the identification code to be identified; the reference image is obtained by shooting a legal commodity, and the reference image comprises an anti-counterfeiting identification code and a reference line on the legal commodity;
the target image processing module is used for processing the target image based on a reference image corresponding to the reference image to obtain a target reference image; the area corresponding to the target reference image is the same as the area corresponding to the reference image;
the target distance determining module is used for determining a target boundary of the target reference image and the reference line to be identified in the target reference image; determining a target reference distance according to the distance between the pixel point on the target boundary and the pixel point on the reference line to be identified;
the commodity detection module is used for detecting whether the commodity to be detected is the legal commodity according to the target reference distance and the reference distance; the base reference distance is determined from a base boundary of the base reference image and a base reference line in the base reference image.
CN202011001066.4A 2020-09-22 2020-09-22 Anti-counterfeiting detection method and device Pending CN111932283A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011001066.4A CN111932283A (en) 2020-09-22 2020-09-22 Anti-counterfeiting detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011001066.4A CN111932283A (en) 2020-09-22 2020-09-22 Anti-counterfeiting detection method and device

Publications (1)

Publication Number Publication Date
CN111932283A true CN111932283A (en) 2020-11-13

Family

ID=73333903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011001066.4A Pending CN111932283A (en) 2020-09-22 2020-09-22 Anti-counterfeiting detection method and device

Country Status (1)

Country Link
CN (1) CN111932283A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005003416A (en) * 2003-06-10 2005-01-06 Fujitsu Ltd Method for measuring minute dimension
US20140258156A1 (en) * 2013-03-05 2014-09-11 Achilleas Tziazas System and method to authenticate integrated circuits
CN104584030A (en) * 2014-11-15 2015-04-29 深圳市三木通信技术有限公司 Verification application method and device based on face recognition
CN106667525A (en) * 2017-03-03 2017-05-17 成都优途科技有限公司 Measurement system and method of acetabular bone coverage degree based on ultrasonic image
CN107506816A (en) * 2017-08-15 2017-12-22 大连中盈信息技术有限公司 The method of two-dimension code label, commodity counterfeit prevention code label and commodity counterfeit prevention analysis
CN109636417A (en) * 2018-12-04 2019-04-16 雷华 A kind of method for anti-counterfeit and device
CN111461102A (en) * 2020-04-22 2020-07-28 艾科芯(深圳)智能科技有限公司 Anti-counterfeiting identification method, device, equipment terminal and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005003416A (en) * 2003-06-10 2005-01-06 Fujitsu Ltd Method for measuring minute dimension
US20140258156A1 (en) * 2013-03-05 2014-09-11 Achilleas Tziazas System and method to authenticate integrated circuits
CN104584030A (en) * 2014-11-15 2015-04-29 深圳市三木通信技术有限公司 Verification application method and device based on face recognition
CN106667525A (en) * 2017-03-03 2017-05-17 成都优途科技有限公司 Measurement system and method of acetabular bone coverage degree based on ultrasonic image
CN107506816A (en) * 2017-08-15 2017-12-22 大连中盈信息技术有限公司 The method of two-dimension code label, commodity counterfeit prevention code label and commodity counterfeit prevention analysis
CN109636417A (en) * 2018-12-04 2019-04-16 雷华 A kind of method for anti-counterfeit and device
CN111461102A (en) * 2020-04-22 2020-07-28 艾科芯(深圳)智能科技有限公司 Anti-counterfeiting identification method, device, equipment terminal and readable storage medium

Similar Documents

Publication Publication Date Title
US10885644B2 (en) Detecting specified image identifiers on objects
CN108320404B (en) Commodity identification method and device based on neural network and self-service cash register
US8774453B2 (en) Method and arrangement for retrieving information comprised in a barcode
US10078878B2 (en) Methods and arrangements for identifying objects
CN109977886B (en) Shelf vacancy rate calculation method and device, electronic equipment and storage medium
CN108416902B (en) Real-time object identification method and device based on difference identification
KR101678970B1 (en) Method for appraising item
CN108291876A (en) System and method for the authenticity for detecting product
CN110428028B (en) Identification and verification method, device, equipment and medium based on quasi-dynamic laser label
CN109903302A (en) A kind of altering detecting method for stitching image
CN113627411A (en) Super-resolution-based commodity identification and price matching method and system
CN101009755B (en) Watermarked image generation apparatus and method, watermarked image analysis apparatus
US7328847B1 (en) Barcode data communication methods, barcode embedding methods, and barcode systems
CN111222356A (en) Image recognition method, code scanning terminal and commodity sales management system
CN114092108A (en) Method for identifying authenticity of Pu' er tea
CN114898249A (en) Method, system and storage medium for confirming number of articles in shopping cart
CN110533704B (en) Method, device, equipment and medium for identifying and verifying ink label
CN110705620A (en) Display image detection method and device based on copying recognition and storage medium
CN111932282A (en) Anti-counterfeiting detection method and device
CN113920434A (en) Image reproduction detection method, device and medium based on target
CN111932281A (en) Anti-counterfeiting detection method and device
CN111932283A (en) Anti-counterfeiting detection method and device
CN115187795A (en) Tea cake anti-counterfeiting identification method
CN111935480B (en) Detection method for image acquisition device and related device
CN114758162A (en) Commodity anti-counterfeiting identification method and device, electronic equipment and storage medium

Legal Events

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