CN106530289A - Code spraying definition machine vision detecting method based on lattices - Google Patents

Code spraying definition machine vision detecting method based on lattices Download PDF

Info

Publication number
CN106530289A
CN106530289A CN201610954433.XA CN201610954433A CN106530289A CN 106530289 A CN106530289 A CN 106530289A CN 201610954433 A CN201610954433 A CN 201610954433A CN 106530289 A CN106530289 A CN 106530289A
Authority
CN
China
Prior art keywords
character
dot matrix
pixel
color
threshold value
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.)
Granted
Application number
CN201610954433.XA
Other languages
Chinese (zh)
Other versions
CN106530289B (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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201610954433.XA priority Critical patent/CN106530289B/en
Publication of CN106530289A publication Critical patent/CN106530289A/en
Application granted granted Critical
Publication of CN106530289B publication Critical patent/CN106530289B/en
Expired - Fee Related 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30144Printing quality

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a code spraying definition machine vision detecting method based on lattices. The method is technically characterized in that a human-computer interaction device sets and adjusts the measurement area of a character string image, and a setting result is transmitted to an intelligent camera; the intelligent camera acquires the character string image of code spraying characters of a package; the intelligent camera extracts the designated color gray value of pixels in all lattices of all characters in the measurement area; the intelligent camera calculates the color area of all lattices of all characters in the measurement area; the intelligent camera determines the definition; the intelligent camera issues a control command to a removing mechanism; and the removing mechanism removes products with unclear code spraying characters. According to the invention, the design is reasonable; the code spraying characters of the package can be accurately and reliably identified and judged; products with unclear code spraying characters are removed; and the method has the characteristics of accurate judgment, high work efficiency, easy use and the like.

Description

A kind of coding definition machine vision detection method based on dot matrix
Technical field
The invention belongs to Visual identification technology field, especially a kind of coding definition Machine Vision Detection based on dot matrix Method.
Background technology
At present, in the product of the industries such as medicine, food, it is common to use laser or ink jet type code-spraying equipment are in product packaging Upper spray printing batch number, date of manufacture, shelf-life, effect duration etc. identify.Code-spraying equipment is set as a kind of contactless mark The standby spray printing that can provide character,, during coding, it sometimes appear that the unclear problem of coding character, coding character is or not which Prestige and the use of commodity can be clearly affected, therefore, manufacturer will be detected to the coding in product packaging before dispatching from the factory. Traditional detection method is to adopt manual detection, but missing inspection often occurs using manual detection method meeting Jing.Meanwhile, with production The raising of speed, human eye have not caught up with the speed of service of product.In recent years, coding character picture automatic identification technology is obtained Certain application, but, due to the font of spray printing character, color, background, font gradient and it is quick it is mobile in other The impact of interference factor, often causes the situation for recognizing mistake or None- identified to occur.It is emphasized that enabling identification Go out character, it is clearly not represent character;Simultaneously as in jet printing process character deformation, such as incline, stretch, cause Cannot automatic identification, such case can not conclude that character is unintelligible again.
The content of the invention
It is an object of the invention to overcome the deficiencies in the prior art, there is provided a kind of reasonable in design, high precision and can improve The coding definition machine vision detection method based on dot matrix of work efficiency.
The present invention solves its technical problem and takes technical scheme below to realize:
A kind of coding definition machine vision detection method based on dot matrix, comprises the following steps:
Step 1, the measured zone that character string picture is set, adjusted by human-computer interaction device, and will setting result transmission To smart camera;
Step 2, smart camera obtain the character string picture of package coding character;
Step 3, smart camera extract the pixel designated color ash in measured zone in all dot matrix of all characters respectively Angle value, and make the following judgment:
If the grey scale pixel value is less than the white threshold value of color gray scale, the pixel is labeled as into white pixel accumulative dot matrix The quantity of interior white pixel;
If the grey scale pixel value is more than the black threshold value of color gray scale, the pixel is labeled as into black pixel accumulative dot matrix The quantity of interior black pixel;
If the grey scale pixel value is other values, the pixel is labeled as into vague image in fuzzy pixel accumulative dot matrix The quantity of element;
The color area of all dot matrix of all characters in step 4, smart camera difference computation and measurement region, and carry out as Lower judgement:
If black elemental area is less than color area blank threshold plus fuzzy elemental area, the point is labeled as into 0;
If black elemental area is more than color area solid black threshold value, the point is labeled as into 1;
If other values, then the point is labeled as obscuring;
Step 5, smart camera enter line definition judgement as follows:
If any one point is noted as obscuring in the dot matrix of measured zone, judge the dot character as unintelligible;
If not being noted as fuzzy point, the dot matrix for being labeled as 0 and 1 is compared with standard character library dot matrix, if The character for fitting like a glove can be matched in standard character library, is then judged that the dot matrix is clear, is otherwise judged to unintelligible;
Step 6, smart camera send control command and by rejecting mechanism by coding character unsharp product to rejecting mechanism Product are rejected.
The concrete grammar of the step 1 is comprised the following steps:
(1) standard characters image is input into and is shown;
(2) character pattern number, character font and character color are input into;
(3) dot matrix measured zone is automatically generated by dot matrix number, the measured zone is divided into the quadrilateral area at interval;
(4) dot matrix measured zone is adjusted using flexible, inclined method, be allowed to coincide with actual characters image lattice;
(5) set the white threshold value of color gray scale of pixel, the black threshold value of color gray scale, set dot matrix color area blank threshold, Color area solid black threshold value;
(6) read LED matrix individual characters or image are pressed, for character or pattern in non-standard character repertoire, individually with dot matrix side Formula sets up model;
(7) setting result is sent to smart camera.
The character string picture includes Chinese character, letter, numeral, fixed character and blank character.
The method that (3) step generates dot matrix measured zone is:A character rectangular lattice is firstly generated, then Four angles of dilatory rectangle, the character is covered, until all characters in character string are covered, so as to obtain the dot matrix specified Measured zone, the dot matrix measured zone is by being about to character string automatic separation, and each character is individually divided into by coding character library Magnetic dot arrays.
The character pattern is the rectangular lattice between 5 × 5 to 32 × 20.
The white threshold value of the color gray scale, the black threshold value span of color gray scale are 0~255, the white threshold value of color gray scale and The black threshold value of color gray scale is set to 25 and 230;The color area blank threshold and color area solid black threshold value are set to 10% With 90%.
Advantages of the present invention and good effect are:
The present invention automatically generates dot matrix measured zone can according to character string picture by dot matrix number by human-computer interaction device Adjustment measured zone, smart camera according to the pixel designated color gray value in all dot matrix of all characters in measured zone and The color area of dot matrix carries out definition judgment, can accurately and reliably complete the identification to package coding character and judge, and By coding character unsharp product reject, with accuracy of judgement, high working efficiency, it is easy to use the features such as.
Description of the drawings
Fig. 1 is the system connection figure of the present invention;
Fig. 2 is character pattern structure (the 7 row X5 row) schematic diagram of the present invention.
Specific embodiment
The embodiment of the present invention is further described below in conjunction with accompanying drawing:
A kind of coding definition machine vision detection method based on dot matrix, is real in identifying system as shown in Figure 1 Existing, the identifying system includes smart camera 1, human-computer interaction device 2 and rejecting mechanism 3, smart camera and human-computer interaction device And rejecting mechanism is connected.Smart camera is used to obtain coding character picture, carry out the judgement of coding character sharpness and to rejecting Mechanism sends rejecting control command;Human-computer interaction device is shown for character string picture, measured zone sets and is adjusted and to intelligence Can camera transmission;Rejecting mechanism receives the control command of smart camera and rejects coding character unsharp product.
The present invention is comprised the following steps:
Step 1, the measured zone that character string picture is set, adjusted by human-computer interaction device, and will setting result transmission To smart camera.Concrete grammar includes following processing procedure:
(1) character string picture is input into and shows
In this step, the clear character string picture for detecting coding character is needed to be input to human-computer interaction device this batch In and shown.Character string picture input can carry out image by smart camera and obtain and send to human-computer interaction device, And shown by human-computer interaction device.
Character string includes:Chinese character, letter, numeral, fixed character and blank character.
(2) character pattern number, character font and character color are input into
In this step, by each character setting be 5 × 5 to 32 × 20 between rectangular lattice.The present embodiment is with 7X5 points Illustrate as a example by battle array, the rectangular lattice shown on the left of such as Fig. 2.
(3) dot matrix measured zone is automatically generated by dot matrix number:It is divided into the quadrilateral area at interval inside measured zone.
In this step, the concrete generation method of dot matrix measured zone is:Firstly generate the character rectangle of a 7X5=35 Dot matrix, then draws four angles of rectangle, and the character is covered, until all characters in character string are covered (including empty word Symbol), obtain the dot matrix measured zone specified.In fact, dot matrix measured zone is by being about to character string automatic separation, and by each word Symbol is individually divided into magnetic dot arrays by coding character library.Dot chart is displayed in measured zone, and dot chart can also be moved, every to adapt to The position of individual character.
(4) dot matrix measured zone adjustment:Stretch, incline the measured zone of single character, be allowed to and actual characters picture point Battle array is coincide.
Four points in measured zone, arbitrarily can draw, and the dot matrix of the inside is with dilatory auto Deformation.In this step In, the size, angle and deformation according to character picture adjusts width, length and the angle of inclination of measured zone, so as to incite somebody to action Character is covered.As coding character is possible to as tilted character, therefore, for tilted character, rectangle can be stretched Contracting, inclination, obtain inclined rectangular lattice as shown in the right side of fig 2.
When region adjustment is measured, each row can individually set angle of inclination, and in row, each interval can Length is adjusted individually.The gradient of each character is the same in principle.
(5) by read LED matrix individual characters or image:For character or pattern in non-standard character repertoire, can individually with point Battle array mode sets up model.
(6) the white threshold value of color gray scale, the black threshold value of color gray scale of pixel are set;The color area blank threshold of setting dot matrix Value, color area solid black threshold value.
The white threshold value of color gray scale, the black threshold value of color gray scale can be 0~255, in the present embodiment, the white threshold value of color gray scale 25 and 230 are set to the black threshold value of color gray scale.Color area blank threshold, color area solid black threshold value are set to 10% and 90%, When setting dot matrix value as 1, gray scale accounts for dot matrix area ratio for 90%.
(7) send the measured zone and measurement parameter after setting to smart camera.
Step 2, smart camera obtain the character string picture of package coding character;
Step 3, smart camera extract the pixel designated color ash in measured zone in all dot matrix of all characters respectively Angle value, and make the following judgment:
(1) if the grey scale pixel value is less than the white threshold value of color gray scale, the pixel is labeled as into white pixel;Accumulative point The quantity of white pixel in battle array;
(2) if the grey scale pixel value is more than the black threshold value of color gray scale, the pixel is labeled as into black pixel;Accumulative point The quantity of black pixel in battle array;
(3) if the grey scale pixel value is other values, the pixel is labeled as into fuzzy pixel, adds up to obscure in dot matrix The quantity of pixel.
The color area of all dot matrix of all characters in step 4, smart camera difference computation and measurement region, and carry out as Lower judgement:
(1) if black elemental area+fuzzy elemental area is less than color area blank threshold, the point is labeled as into 0;
(2) if black elemental area is more than color area solid black threshold value, the point is labeled as into 1;
(3) if other values, then the point is labeled as obscuring.
Step 5, smart camera enter line definition judgement
(1) in the dot matrix of measured zone, any one point is noted as obscuring, then judge the dot character as unintelligible;
(2) if not being noted as fuzzy point, the dot matrix of 0 and 1 will be labeled as, be compared with standard character library dot matrix, such as Fruit can match the character for fitting like a glove in character library, then judge that the dot matrix is clear, be otherwise judged to unintelligible.
It is emphasized that embodiment of the present invention is illustrative, rather than it is determinate, therefore present invention bag The embodiment for being not limited to described in specific embodiment is included, it is every by those skilled in the art's technology according to the present invention scheme The other embodiment for drawing, also belongs to the scope of protection of the invention.

Claims (6)

1. a kind of coding definition machine vision detection method based on dot matrix, it is characterised in that comprise the following steps:
Step 1, the measured zone that character string picture is set, adjusted by human-computer interaction device, and send setting result to intelligence Can camera;
Step 2, smart camera obtain the character string picture of package coding character;
Step 3, smart camera extract the pixel designated color gray value in measured zone in all dot matrix of all characters respectively, And make the following judgment:
If the grey scale pixel value is less than the white threshold value of color gray scale, the pixel is labeled as into white pixel accumulative dot matrix words spoken by an actor from offstage The quantity of pixel;
If the grey scale pixel value is more than the black threshold value of color gray scale, the pixel is labeled as black in black pixel accumulative dot matrix The quantity of pixel;
If the grey scale pixel value is other values, the pixel is labeled as obscuring pixel in fuzzy pixel accumulative dot matrix Quantity;
The color area of all dot matrix of all characters in step 4, smart camera difference computation and measurement region, and sentenced as follows It is disconnected:
If black elemental area is less than color area blank threshold plus fuzzy elemental area, the point is labeled as into 0;
If black elemental area is more than color area solid black threshold value, the point is labeled as into 1;
If other values, then the point is labeled as obscuring;
Step 5, smart camera enter line definition judgement as follows:
If any one point is noted as obscuring in the dot matrix of measured zone, judge the dot character as unintelligible;
If not being noted as fuzzy point, the dot matrix for being labeled as 0 and 1 is compared with standard character library dot matrix, if can be The character for fitting like a glove is matched in standard character library, is then judged that the dot matrix is clear, is otherwise judged to unintelligible;
Step 6, smart camera send control command to rejecting mechanism and pick coding character unsharp product by rejecting mechanism Remove.
2. a kind of coding definition machine vision detection method based on dot matrix according to claim 1, it is characterised in that: The concrete grammar of the step 1 is comprised the following steps:
(1) clear character string picture is input into and is shown;
(2) character pattern number, character font and character color are input into;
(3) dot matrix measured zone is automatically generated by dot matrix number, the measured zone is divided into the quadrilateral area at interval;
(4) dot matrix measured zone is adjusted using flexible, inclined method, be allowed to coincide with actual characters image lattice;
(5) the white threshold value of color gray scale, the black threshold value of color gray scale of pixel are set, color area blank threshold, the color of dot matrix is set Area solid black threshold value;
(6) read LED matrix individual characters or image are pressed, for character or pattern in non-standard character repertoire, is individually built with dot matrix way Formwork erection type;
(7) setting result is sent to smart camera.
3. a kind of coding definition machine vision detection method based on dot matrix according to claim 1, it is characterised in that: The character string picture includes Chinese character, letter, numeral, fixed character and blank character.
4. a kind of coding definition machine vision detection method based on dot matrix according to claim 2, it is characterised in that: The method that (3) step generates dot matrix measured zone is:A character rectangular lattice is firstly generated, rectangle is then drawn Four angles, the character is covered, until all characters in character string are covered, so as to the dot matrix measurement zone for obtaining specifying Domain, the dot matrix measured zone is by being about to character string automatic separation, and each character is divided into magnetic dot arrays by coding character library individually.
5. a kind of coding definition machine vision detection method based on dot matrix according to claim 2, it is characterised in that: The character pattern is the rectangular lattice between 5 × 5 to 32 × 20.
6. a kind of coding definition machine vision detection method based on dot matrix according to claim 1, it is characterised in that: The white threshold value of the color gray scale, the black threshold value span of color gray scale are 0~255, the white threshold value of color gray scale and color gray scale Black threshold value is set to 25 and 230;The color area blank threshold and color area solid black threshold value are set to 10% and 90%.
CN201610954433.XA 2016-11-03 2016-11-03 A kind of coding clarity machine vision detection method based on dot matrix Expired - Fee Related CN106530289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610954433.XA CN106530289B (en) 2016-11-03 2016-11-03 A kind of coding clarity machine vision detection method based on dot matrix

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610954433.XA CN106530289B (en) 2016-11-03 2016-11-03 A kind of coding clarity machine vision detection method based on dot matrix

Publications (2)

Publication Number Publication Date
CN106530289A true CN106530289A (en) 2017-03-22
CN106530289B CN106530289B (en) 2019-04-30

Family

ID=58325444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610954433.XA Expired - Fee Related CN106530289B (en) 2016-11-03 2016-11-03 A kind of coding clarity machine vision detection method based on dot matrix

Country Status (1)

Country Link
CN (1) CN106530289B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0683943A (en) * 1992-08-31 1994-03-25 Taiyo Yuden Co Ltd Print inspecting device
JPH08320931A (en) * 1995-05-25 1996-12-03 Taiyo Yuden Co Ltd Method and device for inspecting character
JP2007326327A (en) * 2006-06-09 2007-12-20 Kyodo Printing Co Ltd Inspection method and device of printed matter
CN104239909A (en) * 2014-08-11 2014-12-24 北京捷通华声语音技术有限公司 Method and device for recognizing images
CN104268538A (en) * 2014-10-13 2015-01-07 江南大学 Online visual inspection method for dot matrix sprayed code characters of beverage cans
CN104614384A (en) * 2015-02-06 2015-05-13 北京印刷学院 Quality detecting method of printing product character
CN105741330A (en) * 2014-12-10 2016-07-06 上海新宇箴诚电控科技有限公司 Code spraying method and code spraying device based on image dot matrix conversion

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0683943A (en) * 1992-08-31 1994-03-25 Taiyo Yuden Co Ltd Print inspecting device
JPH08320931A (en) * 1995-05-25 1996-12-03 Taiyo Yuden Co Ltd Method and device for inspecting character
JP2007326327A (en) * 2006-06-09 2007-12-20 Kyodo Printing Co Ltd Inspection method and device of printed matter
CN104239909A (en) * 2014-08-11 2014-12-24 北京捷通华声语音技术有限公司 Method and device for recognizing images
CN104268538A (en) * 2014-10-13 2015-01-07 江南大学 Online visual inspection method for dot matrix sprayed code characters of beverage cans
CN105741330A (en) * 2014-12-10 2016-07-06 上海新宇箴诚电控科技有限公司 Code spraying method and code spraying device based on image dot matrix conversion
CN104614384A (en) * 2015-02-06 2015-05-13 北京印刷学院 Quality detecting method of printing product character

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
毛洪辉, 鲍芳: "一种卡片喷码实时检测***", 《自动化技术与应用》 *

Also Published As

Publication number Publication date
CN106530289B (en) 2019-04-30

Similar Documents

Publication Publication Date Title
CN104992449B (en) Information identification and surface defect online test method based on machine vision
CN201159903Y (en) License plate recognition device
CN104318573B (en) Label defect inspection method
CN109308700A (en) A kind of visual identity defect inspection method based on printed matter character
CN101477631B (en) Method, equipment for extracting target from image and human-machine interaction system
WO2018086233A1 (en) Character segmentation method and device, and element detection method and device
CN112964724B (en) Multi-target multi-region visual detection method and detection system
CN105424722A (en) Bottle cap unqualified product marking method based on machine vision
CN104463124A (en) Milk box spray-printed character recognition method
CN106052793A (en) Machine vision based liquid level sub-quality product marking method
CN104881665A (en) Chip character identification and verification method and apparatus
CN104794480A (en) Method for eliminating milk boxes with defective printed characters
CN111591715A (en) Belt longitudinal tearing detection method and device
EP3051461B1 (en) A computer implemented system and method for extracting and recognizing alphanumeric characters from traffic signs
CN104700423A (en) Method and device for detecting bottle cap
CN109693140A (en) A kind of intelligent flexible production line and its working method
CN111652541B (en) Industrial production monitoring method, system and computer readable storage medium
CN114511704B (en) Spray printing code identification and detection method based on high-speed production line
CN103699876A (en) Method and device for identifying vehicle number based on linear array CCD (Charge Coupled Device) images
CN114266751A (en) AI technology-based product packaging bag coding defect detection method and system
CN106530289A (en) Code spraying definition machine vision detecting method based on lattices
CN105791815B (en) A kind of TV line automatic judging methods
CN106442536A (en) Machine-vision-based IC card automatic thread take-up device and method
CN108827974B (en) Ceramic tile defect detection method and system
CN113408388B (en) Detection method and device based on dot-like code spraying

Legal Events

Date Code Title Description
C06 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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190430

Termination date: 20211103