CN110929533B - Label detection method - Google Patents

Label detection method Download PDF

Info

Publication number
CN110929533B
CN110929533B CN201911095487.5A CN201911095487A CN110929533B CN 110929533 B CN110929533 B CN 110929533B CN 201911095487 A CN201911095487 A CN 201911095487A CN 110929533 B CN110929533 B CN 110929533B
Authority
CN
China
Prior art keywords
label
image
labels
judging
feature code
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
CN201911095487.5A
Other languages
Chinese (zh)
Other versions
CN110929533A (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.)
Shanghai Zhongtai Packaging Technology Co ltd
Original Assignee
Shanghai Zhongtai Packaging Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Zhongtai Packaging Technology Co ltd filed Critical Shanghai Zhongtai Packaging Technology Co ltd
Priority to CN201911095487.5A priority Critical patent/CN110929533B/en
Publication of CN110929533A publication Critical patent/CN110929533A/en
Application granted granted Critical
Publication of CN110929533B publication Critical patent/CN110929533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/01Details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1456Methods for optical code recognition including a method step for retrieval of the optical code determining the orientation of the optical code with respect to the reader and correcting therefore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1473Methods for optical code recognition the method including quality enhancement steps error correction

Abstract

The invention relates to the technical field of labels, and discloses a label detection method, which comprises the following steps: calibrating a feature code on the linear image; acquiring a linear image of the tag in the transverse direction; acquiring label information of a linear image at a set position; identifying whether the information of the set position has a feature code, and if the feature code does not appear, judging that the label is skewed or reversed; by identifying the label information at the set position, when the label is skewed or reversed, the characteristic code information at the set position in the corresponding linear image is lost, and whether the label is skewed or reversed is judged according to the lost characteristic code information, so that the method is direct and accurate, and the screening effect is good.

Description

Label detection method
Technical Field
The invention relates to the technical field of labels, in particular to a label detection method.
Background
Labels are printed matter used to identify the relevant instructions for the product and are mostly self-adhesive on the back. But some are not adhesive when printed and may also be referred to as labels. The labels with glue are commonly called as 'self-adhesive labels'. The label problem after the instrument is calibrated is that the label is uniformly regulated by the country, and the label can clearly indicate the details of the calibrated instrument.
The existing label production line can carry out factory detection on labels before the labels are wound and packaged, the detection content is whether patterns on the labels are clear, complete or correct by using a camera to shoot the labels and to screen the shot images, but whether the labels are askew or reversely pasted by 180 degrees cannot be screened well.
Disclosure of Invention
Aiming at the prior art, the invention provides a label detection method which can well distinguish whether labels are attached askew or attached reversely.
In order to achieve the above purpose, the present invention provides the following technical solutions:
a label detection method comprising the steps of:
calibrating a feature code on the linear image;
acquiring a linear image of the tag in the transverse direction;
acquiring label information of a linear image at a set position;
and identifying whether the information of the set position has the feature code, and if the feature code does not appear, judging that the label is skewed or reversed.
Through adopting above-mentioned technical scheme, through discernment to the label information on the settlement position, after the label appears crooked or backward, the characteristic code information of settlement position in the corresponding linear image can lose, judges whether the label crooked or backward according to the characteristic code information that loses, and is direct and accurate, the discrimination is effectual.
The invention is further arranged that the acquiring the linear image of the tag in the transverse direction comprises:
the labels are a row of label groups containing even numbers of labels, and the linear image contains partial images of a plurality of labels;
folding the linear images in half, adding the folded linear images, and performing equidistant traversal on the added arrays by using feature codes;
and judging that the image skew or the reverse direction exists on the label corresponding to the position with the dispersion higher than the set dispersion value after traversing.
By adopting the technical scheme, the reverse characteristics of the label image can be well highlighted after the label image is folded in half, and the reverse recognition rate of the image is improved.
The invention further provides that the judging that the label corresponding to the position with the dispersion higher than the set dispersion value after traversing is judged to have the image skew or the reverse direction comprises the following steps:
sequentially identifying the corresponding labels;
and identifying whether the information of the set position in the label has the feature code, and if the feature code does not appear, judging that the label is askew or reverse.
By adopting the technical scheme, the truly skewed or reversed label can be found out from the folded label image, so that the label is corrected.
The invention is further arranged that the acquiring the linear image of the tag in the transverse direction comprises:
the labels are a row of label groups containing even numbers of labels, and the linear image contains partial images of a plurality of labels;
cutting the linear image along the middle position, then folding the two parts forward, adding the two parts forward, and carrying out equidistant traversal on the added array by using a feature code with the value twice as large as that of the array;
and judging that the image skew or the reverse direction exists on the label corresponding to the position with the dispersion higher than the set dispersion value after traversing.
By adopting the technical scheme, the characteristic of label image deflection can be well highlighted after forward folding, and the recognition rate of image deflection is improved.
The invention further provides that the judging that the label corresponding to the position with the dispersion higher than the set dispersion value after traversing is judged to have the image skew or the reverse direction comprises the following steps:
sequentially identifying the corresponding labels;
identifying whether the information of the set position in the label presents a feature code, if not, judging that the label presents a reverse direction, and if the feature code presents, judging that the label presents a skew.
By adopting the technical scheme, the truly skewed or inverted label can be found out from the folded label image, so that the label is corrected.
The invention is further arranged that the acquiring the linear image of the tag in the transverse direction comprises:
the labels are a row of label groups containing even numbers of labels, the number of the labels in the label groups is larger than two, and the linear image contains partial images of a plurality of labels;
cutting the linear image along the middle position, then folding and adding the two parts in the forward direction, folding and adding the two parts, and performing equidistant traversal on the added array by using a characteristic code with four times of numerical values;
and judging that the image skew or the reverse direction exists on the label corresponding to the position with the dispersion higher than the set dispersion value after traversing.
By adopting the technical scheme, the label can be amplified in the reverse dispersion degree by forward folding and then folding, so that the detection precision of the skew condition or the reverse condition can not be reduced in the subsequent equidistant traversing process, and the detection precision of the skew condition of the label is close to the reverse precision of the detection label.
The invention further provides that the judging that the label corresponding to the position with the dispersion higher than the set dispersion value after traversing is judged to have the image skew or the reverse direction comprises the following steps:
sequentially identifying the corresponding labels;
identifying whether the information of the set position in the label presents a feature code, if not, judging that the label presents a reverse direction, and if the feature code presents, judging that the label presents a skew.
By adopting the technical scheme, the truly skewed or inverted label can be found out from the folded label image, so that the label is corrected.
The invention is further arranged such that the dispersion is the sum of squares of all corresponding pixel absolute values between an image of the same size as the standard label image and the standard label image.
By adopting the technical scheme, the difference points of the pixels between the two images can be amplified by using the dispersion algorithm and are always kept in the calculation process, so that the neutralization by errors of other pixels is avoided.
The invention is further arranged that the standard label image size is the number of pixels of a single label width, and the equidistance in the equidistant traversal is the sum of the label width and the label interval width.
By adopting the technical scheme, the label interval width is calculated in the equal distance, so that the accuracy after traversal is improved.
In summary, the beneficial technical effects of the invention are as follows: the label information on the set position is identified by using an algorithm of equidistant traversal after doubling, equidistant traversal after forward folding or equidistant traversal after first forward folding and then doubling, when the label is askew or reversed, the characteristic code information of the set position in the corresponding linear image is lost, whether the label is askew or reversed is judged according to the lost characteristic code information, and the method is direct and accurate and has a good screening effect.
Drawings
FIG. 1 is a flow chart of a method according to a first embodiment of the invention;
FIG. 2 is a flow chart of a method of folding and adding in half according to an embodiment of the present invention;
FIG. 3 is a flow chart of a method according to a second embodiment of the present invention;
fig. 4 is a flowchart of a method according to a third embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and examples.
Embodiment one:
a label detection method, as shown in figure 1, comprises the following steps:
and calibrating the feature codes on the linear images. The bar code content on the label can be used as the feature code, and the feature code is read by using the bar code reading device, wherein the position of the bar code on the label is preferably not in the middle, and whether the label is reverse can be rapidly identified by the position of the bar code not in the middle. If the label is reversed, the bar code reader will not read the feature code.
A linear image of the tag in the transverse direction is acquired. The linear CCD camera can be used for shooting the labels on the label production line, and the shot images are one row of gray values, namely one row of arrays. Or scan the tag using a bar code reader.
And acquiring label information of the linear image at the set position. And welding a cross rod on a label generating line, and installing a linear CCD camera or a bar code reading device on the cross rod to align the label or a set position on the aligned label.
And identifying whether the information of the set position has the feature code, and if the feature code does not appear, judging that the label is skewed or reversed.
Wherein, as shown in fig. 2, the obtaining a linear image of the tag in the transverse direction includes:
the labels are a row of label groups containing even numbers of labels, and the linear image contains partial images of a plurality of labels;
and folding the linear images in half, adding, and performing equidistant traversal on the added array by using the feature codes. The standard label image size is the number of pixels with a single label width, and the equal distance in the equal distance traversal is the sum of the label width and the label interval width. And the label interval width is calculated in the equidistant, so that the accuracy after traversal is improved.
And judging that the image skew or the reverse direction exists on the label corresponding to the position with the dispersion higher than the set dispersion value after traversing. The dispersion is the sum of squares of absolute values of all corresponding pixels between the image with the same size as the standard label image and the standard label image. The dispersion algorithm can amplify the difference points of pixels between two images and keep the difference points in the calculation process all the time, avoid the difference points to be neutralized by the errors of other pixels and disappear, and ensure that the label offset or reverse characteristics are reflected in the result.
And sequentially identifying the corresponding labels. And identifying the label judged to have the image skew or the reverse direction again, so as to identify the label which is normal in folding. The folded labels are firstly identified, then the paired labels which are skewed or reversed are identified one by one, so that the identification quantity of the labels is reduced, the characteristic embodiment of the skewed labels or the reversed labels is highlighted, and the identification accuracy is improved.
And identifying whether the information of the set position in the label has the feature code, and if the feature code does not appear, judging that the label is askew or reverse.
The reverse feature of the label image can be well highlighted after the label is folded in half, and the reverse recognition rate of the image is improved by recognizing the label information at the set position. When the label is skewed or reversed, the feature code information of the set position in the corresponding linear image is lost, whether the label is skewed or reversed is judged according to the lost feature code information, and the method is direct and accurate and has good screening effect. The truly skewed or inverted label can be found from the doubled-up label image, thereby correcting the label.
Embodiment two:
as shown in fig. 3, the tag detection method is different from the first embodiment in that it includes the following steps:
the obtaining of the linear image of the label in the transverse direction comprises the following steps:
the labels are a row of label groups containing even numbers of labels, and the linear image contains partial images of a plurality of labels.
And cutting the linear image along the middle position, folding the two parts forward, adding the two parts forward, and carrying out equidistant traversal on the added array by using a feature code with double numerical values. The middle point of the linear image is arranged at the interval between the labels, so that one label is cut after the middle position of the linear image is cut, and the damage of the label image is prevented.
And judging that the image skew or the reverse direction exists on the label corresponding to the position with the dispersion higher than the set dispersion value after traversing. The feature of label image skew can be well highlighted after forward folding, and the recognition rate of image skew is improved.
Then, the corresponding tags are sequentially identified. Identifying whether the information of the set position in the label presents a feature code, if not, judging that the label presents a reverse direction, and if the feature code presents, judging that the label presents a skew. The truly skewed or inverted label can be found from the folded label image, thereby correcting the label.
Embodiment III:
as shown in fig. 4, the tag detection method is different from the second embodiment in that the obtaining of the linear image of the tag in the lateral direction includes:
the labels are a row of label groups containing even numbers of labels, the number of the labels in the label groups is greater than two, and the linear image contains part of images of a plurality of labels. The middle point of the linear image is arranged at the interval between the labels, so that one label is cut after the middle position of the linear image is cut, and the damage of the label image is prevented.
The linear image is cut along the middle position, the two parts are folded forward and added, then folded and added, and the added array is traversed equidistantly by using the feature codes with four times of numerical values. The number of labels in the label group is greater than two and is even, so that the label image is not damaged after the linear image is folded twice.
And judging that the image skew or the reverse direction exists on the label corresponding to the position with the dispersion higher than the set dispersion value after traversing. The forward folding and the backward folding can enable the skew dispersion of the label to amplify the reverse dispersion of the label, so that the detection precision of skew condition or reverse condition can not be reduced in the subsequent equidistant traversing process, and the skew detection precision of the label is close to the reverse detection precision of the label.
The embodiments of the present invention are all preferred embodiments of the present invention, and are not intended to limit the scope of the present invention in this way, therefore: all equivalent changes in structure, shape and principle of the invention should be covered in the scope of protection of the invention.

Claims (6)

1. The label detection method is characterized by comprising the following steps of:
calibrating a feature code on the linear image;
acquiring a linear image of the tag in the transverse direction;
acquiring label information of a linear image at a set position;
identifying whether the information of the set position has a feature code, if the feature code does not appear, judging that the label is askew or reverse, wherein the obtaining of the linear image of the label in the transverse direction comprises the following steps:
the labels are a row of label groups containing even numbers of labels, the number of the labels in the label groups is larger than two, and the linear image contains partial images of a plurality of labels;
folding the linear images in half, adding the folded linear images, and performing equidistant traversal on the added arrays by using feature codes;
judging that the image skew or the reverse exists on the label corresponding to the position with the dispersion higher than the set discrete value after traversing;
cutting the linear image along the middle position, then folding and adding the two parts in the forward direction, folding and adding the two parts, and performing equidistant traversal on the added array by using a characteristic code with four times of numerical values;
judging that the image skew or the reverse exists on the label corresponding to the position with the dispersion higher than the set discrete value after traversing;
the dispersion is the sum of all corresponding pixel absolute value squares between the image with the same size as the standard label image and the standard label image.
2. The method according to claim 1, wherein determining that the label corresponding to the position where the dispersion after the traversal is higher than the set dispersion value is the image skew or the reverse direction comprises:
sequentially identifying the corresponding labels;
and identifying whether the information of the set position in the label has the feature code, and if the feature code does not appear, judging that the label is askew or reverse.
3. The tag detection method according to claim 1, wherein the acquiring a linear image of the tag in the lateral direction includes:
the labels are a row of label groups containing even numbers of labels, and the linear image contains partial images of a plurality of labels;
cutting the linear image along the middle position, then folding the two parts forward, adding the two parts forward, and carrying out equidistant traversal on the added array by using a feature code with the value twice as large as that of the array;
and judging that the image skew or the reverse direction exists on the label corresponding to the position with the dispersion higher than the set dispersion value after traversing.
4. The method according to claim 3, wherein determining that the label corresponding to the position where the dispersion after the traversal is higher than the set dispersion value is the image skew or the reverse direction comprises:
sequentially identifying the corresponding labels;
identifying whether the information of the set position in the label presents a feature code, if not, judging that the label presents a reverse direction, and if the feature code presents, judging that the label presents a skew.
5. The method according to claim 1, wherein determining that the label corresponding to the position where the dispersion after the traversal is higher than the set dispersion value is the image skew or the reverse direction comprises:
sequentially identifying the corresponding labels;
identifying whether the information of the set position in the label presents a feature code, if not, judging that the label presents a reverse direction, and if the feature code presents, judging that the label presents a skew.
6. The method of claim 1, wherein the standard label image size is the number of pixels of a single label width, and the equidistance in the equidistant traversal is the sum of the label width and the label spacing width.
CN201911095487.5A 2019-11-11 2019-11-11 Label detection method Active CN110929533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911095487.5A CN110929533B (en) 2019-11-11 2019-11-11 Label detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911095487.5A CN110929533B (en) 2019-11-11 2019-11-11 Label detection method

Publications (2)

Publication Number Publication Date
CN110929533A CN110929533A (en) 2020-03-27
CN110929533B true CN110929533B (en) 2023-12-29

Family

ID=69853810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911095487.5A Active CN110929533B (en) 2019-11-11 2019-11-11 Label detection method

Country Status (1)

Country Link
CN (1) CN110929533B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1707223A (en) * 2004-06-12 2005-12-14 杨建华 Indoor moving robot positioning system and method based on bar code
CN101661564A (en) * 2008-08-28 2010-03-03 国际商业机器公司 Bar code generating/identifying device and method
CN205581925U (en) * 2016-04-15 2016-09-14 大连声鹭科技有限公司 Anti -fake bar code label of nested type, anti -fake bar code tag information collector and anti -fake verification system
CN109086643A (en) * 2018-06-05 2018-12-25 四川斐讯信息技术有限公司 A kind of gift box label detection method and system based on machine vision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1707223A (en) * 2004-06-12 2005-12-14 杨建华 Indoor moving robot positioning system and method based on bar code
CN101661564A (en) * 2008-08-28 2010-03-03 国际商业机器公司 Bar code generating/identifying device and method
CN205581925U (en) * 2016-04-15 2016-09-14 大连声鹭科技有限公司 Anti -fake bar code label of nested type, anti -fake bar code tag information collector and anti -fake verification system
CN109086643A (en) * 2018-06-05 2018-12-25 四川斐讯信息技术有限公司 A kind of gift box label detection method and system based on machine vision

Also Published As

Publication number Publication date
CN110929533A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
EP0669593B1 (en) Two-dimensional code recognition method
US20060175414A1 (en) Method for reading out symbol information and device for reading out symbol information
CN103366147B (en) Optoelectronic device for measurement structure and object size and calibration steps
US5515447A (en) Method and apparatus for locating an acquisition target in two-dimensional images by detecting symmetry in two different directions
EP0999519B1 (en) Distortion correction method in optical code reading
US20110101101A1 (en) Decoding distorted symbols
CN101582162B (en) Art identifying method based on texture analysis
US9070033B2 (en) Stack barcode reader and stack barcode reading method
CN109214229B (en) Bar code scanning method and device and electronic equipment
US7085432B2 (en) Edge detection using Hough transformation
CN113449536B (en) Bar code image repairing method and device, computer equipment and storage medium
US8381983B2 (en) Apparatus and method for reading barcode
CN111339797A (en) Decoding method and terminal capable of accurately identifying damaged one-dimensional bar code
CN110929533B (en) Label detection method
US10460142B2 (en) Barcode identification method for improving decoding reliability by correcting image distortion
EP1455298B1 (en) Method and system for enhancing bar code reading
US8393542B2 (en) Method and apparatus for reading stacked bar code information
CN109740403B (en) Method and device for reading one-dimensional bar code
CN110020571B (en) Two-dimensional code correction method, device and equipment
JP2007102386A (en) Symbol information reading method and symbol information reading device
EP2851844A2 (en) Information recognition processing device and diagnosis method
CN113420579B (en) Training and positioning method and device for identification code position positioning model and electronic equipment
WO1996005571A1 (en) Method and apparatus for locating and extracting data from a two-dimensional code
KR101074278B1 (en) Apparatus for inspecting RFID Tag and method for thereof
CN110263597B (en) Quick and accurate QR (quick response) code correction method and system

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