CN108254386B - One-dimensional code online detection method, device and system - Google Patents

One-dimensional code online detection method, device and system Download PDF

Info

Publication number
CN108254386B
CN108254386B CN201611244968.4A CN201611244968A CN108254386B CN 108254386 B CN108254386 B CN 108254386B CN 201611244968 A CN201611244968 A CN 201611244968A CN 108254386 B CN108254386 B CN 108254386B
Authority
CN
China
Prior art keywords
dimensional code
character string
image
photo
decoding
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
CN201611244968.4A
Other languages
Chinese (zh)
Other versions
CN108254386A (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.)
EVOC Intelligent Technology Co Ltd
Original Assignee
EVOC Intelligent 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 EVOC Intelligent Technology Co Ltd filed Critical EVOC Intelligent Technology Co Ltd
Priority to CN201611244968.4A priority Critical patent/CN108254386B/en
Publication of CN108254386A publication Critical patent/CN108254386A/en
Application granted granted Critical
Publication of CN108254386B publication Critical patent/CN108254386B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/89Investigating the presence of flaws or contamination in moving material, e.g. running paper or textiles
    • G01N21/8901Optical details; Scanning details

Landscapes

  • Engineering & Computer Science (AREA)
  • Textile Engineering (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Character Input (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a one-dimensional code online detection method, a device and a system. The method comprises the following steps: when the box provided with the one-dimensional code label passes through a bar-shaped light source area of the camera, photographing the box provided with the one-dimensional code label; judging whether a photo obtained after the box provided with the one-dimensional code label is photographed is available; when the photo is available, cutting a one-dimensional code area in the photo to obtain a one-dimensional code image; performing image processing and decoding on the one-dimensional code image to obtain a one-dimensional code character string; comparing the one-dimensional code character string with a manually input one-dimensional code character string; and when the one-dimensional code character string is completely matched with the manually input one-dimensional code character string, the one-dimensional code online detection is successful, otherwise, the one-dimensional code online detection fails. The invention can avoid the problem of decoding failure and improve decoding efficiency.

Description

One-dimensional code online detection method, device and system
Technical Field
The invention relates to the technical field of image processing, in particular to a one-dimensional code online detection method, device and system.
Background
The one-dimensional code label of the commodity contains all information of the production place, the type, the production date, the weight, the size and the like of the commodity, and a buyer and a seller can conveniently obtain all the information of the product by scanning the one-dimensional code, so that the correct identification and reading of the one-dimensional code have great significance for commodity circulation, and in order to ensure the correct identification and reading of the one-dimensional code, the seller becomes an indispensable link for online detection of the one-dimensional code of the commodity before the commodity circulation leaves a factory.
The existing one-dimensional code online detection process of a factory is shown in fig. 1: the boxes 5 containing the one-dimensional code labels, which may be present at any position of the boxes, flow along the line arrangement 3. When the photoelectric detection switch 1 detects that the box passes through the photographing area 4, the camera 1 is triggered to photograph and only takes a photograph once, the camera stops working after the photographing is finished, and the photographed photograph is transmitted to the one-dimensional code decoding system 2. After receiving the photo, the one-dimensional code decoding system 2 performs global search on the photo by using a one-dimensional code detection operator, searches for a one-dimensional code region, and decodes the whole photo by using a decoding combination operator.
In the process of implementing the invention, the inventor finds that at least the following technical problems exist in the prior art:
the existing one-dimensional code detection method only takes one picture, so that the problem of decoding failure caused by that the taken picture does not contain one-dimensional code information or only contains partial one-dimensional code information and the one-dimensional code picture is obliquely deformed exists, and meanwhile, when a one-dimensional code detection operator carries out global search on the picture, the problem of low decoding efficiency exists because too much decoding information exists.
Disclosure of Invention
The invention provides a one-dimensional code online detection method, a one-dimensional code online detection device and a one-dimensional code online detection system, which can solve the problem of decoding failure caused by the fact that a shot picture in the existing scheme does not contain one-dimensional code information or only contains partial one-dimensional code information and the one-dimensional code picture is obliquely deformed, and improve decoding efficiency.
In a first aspect, the present invention provides an online detection method for a one-dimensional code, including:
when the box provided with the one-dimensional code label passes through a bar-shaped light source area of the camera, photographing the box provided with the one-dimensional code label;
judging whether a photo obtained after the box provided with the one-dimensional code label is photographed is available;
when the photo is available, cutting a one-dimensional code area in the photo to obtain a one-dimensional code image;
performing image processing and decoding on the one-dimensional code image to obtain a one-dimensional code character string;
comparing the one-dimensional code character string with a manually input one-dimensional code character string;
and when the one-dimensional code character string is completely matched with the manually input one-dimensional code character string, the one-dimensional code online detection is successful, otherwise, the one-dimensional code online detection fails.
Optionally, the determining whether a photo obtained after the box with the one-dimensional code label is photographed may include:
positioning a one-dimensional code region in the photo by using a one-dimensional code search operator;
and when the central point of the one-dimensional code region is in a region of +/-10% of the central point of the photo, the photo is considered to be available, otherwise, the box with the one-dimensional code label is photographed again.
Optionally, the image processing and decoding the one-dimensional code image to obtain a one-dimensional code character string includes:
filtering the one-dimensional code image through a local enhancement operator;
correcting the situation that the one-dimensional code image has deformation by using a projective transformation operator;
correcting the condition that the one-dimensional code image is not parallel to the detection plane by using an image rotation operator;
and decoding the corrected one-dimensional code image into a one-dimensional code character string.
Optionally, decoding the corrected one-dimensional code image into a one-dimensional code character string includes:
and decoding the bar code bar in the one-dimensional code image into a one-dimensional code character string by using a setting operator and a decoding operator.
In a second aspect, the present invention provides an online detection device for one-dimensional codes, including:
the photographing unit is used for photographing the box provided with the one-dimensional code label when the box provided with the one-dimensional code label passes through the strip-shaped light source area of the camera;
the judging unit is used for judging whether a photo obtained after the box provided with the one-dimensional code label is photographed is available;
the cropping unit is used for cropping a one-dimensional code area in the photo to obtain a one-dimensional code image when the photo is available;
the processing unit is used for carrying out image processing and decoding on the one-dimensional code image to obtain a one-dimensional code character string;
the comparison unit is used for comparing the one-dimensional code character string with a manually input one-dimensional code character string;
and the confirming unit is used for successfully detecting the one-dimensional code on line when the one-dimensional code character string is completely coincided with the manually input one-dimensional code character string, and otherwise, failing to detect the one-dimensional code on line.
Optionally, the determining unit includes:
the positioning module is used for positioning the one-dimensional code region in the photo by utilizing a one-dimensional code search operator;
and the judging module is used for considering that the photo is available when the central point of the one-dimensional code region is in a region with the central point +/-10% of the photo, and otherwise, re-photographing the box with the one-dimensional code label.
Optionally, the processing unit comprises:
the filtering module is used for filtering the one-dimensional code image through a local enhancement operator;
the first correction module is used for correcting the situation that the one-dimensional code image has deformation by using a projective transformation operator;
the second correction module is used for correcting the condition that the one-dimensional code image is not parallel to the detection plane by using an image rotation operator;
and the decoding module is used for decoding the corrected one-dimensional code image into a one-dimensional code character string.
Optionally, the decoding module is further configured to:
and decoding the bar code bar in the one-dimensional code image into a one-dimensional code character string by using a setting operator and a decoding operator.
In a third aspect, the present invention provides an on-line detection system for one-dimensional codes, which includes the one-dimensional code on-line detection apparatus.
According to the one-dimensional code online detection method, the one-dimensional code online detection device and the one-dimensional code online detection system, whether the one-dimensional code photo after being photographed is available is detected, whether the photo is reselected is determined according to the detection result, meanwhile, the one-dimensional code area is intercepted from the available one-dimensional code photo, the image processing data of the system are greatly reduced, and the operation efficiency and the decoding success rate are improved.
Drawings
FIG. 1 is a flow chart of a one-dimensional code on-line detection method in the prior art according to the present invention;
FIG. 2 is a flowchart illustrating an on-line detection method for one-dimensional codes according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an on-line detection apparatus for one-dimensional codes according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of the determining unit 12 in FIG. 2;
fig. 5 is a schematic structural diagram of the processing unit 14 in fig. 2.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides an online detection method of one-dimensional codes, as shown in fig. 2, the method comprises the following steps:
s11, when the box with the one-dimensional code label passes through the strip light source area of the camera, photographing the box with the one-dimensional code label;
s12, judging whether the photo obtained after the box with the one-dimensional code label is photographed is available;
optionally, the box with the one-dimensional code label flows in a fixed direction on the production line, in general, the flow rate of the production line is 0.4m/s, the time taken for the camera to photograph and locate the one-dimensional code region is about 250ms, the side length of the box along the direction of the production line is about 1m, and 10 photos can be taken during the time when the box enters and exits the bar light source region, that is, when the photo is not available, the next photo can be taken.
S13, when the photo is available, cutting the one-dimensional code area in the photo to obtain a one-dimensional code image;
s14, performing image processing and decoding on the one-dimensional code image to obtain a one-dimensional code character string;
s15, comparing the one-dimensional code character string with a manually input one-dimensional code character string;
s16, when the one-dimensional code character string is completely matched with the manually input one-dimensional code character string, the one-dimensional code online detection is successful, otherwise, the one-dimensional code online detection fails.
According to the one-dimensional code online detection method provided by the embodiment of the invention, whether the one-dimensional code photo is available after being photographed is detected, whether the photo is selected in a reselection mode is determined according to the detection result, and meanwhile, the one-dimensional code area is intercepted from the available one-dimensional code photo, so that the image processing data of a system is greatly reduced, and the operation efficiency and the decoding success rate are improved.
Optionally, the determining whether a photo obtained after the box with the one-dimensional code label is photographed may include:
positioning a one-dimensional code region in the photo by using a one-dimensional code search operator;
and when the central point of the one-dimensional code region is in a region of +/-10% of the central point of the photo, the photo is considered to be available, otherwise, the box with the one-dimensional code label is photographed again.
Optionally, when the photo is available, clipping the one-dimensional code region in the photo to obtain a one-dimensional code image includes:
and clipping the one-dimensional code region according to the positioning result of the one-dimensional code region.
Optionally, the image processing and decoding the one-dimensional code image to obtain a one-dimensional code character string includes:
filtering the one-dimensional code image through a local enhancement operator;
correcting the situation that the one-dimensional code image has deformation by using a projective transformation operator;
correcting the condition that the one-dimensional code image is not parallel to the detection plane by using an image rotation operator;
and the decoder is used for decoding the corrected one-dimensional code image into a one-dimensional code character string. .
An embodiment of the present invention further provides an on-line detection apparatus for a one-dimensional code, as shown in fig. 3, the apparatus includes:
the photographing unit 11 is used for photographing the box with the one-dimensional code label when the box with the one-dimensional code label passes through a bar-shaped light source area of the camera;
the judging unit 12 is used for judging whether a photo obtained after the box provided with the one-dimensional code label is photographed is available;
a cropping unit 13, configured to crop a one-dimensional code region in the photo to obtain a one-dimensional code image when the photo is available;
the processing unit 14 is configured to perform image processing and decoding on the one-dimensional code image to obtain a one-dimensional code character string;
a comparison unit 15, configured to compare the one-dimensional code character string with a manually input one-dimensional code character string;
a confirming unit 16, configured to, when the one-dimensional code character string is completely identical to the manually input one-dimensional code character string, succeed in online detection of the one-dimensional code, and otherwise, fail in online detection of the one-dimensional code.
The one-dimensional code online detection device provided by the embodiment of the invention can be used for selecting the photo by detecting whether the photographed one-dimensional code photo is available or not and determining whether the photo is reselected or not according to the detection result, and meanwhile, the one-dimensional code area is intercepted from the available one-dimensional code photo, thereby greatly reducing the image processing data of the system and improving the operation efficiency and the decoding success rate.
Alternatively, as shown in fig. 4, the judging unit 12 includes:
a positioning module 121, configured to position a one-dimensional code region in the photo by using a one-dimensional code search operator;
and the judging module 122 is configured to consider that the photo is available when the center point of the one-dimensional code region is within ± 10% of the center point of the photo, and otherwise, take a picture again of the box with the one-dimensional code tag.
Optionally, the cropping unit is configured to:
and clipping the one-dimensional code region according to the positioning result of the one-dimensional code region.
Optionally, as shown in fig. 5, the processing unit 14 includes:
the filtering module 141 is configured to filter the one-dimensional code image through a local enhancement operator;
a first correction module 142, configured to correct, by using a projective transformation operator, a case that the one-dimensional code image has a distortion;
a second correction module 143, configured to correct a situation that the one-dimensional code image is not parallel to the detection plane by using an image rotation operator;
and a decoding module 144, configured to decode the corrected one-dimensional code image into a one-dimensional code character string.
Optionally, the decoding module 144 is further configured to: and decoding the bar code bar in the one-dimensional code image into a one-dimensional code character string by using a setting operator and a decoding operator.
The embodiment of the invention also provides an on-line detection system for the one-dimensional code, which comprises the on-line detection device for the one-dimensional code.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (7)

1. An online detection method for one-dimensional codes is characterized by comprising the following steps:
when the box provided with the one-dimensional code label passes through a bar-shaped light source area of the camera, photographing the box provided with the one-dimensional code label; the boxes provided with the one-dimensional code labels flow on a production line according to a fixed direction, the flow rate of the production line is 0.4m/s, and the side length of the boxes along the direction of the production line is 1 m;
judging whether a photo obtained after the box provided with the one-dimensional code label is photographed is available; it includes: positioning a one-dimensional code region in the photo by using a one-dimensional code search operator; when the central point of the one-dimensional code area is in an area with the central point +/-10% of the picture, the picture is considered to be available, otherwise, the box with the one-dimensional code label is photographed again; the time for photographing and positioning the one-dimensional code region by the camera is 250 ms;
when the photo is available, cutting a one-dimensional code area in the photo to obtain a one-dimensional code image;
performing image processing and decoding on the one-dimensional code image to obtain a one-dimensional code character string;
comparing the one-dimensional code character string with a manually input one-dimensional code character string;
and when the one-dimensional code character string is completely matched with the manually input one-dimensional code character string, the one-dimensional code online detection is successful, otherwise, the one-dimensional code online detection fails.
2. The method of claim 1, wherein the image processing and decoding the one-dimensional code image to obtain a one-dimensional code character string comprises:
filtering the one-dimensional code image through a local enhancement operator;
correcting the situation that the one-dimensional code image has deformation by using a projective transformation operator;
correcting the condition that the one-dimensional code image is not parallel to the detection plane by using an image rotation operator;
and decoding the corrected one-dimensional code image into a one-dimensional code character string.
3. The method of claim 2, wherein decoding the corrected one-dimensional code image into a one-dimensional code string comprises:
and decoding the bar code bar in the one-dimensional code image into a one-dimensional code character string by using a setting operator and a decoding operator.
4. An online detection device for one-dimensional codes is characterized by comprising:
the photographing unit is used for photographing the box provided with the one-dimensional code label when the box provided with the one-dimensional code label passes through the strip-shaped light source area of the camera; the boxes provided with the one-dimensional code labels flow on a production line according to a fixed direction, the flow rate of the production line is 0.4m/s, and the side length of the boxes along the direction of the production line is 1 m;
the judging unit is used for judging whether a photo obtained after the box provided with the one-dimensional code label is photographed is available;
the cropping unit is used for cropping a one-dimensional code area in the photo to obtain a one-dimensional code image when the photo is available; the time for photographing and positioning the one-dimensional code region by the camera is 250 ms;
the processing unit is used for carrying out image processing and decoding on the one-dimensional code image to obtain a one-dimensional code character string;
the comparison unit is used for comparing the one-dimensional code character string with a manually input one-dimensional code character string;
a confirming unit, configured to, when the one-dimensional code character string is completely matched with the manually input one-dimensional code character string, succeed in online detection of the one-dimensional code, and otherwise, fail in online detection of the one-dimensional code;
wherein the judging unit includes:
the positioning module is used for positioning the one-dimensional code region in the photo by utilizing a one-dimensional code search operator;
and the judging module is used for considering that the photo is available when the central point of the one-dimensional code region is in a region with the central point +/-10% of the photo, and otherwise, re-photographing the box with the one-dimensional code label.
5. The apparatus of claim 4, wherein the processing unit comprises:
the filtering module is used for filtering the one-dimensional code image through a local enhancement operator;
the first correction module is used for correcting the situation that the one-dimensional code image has deformation by using a projective transformation operator;
the second correction module is used for correcting the condition that the one-dimensional code image is not parallel to the detection plane by using an image rotation operator;
and the decoding module is used for decoding the corrected one-dimensional code image into a one-dimensional code character string.
6. The apparatus of claim 5, wherein the decoding module is further configured to:
and decoding the bar code bar in the one-dimensional code image into a one-dimensional code character string by using a setting operator and a decoding operator.
7. An on-line detection system for one-dimensional codes, which comprises the on-line detection device for one-dimensional codes according to any one of claims 4 to 6.
CN201611244968.4A 2016-12-29 2016-12-29 One-dimensional code online detection method, device and system Active CN108254386B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611244968.4A CN108254386B (en) 2016-12-29 2016-12-29 One-dimensional code online detection method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611244968.4A CN108254386B (en) 2016-12-29 2016-12-29 One-dimensional code online detection method, device and system

Publications (2)

Publication Number Publication Date
CN108254386A CN108254386A (en) 2018-07-06
CN108254386B true CN108254386B (en) 2021-09-10

Family

ID=62720719

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611244968.4A Active CN108254386B (en) 2016-12-29 2016-12-29 One-dimensional code online detection method, device and system

Country Status (1)

Country Link
CN (1) CN108254386B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109724990B (en) * 2019-01-08 2021-08-06 上海大学 Method for quickly positioning and detecting code spraying area in label of packaging box

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102799848B (en) * 2012-06-21 2016-09-21 深圳市江波龙电子有限公司 Commodity information identification method and merchandise news identification device
CN103577421A (en) * 2012-07-23 2014-02-12 中国移动通信集团公司 Method, device and system applying two-dimension code
CN103049828A (en) * 2013-01-11 2013-04-17 广州宽度信息技术有限公司 Two-dimensional code management system for online products on production line
CN103318299B (en) * 2013-06-29 2016-05-04 胡涛 A kind of electric vehicle control system and method for operating thereof
CN103413158A (en) * 2013-08-02 2013-11-27 北京科技大学 Label identification method and terminal device
CN103870790A (en) * 2014-04-02 2014-06-18 胡建国 Recognition method and device of two-dimensional bar code
CN104298953A (en) * 2014-10-27 2015-01-21 苏州睿新捷信息科技有限公司 Method and system for recognizing barcodes in batches
CN104933387B (en) * 2015-06-24 2017-05-17 上海快仓智能科技有限公司 Rapid positioning and identifying method based on two-dimensional code decoding
CN105095937B (en) * 2015-08-05 2018-01-30 哈尔滨工业大学 A kind of visual identity method of the circular array graphic code based on straight line cluster
CN106250797A (en) * 2016-08-09 2016-12-21 成都联众智科技有限公司 A kind of bar code image identification system using common camera

Also Published As

Publication number Publication date
CN108254386A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
US7334729B2 (en) Apparatus, system, and method for optical verification of product information
US10325129B2 (en) Method and apparatus for ordering code candidates in image for decoding attempts
US10410030B2 (en) System and method for recognizing deformed linear barcodes from a stream of varied focus video frames
JP4460611B2 (en) Product registration system and method
JPS6341839A (en) Photograph order matching method and apparatus
CN112019834B (en) Video stream processing method, device, equipment and medium
US20170140234A1 (en) Image processing apparatus, image processing method and computer-readable storage medium
US9947105B2 (en) Information processing apparatus, recording medium, and information processing method
KR101656941B1 (en) Method, server and computer program for improving 2d code recognition ratio
US11188727B1 (en) Efficient parallel barcode subpixel alignment
CN108254386B (en) One-dimensional code online detection method, device and system
US20210158000A1 (en) Method for optimizing improper product barcode detection
JP5412465B2 (en) Image processing device
KR20210140914A (en) Method and apparatus for recognizing the delivery address printed on mailings
CN112001200A (en) Identification code identification method, device, equipment, storage medium and system
US20200065537A1 (en) Automatic form data reading
CN111932282B (en) Anti-counterfeiting detection method and device
JP2019220116A (en) Information processing device, determination method, and object determination program
JP7201991B2 (en) RFID label writing verification system and program
JP2009181219A (en) Bar code reader and its method
CN112417914B (en) Data scanning method and device and electronic equipment
JP2005018579A (en) Method for reading out optical information and optical information reader
CN115375572A (en) Face completion method, device and system of video face label and storage medium
CN111046690A (en) Code information reading apparatus, method and computer-readable storage medium
JP6802107B2 (en) Information processing equipment, methods and programs

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