CN112884718B - Method, device, system and storage medium for detecting packaging code-spraying character - Google Patents

Method, device, system and storage medium for detecting packaging code-spraying character Download PDF

Info

Publication number
CN112884718B
CN112884718B CN202110126631.8A CN202110126631A CN112884718B CN 112884718 B CN112884718 B CN 112884718B CN 202110126631 A CN202110126631 A CN 202110126631A CN 112884718 B CN112884718 B CN 112884718B
Authority
CN
China
Prior art keywords
image
code
character information
spraying
packaging
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.)
Active
Application number
CN202110126631.8A
Other languages
Chinese (zh)
Other versions
CN112884718A (en
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 Tongrentang Tangshan Nutrition And Health Products Co ltd
Original Assignee
Beijing Tongrentang Tangshan Nutrition And Health Products 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 Tongrentang Tangshan Nutrition And Health Products Co ltd filed Critical Beijing Tongrentang Tangshan Nutrition And Health Products Co ltd
Priority to CN202110126631.8A priority Critical patent/CN112884718B/en
Publication of CN112884718A publication Critical patent/CN112884718A/en
Application granted granted Critical
Publication of CN112884718B publication Critical patent/CN112884718B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/155Segmentation; Edge detection involving morphological operators

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Character Discrimination (AREA)

Abstract

The application relates to a method, a device, a system and a storage medium for detecting a packaging code-spraying character, belonging to the technical field of image detection, wherein the method comprises the following steps: acquiring an image to be detected acquired by an image acquisition device; carrying out first pretreatment on an image to be detected to obtain a packaging contour image; performing second preprocessing on the packaging outline image to obtain an image containing the first code-spraying character information; comparing the characteristic parameters of the first code spraying character information with the preset second code spraying character information; acquiring a preset standard image containing third code-spraying character information; comparing the position of the first code spraying character information in the packaging outline image with the position of the third code spraying character information in the standard image; if any of the comparison is inconsistent, judging that the image to be detected is an unqualified image, generating a package removing instruction, and sending the package removing instruction to a package removing device. The application can improve the detection efficiency and the accuracy of the packing code-spraying character information.

Description

Method, device, system and storage medium for detecting packaging code-spraying character
Technical Field
The present application relates to the field of image detection technologies, and in particular, to a method, an apparatus, a system, and a storage medium for detecting a packaging code-spraying character.
Background
In order to trace and examine the production history of foods and medicines, the expiration date of edible and medicinal effects is marked, and the information such as the production date, the production batch number, the expiration date and the like is printed on the surface of the package by food and medicine manufacturers. If the conditions of spray printing errors, messy codes, missing characters, unclear and the like occur, the important information such as the production date, the production batch number and the validity period cannot be identified or wrongly identified, so that the spray code character information on the package is required to be detected before delivery, and unqualified packages are timely found.
At present, a manual mode is generally adopted to detect whether the code-spraying character information of the package is correct or not, but the traditional manual detection mode has high labor intensity and low efficiency, and can possibly have the conditions of missing detection and false detection, and cannot meet the industrial high-speed line production.
Disclosure of Invention
In order to improve the detection efficiency and accuracy of packaging code-spraying character information, the application provides a packaging code-spraying character detection method, a device, a system and a storage medium.
In a first aspect, the present application provides a method for detecting a packaging code-spraying character, which adopts the following technical scheme:
a method of packaging code-spraying character detection comprising the steps of:
acquiring an image to be detected acquired by an image acquisition device; performing first pretreatment on the image to be detected to obtain a packaging contour image; performing second preprocessing on the packaging outline image to obtain an image containing first code-spraying character information; comparing the characteristic parameters of the first code spraying character information with those of the second code spraying character information; comparing the position of the first code spraying character information in the packaging contour image with the position of the preset third code spraying character information in the standard packaging contour image; if any of the comparison is inconsistent, judging that the image to be detected is an unqualified image, generating a package removing instruction, and sending the package removing instruction to a package removing device.
By adopting the technical scheme, the acquired image to be detected is subjected to characteristic parameter comparison with the second code-spraying character information and position comparison with the third code-spraying character information respectively, and if the characteristic parameter comparison and/or the position comparison are inconsistent, a package rejection instruction is sent to a package rejection device, and the package rejection device rejects unqualified products; compared with the traditional manual detection mode, the device improves the detection efficiency and the accuracy of the packaging code-spraying character information.
Optionally, the performing a first preprocessing on the image to be detected includes:
graying treatment is carried out on the image to be detected;
carrying out median filtering treatment on the image to be detected after graying treatment;
performing Candy edge detection on the image to be detected after the median filtering treatment, and extracting at least one contour;
and surrounding the outline with the largest area in the at least one outline by using a polygon to obtain the packaging outline image.
By adopting the technical scheme, the packaging contour image is obtained through the first pretreatment of the image to be detected, and the code spraying information content and the position are compared by using the packaging contour image conveniently in the follow-up process.
Optionally, the second preprocessing is performed on the packaging outline image to obtain an image containing the first code-spraying character information, including:
graying treatment is carried out on the packaging outline image;
carrying out binarization treatment on the packaging outline image subjected to the grey treatment;
performing horizontal segmentation on the binarized packaging contour image through horizontal projection to obtain an image of each row of character strings in the first code-spraying character information;
and performing closing operation on the image of each row of character strings in the first code spraying character information.
Optionally, the comparing the characteristic parameter of the first code spraying character information with the preset second code spraying character information includes:
comparing whether the number of the character strings in the first code-spraying character information is the same as the number of the character strings in the second code-spraying character information, if so, vertically dividing the image of each row of character strings in the first code-spraying character information by vertical projection to obtain the image of each character in the first code-spraying character information, otherwise, comparing inconformity;
after the image of each character in the first code-spraying character information is obtained, comparing whether the number of characters of each row of character strings in the first code-spraying character information is equal to the number of characters of each row of character strings in the second code-spraying character information, if so, acquiring each character in the first code-spraying character information, otherwise, comparing inconformity;
and after each character in the first code-spraying character information is acquired, judging whether the content of each character in the first code-spraying character information is the same as the content of each character in the second code-spraying character information, if so, indicating that the comparison is consistent, and otherwise, judging that the comparison is inconsistent.
Optionally, the comparing the position of the first code-spraying character information in the packaging outline image with the position of the third code-spraying character information in the standard image includes:
establishing a first coordinate system on the packaging contour image;
acquiring a first coordinate point of each row of character strings in the first code spraying character information;
establishing a second coordinate system on the standard image;
acquiring a second coordinate point of each row of character strings in the third code spraying character information;
and comparing the first coordinate point with the second coordinate point of each row of character strings, if the first coordinate point and the second coordinate point are the same, comparing the first coordinate point and the second coordinate point to be consistent, otherwise, comparing the first coordinate point and the second coordinate point to be inconsistent.
Optionally, the method further comprises:
acquiring electronic supervision code information in the image to be detected;
and the qualified state of the image to be detected and the electronic supervision code information are corresponding and stored.
By adopting the technical scheme, the electronic supervision code information in the acquired image to be detected is stored as the name of the current image to be detected, and when the information of the product is required to be called later, the corresponding image to be detected can be displayed directly through the number of the input electronic supervision code, so that the inquiry is convenient.
In a second aspect, the present application provides a packaging code-spraying character detection device, which adopts the following technical scheme:
a packaging code word detection device comprising a memory and a processor, the memory having stored thereon a computer program capable of being loaded by the processor and performing the packaging code word detection method according to any of the first aspects.
By adopting the technical scheme, the acquired image to be detected is subjected to characteristic parameter comparison with the second code-spraying character information and position comparison with the third code-spraying character information respectively, and if the characteristic parameter comparison and/or the position comparison are inconsistent, a package rejection instruction is sent to a package rejection device, and the package rejection device rejects unqualified products; compared with the traditional manual detection mode, the device improves the detection efficiency and the accuracy of the packaging code-spraying character information.
In a third aspect, the present application provides a system for detecting a packaging code-spraying character, which adopts the following technical scheme:
the packaging code spraying character detection system comprises a conveyor belt, a packaging code spraying character detection device according to any one of the first aspect, and a code spraying device, an image acquisition device and a packaging rejecting device or a packaging collecting device which are sequentially arranged on the conveyor belt according to the conveying direction, wherein the image acquisition device acquires a packaging image to be detected and sends the image to be detected to the packaging code spraying character detection device.
By adopting the technical scheme, the acquired image to be detected is subjected to characteristic parameter comparison with the second code-spraying character information and position comparison with the third code-spraying character information respectively, and if the characteristic parameter comparison and/or the position comparison are inconsistent, a package rejection instruction is sent to a package rejection device, and the package rejection device rejects unqualified products; compared with the traditional manual detection mode, the device improves the detection efficiency and the accuracy of the packaging code-spraying character information.
In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
a computer readable storage medium storing a computer program capable of being loaded by a processor and executing the wrapper spray character detection method based on any one of the first aspects.
By adopting the technical scheme, the acquired image to be detected is subjected to characteristic parameter comparison with the second code-spraying character information and position comparison with the third code-spraying character information respectively, and if the characteristic parameter comparison and/or the position comparison are inconsistent, a package rejection instruction is sent to a package rejection device, and the package rejection device rejects unqualified products; compared with the traditional manual detection mode, the device improves the detection efficiency and the accuracy of the packaging code-spraying character information.
In summary, the present application includes at least one of the following beneficial technical effects:
1. the packaging code-spraying detection device is used for identifying the number of character strings, the positions of the character strings, the number of characters and the content of the characters of the first code-spraying character information, detecting whether the code-spraying information sprayed by the code-spraying device meets the product packaging requirement or not, and improving the packaging detection efficiency and accuracy;
2. and storing the packaging code-spraying image to be identified in the form of digital information of the electronic supervision code, and calling out the image only by inputting the digital information of the electronic supervision code when the packaging code-spraying image is required to be checked later.
Drawings
Fig. 1 is a flowchart of a method for detecting a packaging code-spraying character according to an embodiment of the present application.
Fig. 2 is a flow chart illustrating the sub-steps of step S102 in the embodiment of the present application.
Fig. 3 is a flow chart illustrating the sub-steps of step S103 in the embodiment of the present application.
Fig. 4 is a block diagram of a device for detecting a packaging code-spraying character according to an embodiment of the application.
Fig. 5 is a schematic structural diagram of a packaging code-spraying character detection system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
The present embodiment provides a method for detecting a packaging code-spraying character, as shown in fig. 1, the main flow of the method is described as follows (steps S101 to S107):
step S101: and acquiring an image to be detected acquired by the image acquisition device.
In this embodiment, the image acquisition device performs image acquisition on a surface of the product package with the first code-spraying character information, and receives an acquired image to be detected.
The first code-spraying character information comprises a production date character string, a production lot character string and a validity period character string.
Step S102: carrying out first pretreatment on an image to be detected to obtain a packaging contour image;
specifically, as shown in fig. 2, step S102 may include the following substeps:
step S1021, gray processing is carried out on the image to be detected;
after the image to be detected is obtained, firstly, graying treatment is carried out on the image to be detected, and one of the brightness of three components of R (the value of a red variable), G (the value of a green variable) and B (the value of a blue variable) of the image to be detected is taken as a gray value, so that a gray image of the image to be detected is obtained.
Step S1022, median filtering processing is carried out on the image to be detected after the graying processing;
scanning each pixel point of the image, determining a rectangular area such as 5*5 for each pixel point, sequencing data in the rectangular area, replacing the data to be processed by the sequenced median value, obtaining a return value, and finally filling the return value into the output pixel point to obtain the image after median filtering.
Step S1023, performing Candy edge detection on the image to be detected after the median filtering treatment, and extracting at least one contour;
performing Candy edge detection on the binary image, and calculating gradient strength and direction of each pixel point in the image; and non-maximum suppression is applied to eliminate spurious response brought by edge detection; dual threshold detection is applied to determine true and potential edges.
Step S1024, surrounding the outline with the largest area in at least one outline by utilizing the polygon to obtain a packaging outline image;
and finally obtaining a contour edge by inhibiting the isolated weak edge, selecting the largest contour and surrounding the largest contour by using a polygon to obtain a packaging contour image.
Step S103: performing second preprocessing on the packaging outline image to obtain an image containing the first code-spraying character information;
specifically, as shown in fig. 3, step S103 may include the following substeps:
step S1031, carrying out gray processing on the packaging contour image;
the graying process in step S1031 may refer to step S1021, and will not be described herein.
Step S1032, carrying out binarization processing on the package outline image after the grey-scale processing;
according to the image after gradation processing, a threshold processing is set, each pixel value is scanned, a pixel value smaller than the threshold is set to 0 (black), and a pixel value equal to or larger than the threshold is set to 255 (white), so that the gradation image exhibits a black-and-white effect, and a binarized image is obtained.
Step S1033, carrying out horizontal segmentation on the binarized packaging contour image through horizontal projection to obtain an image of each row of character strings in the first code-spraying character information;
performing horizontal segmentation on the binarized image, specifically, taking a straight line in the horizontal direction of the binarized image to be detected, counting the number of black points of pixels of the binarized image perpendicular to the straight line, and accumulating and summing to obtain a value of the position of the straight line; when the binary image is mapped to such a feature, a cutting position of the binary image is determined based on such a feature, and the original image is cut.
Step S1034, performing a closing operation on the image of each row of character strings in the first code-spraying character information;
and corroding and expanding the original operation to obtain the clear image of each row of character strings in the first code-spraying character information.
Step S104: comparing the characteristic parameters of the first code spraying character information with the preset second code spraying character information;
the preset second code-spraying character information is a characteristic parameter which is input by an operator in advance and comprises the correct production date, production batch number and validity period, that is, if the package to be detected is qualified, the characteristic parameter (character number and character content) of the first code-spraying character information on the package is required to be the same as the second code-spraying character information.
Specifically, step S104 may include:
firstly, acquiring the number of character strings of first code-spraying character information, and comparing the number of characters of the first code-spraying character information with the preset second code-spraying character information:
if the number of the character strings of the first code spraying character information is greater than that of the character strings of the second code spraying character information, multiple character string errors exist, and the comparison is inconsistent;
if the number of the character strings of the first code spraying character information is smaller than that of the character strings of the second code spraying character information, fewer character string errors exist, and the comparison is inconsistent;
if the number of the character strings is the same, vertically dividing the character strings of the obtained first code spraying character information to obtain the image of each character in the first code spraying character information;
and if the number of the character strings of the first code-spraying character information is different from that of the character strings of the second code-spraying character information, directly judging that the first code-spraying character information is inconsistent with the second code-spraying character information, and immediately stopping the comparison of the whole characteristic parameters.
Then, comparing the number of characters of the character strings of each row in the first code-spraying character information with the number of characters of the character strings of the corresponding row in the second code-spraying character information:
if the number of characters of any row of character strings in the first code spraying character information is more than that of characters of the corresponding row of character strings in the second code spraying character information, multiple character errors exist in the row, and the comparison is inconsistent;
if the number of characters of any row of character strings in the first code spraying character information is smaller than that of characters of the corresponding row of character strings in the second code spraying character information, fewer character errors exist in the row, and comparison is inconsistent;
if the number of characters of any row of character strings in the first code spraying character information is the same as the number of characters of the character strings of the corresponding row in the second code spraying character information, acquiring the character content of the first code spraying character information;
in the comparison process, if the number of characters in one row is different, the first code-spraying character information and the second code-spraying character information are directly judged to be inconsistent, and the comparison of the whole characteristic parameters is immediately stopped.
And finally, sequentially comparing the character content in the first code-spraying character information with the character content in the second code-spraying character information, and immediately stopping the comparison of the whole characteristic parameters as long as the condition that the character content is different is judged to be inconsistent with the first code-spraying character information and the second code-spraying character information.
Note that, in this embodiment, the existing character recognition algorithm is used to compare the character content of the first code-spraying character information with the character content of the second code-spraying character information, which is not limited in particular.
Step S105: acquiring a standard image containing third code-spraying character information;
the standard image can also be an image containing complete package obtained by the image acquisition device, and the standard image is subjected to the same preprocessing operation as the image to be detected, so as to obtain the standard image with the same size as the package outline image. The third code-spraying character information includes a production date, a production lot number, and a validity period, and the positions of the production date, the production lot number, and the validity period on the standard image are correct.
Note that, the third code-spraying character information in the standard image is only to provide accurate position information, so the character content of the third code-spraying character information and the character content of the first code-spraying character information are not necessarily the same, but the number of character strings and the number of characters are the same.
Step S106: comparing the position of the first code-spraying character information in the packaging outline image with the position of the third code-spraying character information in the standard image;
establishing a first coordinate system by taking a contour corner point of the packaging contour image as an origin, establishing an x-axis along the horizontal direction of the packaging contour image by starting from the origin, establishing a y-axis along the vertical direction of the packaging contour image by starting from the origin, and obtaining four first coordinate points (x 1 ,y 1 ),(x 2 ,y 2 ),(x 3 ,y 3 ),(x 4 ,y 4 )。
Acquiring a corner point corresponding to the origin of the first coordinate system of the packaging outline image, and establishing a second coordinate system by taking the corner point as the origin as a standard image to obtain four second coordinate points of each row of character strings in the third code spraying character information, such as (x) 5 ,y 5 ),(x 6 ,y 6 ),(x 7 ,y 7 ),(x 8 ,y 8 )。
It should be noted that before the coordinate system is established, it is necessary to ensure that the package outline image is consistent with the display direction of the standard image.
And judging whether the four first coordinate points and the second coordinate points of each row of character strings are identical in sequence, if different conditions exist in a certain row of character strings, comparing the character strings to be inconsistent, and immediately stopping position comparison.
It should be noted that step S104 may be performed before step S106 or after step S106, and both may be performed simultaneously.
Step S107: if the comparison results in the step S104 and/or the step S106 are inconsistent, the image to be detected is judged to be an unqualified image, a package eliminating instruction is generated, and the package eliminating instruction is sent to a package eliminating device.
When any situation of the number of character strings, the number of characters, the content of characters and the position of characters is found out to be wrong after comparison, the packaging image to be detected is judged to be an unqualified image, a packaging and removing instruction is required to be sent to a packaging and removing device, and unqualified products are removed.
If the characteristic parameters of the first code-spraying character information are found to be consistent with the second code-spraying character information after comparison, and the positions of the first code-spraying character information in the package image outline are consistent with the positions of the third code-spraying character information in the standard image, the package to be detected is a qualified package, and no operation is required.
If the package is also provided with the electronic supervision code, the image with the electronic supervision code can be acquired through the image acquisition device, the electronic supervision code on the package is identified through the existing image identification algorithm, and the qualified state of the code spraying character information corresponding to the package is stored.
The electronic supervision codes are identifiers endowed for implementing electronic supervision on products, and each product corresponds to a unique electronic supervision code. The digital information of the electronic supervision codes on the package is identified and stored as the name of the image to be detected, and the corresponding relation between the package and the electronic supervision codes is established, so that the whole-course supervision of the production, circulation and consumption of the product is realized, and the functions of judging the authenticity of the product, tracing the quality, recalling management, whole-course tracking and the like are realized.
In order to better implement the above method, the embodiment of the present application provides a packaging code-spraying character detection device, which may be integrated in a computer device, for example, a terminal or a server, where the terminal may include, but is not limited to, a tablet computer or a desktop computer.
The embodiment of the application provides a packaging code-spraying character detection device, as shown in fig. 4, the packaging code-spraying character detection device 303 comprises a memory 3031 and a processor 3032.
The wrapper spray character detection device 303 may be implemented in various forms including tablet, palm, notebook, and desktop computers.
The memory 3031 may be used to store instructions, programs, code sets, or instruction sets, among others. The memory 3031 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as preprocessing, comparison, etc.), instructions for implementing a wrapper spray codeword detection method provided by the above embodiments, and the like; the storage data area may store data and the like involved in the pack spray code character detection method provided in the above embodiment.
Processor 3032 may include one or more processing cores. The processor 3032 performs various functions of the present application and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 3031, calling data stored in the memory 3031. The processor 3032 may be at least one of an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a Digital Signal processor (Digital Signal Processor, DSP), a Digital Signal processing device (Digital Signal ProcessingDevice, DSPD), a programmable logic device (Programmable Logic Device, PLD), a field programmable gate array (Field Programmable Gate Array, FPGA), a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, and a microprocessor. It will be appreciated that the electronic device for implementing the functions of the processor 3032 may be other for different devices, and embodiments of the present application are not specifically limited.
As shown in fig. 5, an embodiment of the present application provides a packaging code-spraying character detecting system, which includes a code-spraying device 301, an image collecting device 302, a packaging code-spraying character detecting device 303, a packaging eliminating device 304 and a conveyor 305. Specifically, the code spraying device 301 may be a laser code spraying machine, the image collecting device 302 may be an industrial camera, and the package removing device 304 may be an air cylinder.
The package 306 to be detected is placed along one side edge of the conveyor belt 305 and is conveyed at a constant speed by the conveyor belt 305, first code spraying character information is sprayed and printed on the package by the code spraying device 301, then the image acquisition device 302 acquires an image to be detected of the package 306 to be detected, the image acquisition device 302 sends the image to be detected to the package code spraying character detection device 303 for code spraying character detection, if the package code spraying character detection device 303 detects that the image to be detected is a disqualified image, a rejection instruction is sent to the package rejection device 305, and the package rejection device 305 rejects a product in response to the rejection instruction.
Embodiments of the present application provide a computer-readable storage medium, for example, comprising: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes. The computer readable storage medium stores a computer program capable of being loaded by a processor and executing a wrapper spray code character detection method of the above-described embodiments.
The present application is not limited by the specific embodiments, and those skilled in the art, having read the present specification, may make modifications to the embodiments without creative contribution as necessary, but are protected by patent laws within the scope of the claims of the present application.

Claims (7)

1. A method for detecting a packaging code-spraying character, comprising the steps of:
acquiring an image to be detected acquired by an image acquisition device;
performing first pretreatment on the image to be detected to obtain a packaging contour image;
performing second preprocessing on the packaging outline image to obtain an image containing first code-spraying character information;
comparing the characteristic parameters of the first code spraying character information with those of the second code spraying character information;
acquiring a preset standard image containing third code-spraying character information;
comparing the position of the first code-spraying character information in the packaging outline image with the position of the third code-spraying character information in the standard image;
if any of the comparison is inconsistent, judging that the image to be detected is an unqualified image, generating a package rejection instruction, and sending the package rejection instruction to a package rejection device;
the comparing the position of the first code-spraying character information in the packaging outline image with the position of the third code-spraying character information in the standard image comprises:
establishing a first coordinate system on the packaging contour image;
acquiring first coordinates of four endpoints of each row of character strings in the first code spraying character information;
establishing a second coordinate system on the standard image;
acquiring second coordinates of four endpoints of each row of character strings in the third code-spraying character information;
comparing the first coordinate point with the second coordinate point, if the first coordinate point and the second coordinate point are the same, comparing the first coordinate point and the second coordinate point to be consistent, otherwise, comparing the first coordinate point and the second coordinate point to be inconsistent;
the standard image is an image containing complete package and obtained by the image acquisition device, and the standard image is subjected to preprocessing operation identical to that of the image to be detected, so that the standard image identical to the package outline image in size is obtained;
the display direction of the package outline image is consistent with that of the standard image;
the step of establishing a first coordinate system on the packaging outline image, and obtaining the first coordinates of four endpoints of each row of character strings in the first code spraying character information comprises the following steps:
establishing a first coordinate system by taking a contour corner point of the packaging contour image as an origin, establishing an x-axis along the horizontal direction of the packaging contour image by starting from the origin, and establishing a y-axis along the vertical direction of the packaging contour image by starting from the origin, so as to obtain four first coordinate points (x 1 ,y 1 ),(x 2 ,y 2 ),(x 3 ,y 3 ),(x 4 ,y 4 );
Establishing a second coordinate system on the standard image, and acquiring second coordinates of four endpoints of each row of character strings in the third code spraying character information, wherein the second coordinates comprise:
acquiring a corner point corresponding to the origin of the first coordinate system of the packaging outline image, and establishing a second coordinate system by taking the corner point as the origin of the standard image to obtain four second coordinate points (x 5 ,y 5 ),(x 6 ,y 6 ),(x 7 ,y 7 ),(x 8 ,y 8 );
Judging whether the four first coordinate points and the four second coordinate points of each row of character strings are identical in sequence, if different conditions exist in a certain row of character strings, comparing the character strings to be inconsistent, and immediately stopping position comparison;
the first code spraying character information comprises a production date character string, a production batch number character string and a validity period character string; the third code spraying character information comprises a production date character string, a production batch number character string and a validity period character string;
further comprises:
acquiring electronic supervision code information in the image to be detected;
and the qualified state of the image to be detected is corresponding to the electronic supervision code information and is stored, and the electronic supervision code information is used as the name of the image to be detected for storage.
2. The method according to claim 1, wherein the first preprocessing of the image to be detected to obtain a packaging contour image comprises:
graying treatment is carried out on the image to be detected;
carrying out median filtering treatment on the image to be detected after graying treatment;
performing Candy edge detection on the image to be detected after the median filtering treatment, and extracting at least one contour;
and surrounding the outline with the largest area in the at least one outline by using a polygon to obtain the packaging outline image.
3. The method according to claim 1 or 2, wherein said second preprocessing of said packaging outline image to obtain an image containing first code-injection character information comprises:
graying treatment is carried out on the packaging outline image;
carrying out binarization treatment on the packaging outline image subjected to the grey treatment;
performing horizontal segmentation on the binarized packaging contour image through horizontal projection to obtain an image of each row of character strings in the first code-spraying character information;
and performing closing operation on the image of each row of character strings in the first code spraying character information.
4. The method according to claim 1 or 2, wherein comparing the characteristic parameters of the first inkjet character information with the preset second inkjet character information comprises:
comparing whether the number of the character strings in the first code-spraying character information is the same as the number of the character strings in the second code-spraying character information, if so, vertically dividing the image of each row of character strings in the first code-spraying character information by vertical projection to obtain the image of each character in the first code-spraying character information, otherwise, comparing inconformity;
after the image of each character in the first code-spraying character information is obtained, comparing whether the number of characters of each row of character strings in the first code-spraying character information is equal to the number of characters of each row of character strings in the second code-spraying character information, if so, acquiring each character in the first code-spraying character information, otherwise, comparing inconformity;
and after each character in the first code-spraying character information is acquired, judging whether the content of each character in the first code-spraying character information is the same as the content of each character in the second code-spraying character information, if so, indicating that the comparison is consistent, and otherwise, judging that the comparison is inconsistent.
5. A packaging code word detection device comprising a memory and a processor, the memory having stored thereon a computer program capable of being loaded by the processor and performing the method of any of claims 1 to 4.
6. The packaging code spraying character detection system is characterized by comprising a conveyor belt, the packaging code spraying character detection device according to claim 5, and a code spraying device, an image acquisition device and a packaging removing device which are sequentially arranged on the conveyor belt according to the conveying direction, wherein the image acquisition device acquires a packaged image to be detected and sends the image to be detected to the packaging code spraying character detection device.
7. A computer readable storage medium, characterized in that a computer program is stored which can be loaded by a processor and which performs the method according to any of claims 1 to 4.
CN202110126631.8A 2021-01-29 2021-01-29 Method, device, system and storage medium for detecting packaging code-spraying character Active CN112884718B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110126631.8A CN112884718B (en) 2021-01-29 2021-01-29 Method, device, system and storage medium for detecting packaging code-spraying character

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110126631.8A CN112884718B (en) 2021-01-29 2021-01-29 Method, device, system and storage medium for detecting packaging code-spraying character

Publications (2)

Publication Number Publication Date
CN112884718A CN112884718A (en) 2021-06-01
CN112884718B true CN112884718B (en) 2023-10-31

Family

ID=76053670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110126631.8A Active CN112884718B (en) 2021-01-29 2021-01-29 Method, device, system and storage medium for detecting packaging code-spraying character

Country Status (1)

Country Link
CN (1) CN112884718B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113408388B (en) * 2021-06-10 2022-08-02 广西师范大学 Detection method and device based on dot-like code spraying
CN113436180A (en) * 2021-07-07 2021-09-24 京东科技控股股份有限公司 Method, device, system, equipment and medium for detecting spray codes on production line
CN113657566B (en) * 2021-08-18 2024-01-26 杭州中粮包装有限公司 Method and device for coding metal cover
CN114492699B (en) * 2022-04-07 2022-08-09 成都普什信息自动化有限公司 Glass bottle laser code detection method and detection system
CN116758531B (en) * 2023-08-23 2023-11-03 苏州视谷视觉技术有限公司 Machine vision system based on deep learning
CN118865411A (en) * 2024-06-26 2024-10-29 北京欣健隆科技有限公司 A method for detecting printed secret codes

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543677A (en) * 2018-11-08 2019-03-29 上海金啤包装检测科技有限公司 The detection method and equipment of coding, production line, computer equipment, storage medium
CN109724990A (en) * 2019-01-08 2019-05-07 上海大学 The quick positioning and detection method in coding region in a kind of packing box label
CN110705531A (en) * 2019-09-29 2020-01-17 北京猎户星空科技有限公司 Missing character detection and missing character detection model establishing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543677A (en) * 2018-11-08 2019-03-29 上海金啤包装检测科技有限公司 The detection method and equipment of coding, production line, computer equipment, storage medium
CN109724990A (en) * 2019-01-08 2019-05-07 上海大学 The quick positioning and detection method in coding region in a kind of packing box label
CN110705531A (en) * 2019-09-29 2020-01-17 北京猎户星空科技有限公司 Missing character detection and missing character detection model establishing method and device

Also Published As

Publication number Publication date
CN112884718A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
CN112884718B (en) Method, device, system and storage medium for detecting packaging code-spraying character
CN116188475B (en) Intelligent control method, system and medium for automatic optical detection of appearance defects
CN110619333B (en) Text line segmentation method, text line segmentation device and electronic equipment
US20220383128A1 (en) Image-based anomaly detection based on a machine learning analysis of an object
KR20150143711A (en) Image processing device and image processing method
CN117237345B (en) Noble metal detection method and system based on pulse eddy current
JP6533061B2 (en) Judgment apparatus, control program and judgment method
CN115302963B (en) Bar code printing control method, system and medium based on machine vision
CN111429444A (en) Chip appearance detection method and device, electronic equipment and storage medium
WO2023226706A9 (en) Defect detection method and apparatus
CN113063802A (en) Printed label defect detection method and device
CN113516619B (en) Product surface flaw identification method based on image processing technology
CN109426756B (en) Error checking method and device for bar code identification result
WO2016206446A1 (en) Character encoding method and character decoding method having error correction function and product thereof
CN110390682B (en) Template self-adaptive image segmentation method, system and readable storage medium
JP6438774B2 (en) Determination device, control program, and determination method
US11481673B2 (en) Signal analysis device, signal analysis method, and signal analysis program
JP6628336B2 (en) Information processing system
CN111709452A (en) Evaluation method, electronic device and storage medium of wine bottle surface defect model
EP3840289A1 (en) Apparatus for obtaining a hash value associated with an object, object identifier, methods and computer program
CN118586560A (en) Production process optimization method, system and storage medium of terminal connector
CN109377493B (en) Quick identification system of propolis softgel defective products based on rule base
CN116542926B (en) Method, device, equipment and storage medium for identifying defects of two-dimension codes of battery
KR20220100302A (en) Image processing method for counting pill
CN108665439B (en) Substrate detection method and terminal equipment

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
GR01 Patent grant
GR01 Patent grant