CN106778747A - A kind of method for detecting packing box spray printing character position offset amount - Google Patents
A kind of method for detecting packing box spray printing character position offset amount Download PDFInfo
- Publication number
- CN106778747A CN106778747A CN201611231013.5A CN201611231013A CN106778747A CN 106778747 A CN106778747 A CN 106778747A CN 201611231013 A CN201611231013 A CN 201611231013A CN 106778747 A CN106778747 A CN 106778747A
- Authority
- CN
- China
- Prior art keywords
- packing box
- character
- character string
- spray printing
- rectangle
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/14—Image acquisition
- G06V30/146—Aligning or centring of the image pick-up or image-field
- G06V30/1475—Inclination or skew detection or correction of characters or of image to be recognised
- G06V30/1478—Inclination or skew detection or correction of characters or of image to be recognised of characters or characters lines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/28—Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
Abstract
The present invention discloses a kind of method for detecting packing box spray printing character position offset amount, and the dotted rectangle for spray printing character has been printed on packing box, comprises the following steps:The image of the qualified packing box of a width spray printing character is gathered, this packing box is called template packing box;Preserve the size of dotted rectangle;A part of character string in character string rectangles is chosen as Character mother plate, and determines the center (X, Y) of Character mother plate;The gray value feature that there is some difference of gray value and background according to packing box, by the lower-right most point for projecting from right to left and packing box is found in projection from bottom to top;Position offset detects that judge that whether the point above whole character string rectangles, in dashed rectangle inframe, will not added up in the pixel of dashed rectangle inframe, calculating character string rectangle deflects away from the pixel percentage of dotted line frame as side-play amount.
Description
Technical field
The present invention relates to a kind of packing box spray printing character position offset quantity measuring method.
Background technology
The box-packed plain chocolate of Lile packaging, during production, due to carrying out spray printing on streamline, it may appear that spray printing
Character exceeds the problem for limiting frame (dotted rectangle), currently in order to this problem is excluded, using manual detection.But due to production
Speed is fast, and manual detection has fatigue and subjective factors.
The content of the invention
It is an object of the invention to provide a kind of Machine Vision Detection of packing box spray printing character position offset amount on production line
Method, the present invention takes following technical scheme:
A kind of method for detecting packing box spray printing character position offset amount, has printed for spray printing word on packing box
The dotted rectangle of symbol, comprises the following steps:
(1) image of the qualified packing box of one width spray printing character of collection, this packing box is called template packing box;
(2) size of dotted rectangle is preserved;A part of character string in character string rectangles is chosen as Character mother plate, and
Determine the center (X, Y) of Character mother plate;
(3) gray value according to packing box and the gray value of the background feature that there is some difference, by throwing from right to left
The lower-right most point of packing box is found in shadow and from bottom to top projection, and method is as follows:
1) segmentation threshold of binaryzation needs is obtained using iterative method, the image of the packing box of acquisition is carried out at binaryzation
Reason, binary map is converted into by gray-scale map;
2) binary map is projected;
3) lower-right most point of template packing box is obtained;
(4) position offset detection
1) altimetric image to be checked is gathered often by a packing box on production line;
2) treating detection image using the method for above-mentioned steps (3) carries out binary conversion treatment and finds packing box to be detected
Lower-right most point;
3) position of dotted rectangle is obtained;
4) position corresponding with Character mother plate partial character string further according to binary map, so as to obtain new center (X1,
Y1);
5) counted by formula sqrt ((X1-X) * (X1-X)+(Y1-Y) * (Y1-Y)) and arctan ((Y1-Y)/(X1-X))
Calculate character string rectangles the position of current packing box and with the deflection angle between template packing box;
6) whether the point above whole character string rectangles is judged in dashed rectangle inframe, by not in the picture of dashed rectangle inframe
Vegetarian refreshments is added up, and calculating character string rectangle deflects away from the pixel percentage of dotted line frame as side-play amount.
Wherein, the step of obtaining the segmentation threshold of binaryzation needs using iterative method is as follows:
A) maximum gradation value and minimum gradation value of packing box image are obtained, Rmax and Rmin is designated as respectively, make threshold value T=
(Rmax+Rmin)/2;
B) average gray value of image is divided into by two groups of R1 and R2 according to threshold value T;
C) two groups of average gray value μ 1 and μ 2 is obtained respectively;
D) new threshold value T=(μ 1+ μ 2)/2 is obtained
Due to taking above technical scheme, it has advantages below to the present invention:
(1) speed of test position side-play amount of the present invention is no more than 20ms.
(2) other disturbing factors that the present invention can be effectively beyond filter cartridge top, the accurate side-play amount for determining to print.
Brief description of the drawings
Fig. 1 is the artwork of the qualified milk package box of character spray printing
Fig. 2 is dotted line scope frame;
Fig. 3 is character string rectangles frame;
Fig. 4 is the bianry image for obtaining;
The upper figure and figure below of Fig. 5 are respectively upright projection and floor projection;
Fig. 6 is to find lower-right most point
Fig. 7 is qualified packing box
Fig. 8 is unqualified packing box
Specific embodiment
It is described in detail to of the invention with implementation below in conjunction with the accompanying drawings.
(1) image of the qualified milk package box of one width spray printing character of collection
Artwork such as Fig. 1, has printed dotted rectangle on packing box.Character should spray printing in dashed rectangle inframe.
(2) regional value of fixed size is set
Because spray printing font size is constant, the dotted rectangle size on packing box is constant, for convenience, can first this
The size in individual two regions is preserved;
Remarks:The position of dotted rectangle (see Fig. 2) be with lower-right most point distance it is fixed, character string rectangles (see Fig. 3)
Location-dependent query is in the center (X, Y) determined for template with character string " 2015 ";
(3) lower-right most point of packing box is searched in projection
Due to the gray value and the gray value of background of packing box, there is some difference, by project from right to left and from it is lower to
It is upper to project the lower-right most point for finding packing box.
First, the image of acquisition is converted, the image that will be collected is converted into binary map by gray-scale map (see Fig. 4):
The segmentation threshold of binaryzation needs is obtained using iterative method, its step is as follows:
1) maximum gradation value and minimum gradation value of image are obtained, Rmax and Rmin is designated as respectively, make threshold value T=(Rmax+
Rmin)/2。
2) average gray value of image is divided into by two groups of R1 and R2 according to threshold value T.
3) two groups of average gray value μ 1 and μ 2 is obtained respectively.
4) new threshold value T=(μ 1+ μ 2)/2 is obtained.
Secondly, binary map is projected (see Fig. 5);
Finally, the lower-right most point (see Fig. 6) of packing box is obtained;
(4) position offset detection
Often by a packing box, its image is gathered.The lower-right most point of packing box is first found using the above method, is then obtained
The position of dotted rectangle, obtains new center (X1, Y1), by formula sqrt further according to binary map positioning " 2015 "
((X1-X) * (X1-X)+(Y1-Y) * (Y1-Y)) calculates character string rectangles and is wrapped currently with arctan ((Y1-Y)/(X1-X))
The position of mounted box and with the deflection angle between template packing box, finally by function PtInRect cycle criterion character string rectangles
Whether the point in face will not added up in dashed rectangle inframe in the pixel of dashed rectangle inframe, and calculating character string rectangle is deflected away from
The pixel percentage of dotted line frame is used as side-play amount;Setting offset criteria, it is overproof to think unqualified;Qualified packing box is shown in figure
7, unqualified packing box is shown in Fig. 8.
Claims (2)
1. a kind of method for detecting packing box spray printing character position offset amount, has printed for spray printing character on packing box
Dotted rectangle, comprise the following steps:
(1) image of the qualified packing box of one width spray printing character of collection, this packing box is called template packing box;
(2) size of dotted rectangle is preserved;A part of character string in character string rectangles is chosen as Character mother plate, and is determined
The center (X, Y) of Character mother plate;
(3) gray value according to packing box and the gray value of the background feature that there is some difference, by projecting from right to left and
The lower-right most point of packing box is found in projection from bottom to top, and method is as follows:
1) segmentation threshold of binaryzation needs is obtained using iterative method, the image of the packing box of acquisition is carried out into binary conversion treatment,
Binary map is converted into by gray-scale map;
2) binary map is projected;
3) lower-right most point of template packing box is obtained;
(4) position offset detection
1) altimetric image to be checked is gathered often by a packing box on production line;
2) treating detection image using the method for above-mentioned steps (3) carries out binary conversion treatment and finds the bottom right of packing box to be detected
Point;
3) position of dotted rectangle is obtained;
4) partial character string corresponding with Character mother plate is positioned further according to binary map, so as to obtain new center (X1, Y1);
5) calculated by formula sqrt ((X1-X) * (X1-X)+(Y1-Y) * (Y1-Y)) and arctan ((Y1-Y)/(X1-X))
Character string rectangles the position of current packing box and with the deflection angle between template packing box;
6) whether the point above whole character string rectangles is judged in dashed rectangle inframe, by not in the pixel of dashed rectangle inframe
Add up, calculating character string rectangle deflects away from the pixel percentage of dotted line frame as side-play amount.
2. the method for detection packing box spray printing character position offset amount according to claim 1, it is characterised in that using changing
The step of obtaining the segmentation threshold of binaryzation needs for method is as follows:
A) maximum gradation value and minimum gradation value of packing box image are obtained, Rmax and Rmin is designated as respectively, make threshold value T=
(Rmax+Rmin)/2;
B) average gray value of image is divided into by two groups of R1 and R2 according to threshold value T;
C) two groups of average gray value μ 1 and μ 2 is obtained respectively;
D) new threshold value T=(μ 1+ μ 2)/2 is obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611231013.5A CN106778747A (en) | 2016-12-28 | 2016-12-28 | A kind of method for detecting packing box spray printing character position offset amount |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611231013.5A CN106778747A (en) | 2016-12-28 | 2016-12-28 | A kind of method for detecting packing box spray printing character position offset amount |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106778747A true CN106778747A (en) | 2017-05-31 |
Family
ID=58921095
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611231013.5A Pending CN106778747A (en) | 2016-12-28 | 2016-12-28 | A kind of method for detecting packing box spray printing character position offset amount |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106778747A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113687601A (en) * | 2020-05-18 | 2021-11-23 | 联华电子股份有限公司 | Automatic adjustment method of equipment and intelligent adjustment device applying same |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102519972A (en) * | 2011-12-10 | 2012-06-27 | 山东明佳包装检测科技有限公司 | Detection method of PET bottle cap and liquid level |
CN103226106A (en) * | 2013-03-15 | 2013-07-31 | 江南大学 | Machine vision based bearing dust cap quality monitoring system |
US8594431B2 (en) * | 2008-12-30 | 2013-11-26 | International Business Machines Corporation | Adaptive partial character recognition |
CN104794480A (en) * | 2014-12-11 | 2015-07-22 | 天津普达软件技术有限公司 | Method for eliminating milk boxes with defective printed characters |
CN106127763A (en) * | 2016-06-23 | 2016-11-16 | 成都神州数码索贝科技有限公司 | One has extensive adaptive image binaryzation method |
-
2016
- 2016-12-28 CN CN201611231013.5A patent/CN106778747A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8594431B2 (en) * | 2008-12-30 | 2013-11-26 | International Business Machines Corporation | Adaptive partial character recognition |
CN102519972A (en) * | 2011-12-10 | 2012-06-27 | 山东明佳包装检测科技有限公司 | Detection method of PET bottle cap and liquid level |
CN103226106A (en) * | 2013-03-15 | 2013-07-31 | 江南大学 | Machine vision based bearing dust cap quality monitoring system |
CN104794480A (en) * | 2014-12-11 | 2015-07-22 | 天津普达软件技术有限公司 | Method for eliminating milk boxes with defective printed characters |
CN106127763A (en) * | 2016-06-23 | 2016-11-16 | 成都神州数码索贝科技有限公司 | One has extensive adaptive image binaryzation method |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113687601A (en) * | 2020-05-18 | 2021-11-23 | 联华电子股份有限公司 | Automatic adjustment method of equipment and intelligent adjustment device applying same |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101117043B (en) | Silk screen printing device | |
CN113077453B (en) | Circuit board component defect detection method based on deep learning | |
CN113724193B (en) | PCBA part size and clearance high-precision visual measurement method | |
CN103439348B (en) | Remote controller key defect detection method based on difference image method | |
US20180068460A1 (en) | Liquid Level Detecting System and Method thereof | |
CN110766748B (en) | Non-contact whole vehicle attitude measurement method | |
JP2013113600A (en) | Stereo three-dimensional measuring apparatus | |
CN110738092B (en) | Invoice text detection method | |
CN108364675A (en) | A kind of identification method of food weight and nutrient content based on image recognition | |
CN111862055B (en) | Bubble turning cavity defect detection method based on image processing | |
CN107730521B (en) | Method for rapidly detecting ridge type edge in image | |
CN103175851B (en) | Calibrating tool and calibrating method for multi-camera scanning system | |
JP2015072577A (en) | Moving object detector | |
CN108709500B (en) | Circuit board element positioning and matching method | |
CN104853539A (en) | Method for fully automatically detecting surface-mounting precision of electronic elements | |
CN104408727B (en) | A kind of image border smear detecting method and system | |
CN106778747A (en) | A kind of method for detecting packing box spray printing character position offset amount | |
CN106651851A (en) | Unaccepted product rejecting method of packing carton spray printing characters out of bounds | |
CN103955673B (en) | Body recognizing method based on head and shoulder model | |
CN106651852A (en) | Detection method for key stroke missing of spray printed character | |
CN117232396B (en) | Visual detection system and method for product quality of high-speed production line | |
CN114187253A (en) | Circuit board part installation detection method | |
CN106651850A (en) | Method detecting whether packing box printed character position is qualified or not | |
CN104318231A (en) | Quick locating method for ballot image | |
CN103279979B (en) | Based on the detection method of the nearly cylinder bottle label of 3D modeling |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20170531 |
|
WD01 | Invention patent application deemed withdrawn after publication |