CN105956510B - Bar code processing method and bar code scanner - Google Patents

Bar code processing method and bar code scanner Download PDF

Info

Publication number
CN105956510B
CN105956510B CN201610278226.7A CN201610278226A CN105956510B CN 105956510 B CN105956510 B CN 105956510B CN 201610278226 A CN201610278226 A CN 201610278226A CN 105956510 B CN105956510 B CN 105956510B
Authority
CN
China
Prior art keywords
bar code
image
area
barcode
light source
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.)
Expired - Fee Related
Application number
CN201610278226.7A
Other languages
Chinese (zh)
Other versions
CN105956510A (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.)
Qisda Optronics Suzhou Co Ltd
Qisda Corp
Original Assignee
Qisda Optronics Suzhou Co Ltd
Qisda Corp
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 Qisda Optronics Suzhou Co Ltd, Qisda Corp filed Critical Qisda Optronics Suzhou Co Ltd
Priority to CN201610278226.7A priority Critical patent/CN105956510B/en
Publication of CN105956510A publication Critical patent/CN105956510A/en
Application granted granted Critical
Publication of CN105956510B publication Critical patent/CN105956510B/en
Expired - Fee Related 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/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
    • G06K7/14131D bar codes

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Cash Registers Or Receiving Machines (AREA)

Abstract

The present invention provides bar code processing method and bar code scanner, this method include:Obtain the first bar code image;Judge whether the retroreflective regions in the first bar code region are more than predetermined size range;If the retroreflective regions in the first bar code region are more than predetermined size range, N the second bar code images are obtained, the retroreflective regions in the first bar code image and N the second bar code images judge retroreflective regions variation tendency;If retroreflective regions gradually increase, current bar code image is obtained;According to retroreflective regions in current bar code image and the relativeness in third bar code region, adjustment aims at light source module group, until judging that aiming at the retroreflective regions in the third bar code region of current bar code image reacquired after light source module group in adjustment is located in predetermined size range, current bar code image retroreflective regions being located in predetermined size range handles to obtain data as decoding image.

Description

Bar code processing method and bar code scanning device
Technical Field
The invention relates to the field of barcode scanning, in particular to a barcode processing method and a barcode scanning device.
Background
The bar code or bar code (barcode) is a graphic identification unit that arranges a plurality of black bars (bar) and white bars (space) with different widths according to a certain coding rule to express a set of information. A common bar code is a pattern of parallel lines of black and white bars of widely differing reflectivity. The bar code can mark information such as the producing country, the manufacturer, the commodity name, the production date, the book classification number, the letter starting and ending place, the classification, the date and the like of the article, so the bar code is widely applied to the fields of commodity circulation, book management, post management, bank systems and the like. The encoding format of the barcode has various specifications according to different application fields, for example, the one-dimensional barcode includes Code39, Code11, Code128, EAN (European Article Number), UPC (Universal Product Code), and the like.
To assist the user in scanning the barcode, the aiming assembly projects an aiming light pattern (aiming pattern) while the barcode scanner scans the barcode. The user aligns the target barcode with the struck aiming light pattern so that the target barcode is positioned in the imaging center of the aiming light pattern projected on the scanned object, and an image which is more beneficial to decoding is generated. Especially when more than one bar code is included in an image, the bar code targeted for decoding in the scanned image can be selected by the bar code located at the imaging center of the aiming light source pattern. Usually, a light supplement light source is further arranged in the bar code scanner and used for lighting the bar code, so that short bar code information or excessive noise which is not beneficial to decoding caused by insufficient light source is avoided.
As described above, the aiming light source pattern functions to select the bar code to be decoded. However, the light source for light supplement of the barcode may reflect light on some materials, and in practice, the method may cause that the user cannot decode the barcode successfully according to the scanned image because of the light reflection when aiming at the barcode.
Disclosure of Invention
The present invention provides a barcode processing method and a barcode scanning device to solve the above problems.
In order to achieve the above object, in a first aspect, the present invention provides a barcode processing method for a barcode scanning device, where the barcode scanning device includes an aiming light source module, and the method includes:
acquiring a first bar code image, wherein the first bar code image is provided with a first bar code area;
judging whether the light reflecting area in the first bar code area exceeds a preset size range or not;
if the light reflecting area in the first bar code area exceeds the preset size range, acquiring N second bar code images, and judging the change trend of a light reflecting area according to the first bar code image and the light reflecting area in the N second bar code images, wherein N is a positive integer greater than or equal to 1;
if the change trend of the light reflecting area is that the light reflecting area is gradually increased, acquiring a current bar code image, wherein the current bar code image is provided with a third bar code area which is provided with a light reflecting area;
and adjusting the aiming light source module according to the relative relation between the light reflecting area in the current bar code image and the third bar code area until the light reflecting area in the third bar code area of the current bar code image acquired again after the aiming light source module is adjusted is judged to be positioned in the preset size range, and processing the current bar code image with the light reflecting area positioned in the preset size range as a decoding image to obtain bar code data.
Preferably, the method further comprises: and if the light reflecting area in the first bar code area does not exceed the preset size range, processing the first bar code image as the decoding image to obtain the bar code data.
Preferably, the method further comprises: and if the change trend of the light reflecting area is that the light reflecting area is gradually reduced, determining one second barcode image in the N second barcode images as the decoded image according to the change trend of the light reflecting area, and processing the decoded image to obtain the barcode data.
Preferably, the barcode scanning device further comprises: an image capturing module; according to the relative relation between the light reflecting area and the third bar code area in the current bar code image, the step of adjusting the aiming light source module comprises the following steps:
and according to the relative position relationship between the light reflecting area and the third bar code area in the current bar code image, determining the moving direction of an imaging position, projected on the scanned object, of the aiming light source pattern emitted by the aiming light source module, finely adjusting the aiming light source module according to the moving direction so as to move the imaging position, and further instructing a user to move the bar code scanning device according to the moving direction of the imaging position so as to adjust the shooting distance and the shooting angle between the image acquisition module and the scanned object.
Preferably, the barcode scanning device further comprises: an image capturing module; according to the relative relation between the light reflecting area and the third bar code area in the current bar code image, the step of adjusting the aiming light source module comprises the following steps:
and according to the relative position relationship between the light reflection area of the current bar code image and the third bar code area, determining the change mode of the imaging shape of the aiming light source pattern projected by the aiming light source module on the scanned object, and finely adjusting the aiming light source module according to the change mode to change the imaging shape into another imaging shape so as to instruct a user to adjust the moving direction and the moving angle of the bar code scanning device according to the another imaging shape to adjust the shooting distance and the shooting angle between the image acquisition module and the scanned object.
Preferably, the step of adjusting the aiming light source module according to the relative relationship between the light reflection area and the third barcode area in the current barcode image comprises:
evaluating the relative size relation of a light reflecting area of a third bar code area in the current bar code image, and determining and adjusting the moving intensity of the aiming light source module;
calculating the relative position relationship between the light reflecting area of the current bar code image and the third bar code area so as to determine the moving direction of the aiming light source module;
adjusting the aiming light source module according to the moving intensity and the moving direction.
Preferably, the aiming light source pattern projected by the aiming light source module is cross-shaped, rectangular or circular.
Preferably, the step of obtaining the first barcode image comprises:
capturing an image;
positioning whether the image contains a bar code area or not;
if the image contains a bar code area, taking the image as the first bar code image;
and if the image does not contain the bar code area, returning to the step of capturing the image.
In a second aspect, the present invention provides a barcode scanning apparatus, comprising:
the aiming light source module is movably arranged on the shell and is used for shooting aiming light source patterns;
the image acquisition module is used for acquiring a first bar code image, wherein the first bar code image is provided with a first bar code area, acquiring N second bar code images if the light reflecting area in the first bar code area exceeds a preset size range, and acquiring a current bar code image if the light reflecting area changes in a gradually increasing trend that the light reflecting area is increased, wherein the current bar code image is provided with a third bar code area, and the third bar code area is provided with a light reflecting area;
the judging unit is used for judging whether the light reflecting area in the first bar code area exceeds the preset size range or not;
the light reflection region change trend determining unit is used for judging the change trend of the light reflection region according to the light reflection region in the first barcode image and the N second barcode images, wherein N is a positive integer greater than or equal to 1;
the adjusting unit is used for adjusting the aiming light source module according to the relative relation between the light reflecting area and the third bar code area in the current bar code image until the light reflecting area in the third bar code area of the current bar code image obtained again after the aiming light source module is adjusted is judged to be positioned in the preset size range;
and the bar code analysis unit is used for processing the current bar code image of which the light reflecting area is positioned in the preset size range as a decoding image to obtain bar code data.
Preferably, the adjusting unit determines a moving direction of an imaging position where the aiming light source pattern projected by the aiming light source module is projected on the scanned object according to a relative position relationship between the light reflecting area and the third barcode area in the current barcode image, and finely adjusts the aiming light source module according to the moving direction to move the imaging position so as to instruct a user to move the barcode scanning device according to the moving direction of the imaging position to adjust a shooting distance and a shooting angle between the image capturing module and the scanned object; or,
the adjusting unit determines a change mode of an imaging shape of an aiming light source pattern projected by the aiming light source module on the scanned object according to the relative position relation between a light reflecting area and a third bar code area of the current bar code image, and finely adjusts the aiming light source module according to the change mode to change the imaging shape into another imaging shape so as to instruct a user to adjust the moving direction and the moving angle of the bar code scanning device according to the another imaging shape to adjust the shooting distance and the shooting angle between the image capturing module and the scanned object; or,
the adjusting unit evaluates the relative size relation of a light reflecting area of a third bar code area in the current bar code image and determines and adjusts the moving intensity of the aiming light source module; the adjusting unit calculates the relative position relation between the light reflecting area of the current bar code image and the third bar code area so as to determine the moving direction of the aiming light source module; the adjusting unit adjusts the aiming light source module according to the moving intensity and the moving direction.
Compared with the prior art, the barcode processing method and the barcode scanning device provided by the invention have the advantages that when the barcode area comprises the reflection area, the position of the aiming light source module can be adjusted to enable the reflection area in the obtained barcode image to be located in the preset size range, the reflection area is further staggered with the barcode area, and the barcode scanning device can obtain barcode data according to the barcode image.
Drawings
Fig. 1 is a schematic flow chart of a barcode processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a first barcode image according to an embodiment of the present invention;
fig. 3A is a schematic diagram of a first barcode image and a plurality of second barcode images according to an embodiment of the present invention;
fig. 3B is a schematic diagram of another first barcode image and a plurality of second barcode images according to an embodiment of the present invention;
fig. 4A, 4B, and 4C are schematic diagrams of a current barcode image according to an embodiment of the present invention;
fig. 5A, fig. 5B, and fig. 5C are schematic diagrams of an adjusting process according to an embodiment of the present invention;
FIGS. 6A, 6B, and 6C are schematic diagrams of another adjustment process provided by an embodiment of the present invention;
fig. 7 is a block diagram of a barcode scanning apparatus according to an embodiment of the present invention.
Detailed Description
In order to further understand the objects, structures, features and functions of the present invention, the following embodiments are described in detail.
Fig. 1 is a schematic flow chart of a barcode processing method according to an embodiment of the present invention; FIG. 2 is a schematic diagram of a first barcode image according to an embodiment of the present invention; fig. 3A is a schematic diagram of a first barcode image and a plurality of second barcode images according to an embodiment of the present invention; fig. 3B is a schematic diagram of another first barcode image and a plurality of second barcode images according to an embodiment of the present invention; fig. 4A, 4B, and 4C are schematic diagrams of a current barcode image according to an embodiment of the present invention.
The barcode processing method shown in fig. 1 is applied to a barcode scanning device, which may be a barcode scanner, a mobile phone, a Tablet (Tablet), or the like. It should be understood that, in devices without aiming light source module, such as mobile phones, flat panels, etc., the aiming pattern is directly displayed and adjusted on the display by using a Graphical User Interface (GUI) mode, and for a general barcode scanning device, the aiming light source module comprises a shell, an aiming light source module and an image capturing module, the aiming light source module is movably arranged on the shell, and the barcode processing method comprises the following steps:
s101, a first barcode image is obtained, and the first barcode image is provided with a first barcode area. Specifically, the step of acquiring the first barcode image includes: capturing an image; positioning whether the image contains a bar code area or not; if the image contains a bar code area, taking the image as a first bar code image; and if the image does not contain the bar code area, returning to the step of capturing the image.
S102, judging whether the light reflecting area in the first bar code area exceeds a preset size range. If the reflective area in the first barcode area does not exceed the predetermined size range, executing step S103; if the reflective area in the first barcode area exceeds the predetermined size range, step S104 is performed. Specifically, whether the light reflecting area in the first bar code area exceeds the predetermined size range can be determined by determining whether the ratio of the area of the light reflecting area in the first bar code area to the area of the entire first bar code area exceeds a predetermined ratio.
S103, processing the first barcode image as a decoding image to obtain barcode data.
S104, obtaining N second bar code images, and judging the change trend of the light reflecting area according to the first bar code image and the light reflecting areas in the N second bar code images. Wherein N is a positive integer greater than or equal to 1. If the variation trend of the light reflecting area is that the light reflecting area is gradually reduced, executing step S105; if the variation trend of the reflective area is that the reflective area is gradually increased, the steps S106-S108 are executed. Specifically, the step of obtaining each second barcode image comprises: capturing an image; positioning whether the image contains a bar code area or not; if the image contains the bar code area, taking the image as a second bar code image; and if the image does not contain the bar code area, returning to the step of capturing the image. It can be seen that the N second barcode images are captured after the first barcode image is captured.
And S105, determining one second barcode image in the N second barcode images as a decoded image according to the change trend of the light reflecting area, and processing the decoded image to obtain barcode data. Specifically, one second barcode image with a light reflection area not exceeding a predetermined size range among the N second barcode images is selected as the decoded image.
And S106, acquiring the current barcode image. The current barcode image is provided with a third barcode area, and the third barcode area is provided with a light reflecting area. Specifically, the step of obtaining the current barcode image comprises: capturing an image; positioning whether the image contains a bar code area or not; if the image contains a bar code area, taking the image as a current bar code image; and if the image does not contain the bar code area, returning to the step of capturing the image.
And S107, adjusting the aiming light source module according to the relative relation between the light reflecting area and the third bar code area in the current bar code image. Specifically, the relative relationship may be a relative positional relationship and/or a relative dimensional relationship.
And S108, judging whether the light reflecting area in the third code area of the current bar code image obtained again after the aiming light source module is adjusted is within the preset size range. And if the light reflecting area in the third code area of the current bar code image obtained again is not in the preset size range, returning to the step S107. If the reflective area in the third code area is within the predetermined size range, step S109 is performed.
And S109, processing the current bar code image with the light reflecting area within the preset size range as a decoding image to obtain bar code data.
The processing of the decoded image may be binarization, noise removal, decoding, or the like.
The barcode processing method will be described below with reference to the first barcode image P1 shown in fig. 2, fig. 3A, fig. 3B, and fig. 4A to fig. 4C. The barcode scanning device acquires a first barcode image P1, the first barcode image P1 includes a first barcode region M1, a light reflection region F1 is located in the first barcode region M1, and whether the ratio of the area of the light reflection region F1 to the area of the first barcode region M1 exceeds a predetermined ratio is determined to determine whether the light reflection region F1 in the first barcode region M1 exceeds a predetermined size range; if the light reflection area F1 does not exceed the predetermined size range, the first barcode image P1 is used as a decoding image to be processed to obtain barcode data in the first barcode area M1; if the light reflection area F1 exceeds the preset size range, acquiring N second barcode images, and judging the change trend of the light reflection area according to the first barcode image P1 and the light reflection areas in the N second barcode images; in fig. 3A, two second barcode images P20, P21 in the N second barcode images are combined with the first barcode image P1 to determine a change trend of the light reflection region, as can be seen from light reflection regions F1, F20 to F21 in fig. 3A, the change trend of the light reflection region is that the light reflection region is gradually reduced, and the barcode scanning device can determine one of the N second barcode images as a decoded image according to the change trend of the light reflection region, and process the decoded image to obtain barcode data; in fig. 3B, the change trend of the light reflection region is determined by combining two second barcode images P22 and P23 in the N second barcode images with the first barcode image P1, as can be seen from the light reflection regions F1, F22 to F23 in fig. 3B, the change trend of the light reflection region is that the light reflection region gradually increases, the barcode scanning device further captures an image to obtain a current barcode image P30 (as shown in fig. 4A), and the aiming light source module is adjusted according to the relative relationship between the light reflection region F30 and the third barcode region M30 in the current barcode image P30; determining whether the light reflecting region F31 in the third bar code region M31 of the current bar code image P31 (as shown in the schematic diagram of fig. 4B) retrieved after the aiming light source module is adjusted is within the predetermined size range; if the light reflecting area F31 in the third code area M31 is located in the preset size range, processing the current barcode image P31 as a decoding image to obtain barcode data; if the light reflection region F31 in the third code region M31 is not located in the predetermined size range, adjusting the aiming light source module according to the relative relationship between the light reflection region F31 and the third code region M31 in the current barcode image P31, and determining whether the light reflection region F32 in the third code region M32 of the current barcode image P32 (shown in the schematic diagram of fig. 4C) obtained again after the aiming light source module is adjusted is located in the predetermined size range; if the light reflecting area F32 in the third code area M32 is located in the preset size range, processing the current barcode image P32 as a decoding image to obtain barcode data; if the light reflection area F32 in the third code area M32 is not within the predetermined size range, the step of "adjusting the aiming light source module according to the relative relationship between the light reflection area and the third code area in the current barcode image, and determining whether the light reflection area in the third code area of the current barcode image obtained again after the aiming light source module is adjusted is within the predetermined size range" is repeatedly performed until the light reflection area in the third code area of the current barcode image obtained again after the aiming light source module is adjusted is within the predetermined size range.
Fig. 5A, 5B, and 5C are schematic diagrams of an adjustment process according to an embodiment of the present invention, and fig. 5A to 5C illustrate an aiming light source with a cross-shaped aiming light source pattern, but the aiming light source pattern may also be rectangular, circular, or the like. Preferably, the step S107 may include: according to the relative position relation of the light reflecting area and the third bar code area in the current bar code image, the moving direction of the imaging position of the aiming light source pattern projected by the aiming light source module on the scanned object is determined, the aiming light source module is finely adjusted according to the moving direction so as to move the imaging position, and then a user is instructed to move the bar code scanning device according to the moving direction of the imaging position so as to adjust the shooting distance and the shooting angle between the image acquisition module and the scanned object. Illustratively, before the aiming light source module is finely adjusted, the current barcode image is shown as P01 in fig. 5A, M01 in fig. 5A represents a barcode region, the imaging position of the aiming light source pattern projected on the scanned object is shown as a position D01 of a cross shape in fig. 5A, after the aiming light source module is finely adjusted according to the moving direction after the moving direction is determined, the current barcode image is shown as P02 in fig. 5B, M02 in fig. 5B represents a barcode region, and the imaging position of the aiming light source pattern projected on the scanned object is shown as a position D02 of a cross shape in fig. 5B, at this time, after the user observes the moving direction of the imaging position D02 relative to the imaging position D01, the user moves the scanning device to the lower left according to the moving direction of the imaging position D2 relative to the imaging position D1 to move the aiming light source module, after the user moves the barcode scanning device, the current barcode image obtained may be as shown in fig. 5C, where M03 represents the barcode region in fig. 5C. In this embodiment, the imaging position of the aiming light pattern projected on the scanned object is adjusted by the fine-tuning aiming light source module, and the user is instructed to adjust the barcode scanning device according to the changing direction of the imaging position to adjust the image capturing module, so that the light reflecting region and the barcode region are staggered, and the barcode scanning device can obtain barcode data according to the barcode image.
Fig. 6A, 6B, and 6C are schematic diagrams of another adjustment process according to an embodiment of the present invention, and fig. 6A to 6C illustrate an aiming light source emitting a rectangular aiming light source pattern. Preferably, the step S107 may include: and according to the relative position relationship between the light reflecting area of the current bar code image and the third bar code area, determining the change mode of the imaging shape of the aiming light source pattern projected by the aiming light source module on the scanned object, finely adjusting the aiming light source module according to the change mode to change the imaging shape into another imaging shape, and further instructing a user to adjust the moving direction and the moving angle of the bar code scanning device according to the another imaging shape so as to adjust the shooting distance and the shooting angle between the image acquisition device and the scanned object. For example, after determining the change mode, and fine-tuning the aiming light source module according to the change mode, the current barcode image is P11 shown in fig. 6A, M11 shown in fig. 6A represents the barcode region, M12 shown in fig. 6B represents the barcode region, and the aiming light source pattern is projected onto the scanned object, and the image shape is trapezoidal D12 shown in fig. 6B, at this time, the user moves the barcode scanning apparatus according to the image shape D12 to adjust the moving direction and the moving angle of the aiming light source module, and after the user moves the barcode scanning apparatus, the obtained current barcode image may be as shown in fig. 6C, and M13 shown in fig. 6C represents the barcode region. In another embodiment of the present invention, the aiming light source pattern may be a circle, and after the aiming light source module is finely adjusted according to the changing manner, the imaging shape may be an ellipse. In this embodiment, the imaging shape of the aiming light pattern projected on the scanned object is adjusted by the fine-tuning aiming light source module, and the user is instructed to adjust the barcode scanning device according to the change of the imaging shape to adjust the image capturing module, so that the light reflection region and the barcode region are staggered, and the barcode scanning device can obtain barcode data according to the barcode image.
Preferably, the step S107 may include: evaluating the relative size relation of a light reflecting area of a third bar code area in the current bar code image, and determining the moving intensity of the aiming light source module; calculating the relative position relation between the light reflecting area of the current bar code image and the third bar code area so as to determine the moving direction of the aiming light source module; and adjusting the aiming light source module according to the moving intensity and the moving direction. In this embodiment, the light reflection region in the obtained barcode image is located within the predetermined size range by automatically finely adjusting the aiming light source module, so that the light reflection region and the barcode region are staggered, and the barcode scanning device can obtain barcode data according to the barcode image.
Preferably, after the step S109 of determining the decoded image, the method further includes the steps of: the light source module is aimed in the resetting, is about to aim at the light source module and resumes to initial position, and is further, can aim at the light source module when aiming at the light source module and closing, like this, after the light source module is aimed in the adjustment, can the person of facilitating the use scan next time.
It should be noted that the aiming light source module can be movably disposed on the housing, and a moving structure is required to be configured to be able to finely adjust the aiming light source module or automatically adjust the aiming light source module, and the moving structure can be a moving structure commonly found by those skilled in the art, which is not described in detail in the embodiment of the present invention.
According to the barcode processing method provided by the invention, the aiming light source module is movably arranged on the shell of the barcode scanning device, when the barcode region comprises the reflection region, the position of the aiming light source module can be adjusted to enable the reflection region in the obtained barcode image to be positioned in the preset size range, so that the reflection region and the barcode region are staggered, and the barcode scanning device can obtain barcode data according to the barcode image.
Fig. 7 is a block diagram of a barcode scanning apparatus according to an embodiment of the present invention. As shown in fig. 7, the barcode scanning device 6 includes: a housing (not shown), an image capturing module 60, an aiming light source module 61, a determining unit 62, a reflective area variation trend determining unit 63, an adjusting unit 64, and a barcode analyzing unit 65, and specifically, the barcode scanning device 6 may be a barcode scanner, a mobile phone, etc. Aiming light source module 61 is movably arranged on the housing, aiming light source module 61 is used for shooting aiming light source patterns. The image acquisition module 60 acquires a first barcode image, the first barcode image having a first barcode region, acquires N second barcode images if a light reflection region in the first barcode region exceeds a predetermined size range, and acquires a current barcode image if a change trend of the light reflection region is that the light reflection region is gradually increased, the current barcode image having a third barcode region, the third barcode region having a light reflection region; the aiming light pattern emitted by the aiming light source module 61 may be cross-shaped, rectangular or circular. The judging unit 62 is configured to judge whether the light reflecting area in the first barcode area exceeds a predetermined size range; specifically, the judging unit 62 judges whether the ratio of the area of the light reflecting area in the first bar code area to the area of the entire first bar code area exceeds a predetermined ratio to judge whether the light reflecting area in the first bar code area exceeds a predetermined size range. The light reflection region variation tendency determination unit 63 is configured to determine a variation tendency of the light reflection region according to the light reflection regions in the first barcode image and N second barcode images, where N is a positive integer greater than or equal to 1. The adjusting unit 64 is configured to adjust the aiming light source module 61 according to a relative relationship between the light reflection region and the third barcode region in the current barcode image until it is determined that the light reflection region in the third barcode region of the current barcode image obtained again after the aiming light source module 61 is adjusted is within a predetermined size range. The barcode analyzing unit 65 is configured to process a current barcode image with a light reflection area within a predetermined size range as a decoded image to obtain barcode data. The barcode analyzing unit 65 is further configured to process the first barcode image as a decoded image to obtain barcode data if the reflective area in the first barcode area does not exceed the predetermined size range. The barcode analyzing unit 65 is further configured to determine one of the N second barcode images as a decoded image according to the change trend of the reflective area if the change trend of the reflective area is that the reflective area is gradually decreased, and process the decoded image to obtain barcode data. The processing of the decoded image may be binarization, noise removal, decoding, or the like.
Preferably, the adjusting unit 64 determines a moving direction of an imaging position where the aiming light source pattern projected by the aiming light source module 61 is projected onto the scanned object according to a relative position relationship between the light reflection region and the third barcode region in the current barcode image, and finely adjusts the aiming light source module 61 according to the moving direction to move the imaging position, so as to instruct the user to move the barcode scanning device 6 according to the moving direction of the imaging position to adjust the shooting distance and the shooting angle between the image capturing module 60 and the scanned object.
Preferably, the adjusting unit 64 determines a change manner of an imaging shape of the aiming light source pattern projected by the aiming light source module 61 and projected on the scanned object according to a relative position relationship between the light reflection region of the current barcode image and the third barcode region, and finely adjusts the aiming light source module 61 according to the change manner to change the imaging shape into another imaging shape, so as to instruct the user to adjust the moving direction and the moving angle of the barcode scanning device 6 according to the another imaging shape to adjust the shooting distance and the shooting angle between the image capturing module 60 and the scanned object.
Preferably, the adjusting unit 64 evaluates the relative size relationship of the light reflecting area of the third barcode area in the current barcode image, and determines to adjust the moving intensity of the aiming light source module 61; the adjusting unit 64 calculates the relative position relationship between the light reflecting area of the current barcode image and the third barcode area to determine the moving direction of the aiming light source module 61; the adjusting unit 64 adjusts the aiming light source module 61 according to the moving intensity and the moving direction.
The method for positioning and acquiring the barcode image (including the first barcode image, the second barcode image and the third barcode image) by the image capturing module 60 through the aiming light source module 61 may be as follows: capturing an image; positioning whether the image contains a bar code area or not; if the image contains a bar code area, taking the image as a bar code image; if the image does not contain the barcode area, the image is continuously captured until the captured image can be used as a barcode image.
According to the barcode scanning device provided by the invention, the aiming light source module is movably arranged on the shell of the barcode scanning device, when the barcode region comprises the reflection region, the position of the aiming light source module can be adjusted to enable the reflection region in the obtained barcode image to be positioned in the preset size range, so that the reflection region and the barcode region are staggered, and the barcode scanning device can obtain barcode data according to the barcode image.
The present invention has been described in relation to the above embodiments, which are only exemplary of the implementation of the present invention. It should be noted that the disclosed embodiments do not limit the scope of the invention. Rather, it is intended that all such modifications and variations be included within the spirit and scope of this invention.

Claims (10)

1. A bar code processing method is used for a bar code scanning device, the bar code scanning device comprises an aiming light source module, and the bar code processing method is characterized by comprising the following steps:
acquiring a first bar code image, wherein the first bar code image is provided with a first bar code area;
judging whether the light reflecting area in the first bar code area exceeds a preset size range or not;
if the light reflecting area in the first bar code area exceeds the preset size range, acquiring N second bar code images, and judging the change trend of a light reflecting area according to the first bar code image and the light reflecting area in the N second bar code images, wherein N is a positive integer greater than or equal to 1;
if the change trend of the light reflecting area is that the light reflecting area is gradually increased, acquiring a current bar code image, wherein the current bar code image is provided with a third bar code area which is provided with a light reflecting area;
and adjusting the aiming light source module according to the relative relation between the light reflecting area in the current bar code image and the third bar code area until the light reflecting area in the third bar code area of the current bar code image acquired again after the aiming light source module is adjusted is judged to be positioned in the preset size range, and processing the current bar code image with the light reflecting area positioned in the preset size range as a decoding image to obtain bar code data.
2. The barcode processing method of claim 1, further comprising: and if the light reflecting area in the first bar code area does not exceed the preset size range, processing the first bar code image as the decoding image to obtain the bar code data.
3. The barcode processing method of claim 1, further comprising: and if the change trend of the light reflecting area is that the light reflecting area is gradually reduced, determining one second barcode image in the N second barcode images as the decoded image according to the change trend of the light reflecting area, and processing the decoded image to obtain the barcode data.
4. The barcode processing method of claim 1, wherein the barcode scanning device further comprises: an image capturing module; according to the relative relation between the light reflecting area and the third bar code area in the current bar code image, the step of adjusting the aiming light source module comprises the following steps:
and determining the moving direction of an imaging position, projected on a scanned object, of the aiming light source pattern emitted by the aiming light source module according to the relative position relationship between the light reflecting area and the third bar code area in the current bar code image, finely adjusting the aiming light source module according to the moving direction to move the imaging position, and further instructing a user to move the bar code scanning device according to the moving direction of the imaging position to adjust the shooting distance and the shooting angle between the image acquisition module and the scanned object.
5. The barcode processing method of claim 1, wherein the barcode scanning device further comprises: an image capturing module; according to the relative relation between the light reflecting area and the third bar code area in the current bar code image, the step of adjusting the aiming light source module comprises the following steps:
and according to the relative position relationship between the light reflection area of the current bar code image and the third bar code area, determining the change mode of the imaging shape of the aiming light source pattern projected by the aiming light source module on the scanned object, and finely adjusting the aiming light source module according to the change mode to change the imaging shape into another imaging shape so as to instruct a user to adjust the moving direction and the moving angle of the bar code scanning device according to the another imaging shape to adjust the shooting distance and the shooting angle between the image acquisition module and the scanned object.
6. The barcode processing method of claim 1, wherein the step of adjusting the aiming light source module according to the relative relationship between the reflective area and the third barcode area in the current barcode image comprises:
evaluating the relative size relation of a light reflecting area of a third bar code area in the current bar code image, and determining and adjusting the moving intensity of the aiming light source module;
calculating the relative position relationship between the light reflecting area of the current bar code image and the third bar code area so as to determine the moving direction of the aiming light source module;
adjusting the aiming light source module according to the moving intensity and the moving direction.
7. The barcode processing method of claim 1, wherein the aiming light source pattern projected by the aiming light source module is one of a cross, a rectangle or a circle.
8. The barcode processing method of claim 1, wherein the step of acquiring the first barcode image comprises:
capturing an image;
positioning whether the image contains a bar code area or not;
if the image contains a bar code area, taking the image as the first bar code image;
and if the image does not contain the bar code area, returning to the step of capturing the image.
9. A barcode scanning device, comprising:
the aiming light source module is movably arranged on the shell and is used for shooting aiming light source patterns;
the image acquisition module is used for acquiring a first bar code image, wherein the first bar code image is provided with a first bar code area, acquiring N second bar code images if the light reflecting area in the first bar code area exceeds a preset size range, and acquiring a current bar code image if the light reflecting area changes in a gradually increasing trend that the light reflecting area is increased, wherein the current bar code image is provided with a third bar code area, and the third bar code area is provided with a light reflecting area;
the judging unit is used for judging whether the light reflecting area in the first bar code area exceeds the preset size range or not;
the light reflection region change trend determining unit is used for judging the change trend of the light reflection region according to the light reflection region in the first barcode image and the N second barcode images, wherein N is a positive integer greater than or equal to 1;
the adjusting unit is used for adjusting the aiming light source module according to the relative relation between the light reflecting area and the third bar code area in the current bar code image until the light reflecting area in the third bar code area of the current bar code image obtained again after the aiming light source module is adjusted is judged to be positioned in the preset size range;
and the bar code analysis unit is used for processing the current bar code image of which the light reflecting area is positioned in the preset size range as a decoding image to obtain bar code data.
10. The barcode scanning device of claim 9, wherein the adjusting unit determines a moving direction of an imaging position where the aiming light source pattern projected by the aiming light source module is projected on the scanned object according to a relative position relationship between the reflective area and a third barcode area in the current barcode image, and finely adjusts the aiming light source module according to the moving direction to move the imaging position so as to instruct a user to move the barcode scanning device according to the moving direction of the imaging position to adjust a shooting distance and a shooting angle between the image capturing module and the scanned object; or,
the adjusting unit determines a change mode of an imaging shape of an aiming light source pattern projected by the aiming light source module on the scanned object according to the relative position relation between a light reflecting area and a third bar code area of the current bar code image, and finely adjusts the aiming light source module according to the change mode to change the imaging shape into another imaging shape so as to instruct a user to adjust the moving direction and the moving angle of the bar code scanning device according to the another imaging shape to adjust the shooting distance and the shooting angle between the image capturing module and the scanned object; or,
the adjusting unit evaluates the relative size relation of a light reflecting area of a third bar code area in the current bar code image and determines and adjusts the moving intensity of the aiming light source module; the adjusting unit calculates the relative position relation between the light reflecting area of the current bar code image and the third bar code area so as to determine the moving direction of the aiming light source module; the adjusting unit adjusts the aiming light source module according to the moving intensity and the moving direction.
CN201610278226.7A 2016-04-29 2016-04-29 Bar code processing method and bar code scanner Expired - Fee Related CN105956510B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610278226.7A CN105956510B (en) 2016-04-29 2016-04-29 Bar code processing method and bar code scanner

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610278226.7A CN105956510B (en) 2016-04-29 2016-04-29 Bar code processing method and bar code scanner

Publications (2)

Publication Number Publication Date
CN105956510A CN105956510A (en) 2016-09-21
CN105956510B true CN105956510B (en) 2018-06-26

Family

ID=56916601

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610278226.7A Expired - Fee Related CN105956510B (en) 2016-04-29 2016-04-29 Bar code processing method and bar code scanner

Country Status (1)

Country Link
CN (1) CN105956510B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805129B (en) * 2017-08-24 2020-03-13 贵州省烟草公司贵阳市公司 Tobacco laser code auxiliary identification method and device and tobacco laser code identification equipment
CN107609448B (en) * 2017-08-28 2020-10-20 苏州佳世达电通有限公司 Bar code decoding method and bar code decoding device
CN107818283A (en) * 2017-11-02 2018-03-20 深圳天珑无线科技有限公司 Quick Response Code image pickup method, mobile terminal and computer-readable recording medium
CN111581997B (en) * 2020-04-03 2022-04-19 福建新大陆自动识别技术有限公司 Small-size bar code decoding device
CN112464681B (en) * 2020-11-26 2024-04-30 苏州摩比信通智能***有限公司 Graphic code scanning method, device, equipment and medium
CN112560533A (en) * 2020-12-26 2021-03-26 苏州斯普锐智能***股份有限公司 Real-time aiming designated decoding method
CN113607419A (en) * 2021-08-02 2021-11-05 广东工业大学 Engine cylinder block electronic tag detection device and method
CN113894061B (en) * 2021-10-23 2023-06-27 绍兴文理学院元培学院 Automatic cargo sorting method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101061487A (en) * 2004-08-31 2007-10-24 讯宝科技公司 System and method for aiming an optical code scanning device
CN102682264A (en) * 2011-01-31 2012-09-19 霍尼韦尔国际公司 Method and apparatus for reading optical indicia using a plurality of data sources
CN104401138A (en) * 2014-11-13 2015-03-11 苏州佳世达光电有限公司 Label printing calibration method and label printer
CN105469092A (en) * 2015-12-04 2016-04-06 苏州佳世达光电有限公司 Scanning assistance positioning system, bar code scanning device, and scanning assistance positioning method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101061487A (en) * 2004-08-31 2007-10-24 讯宝科技公司 System and method for aiming an optical code scanning device
CN102682264A (en) * 2011-01-31 2012-09-19 霍尼韦尔国际公司 Method and apparatus for reading optical indicia using a plurality of data sources
CN104401138A (en) * 2014-11-13 2015-03-11 苏州佳世达光电有限公司 Label printing calibration method and label printer
CN105469092A (en) * 2015-12-04 2016-04-06 苏州佳世达光电有限公司 Scanning assistance positioning system, bar code scanning device, and scanning assistance positioning method

Also Published As

Publication number Publication date
CN105956510A (en) 2016-09-21

Similar Documents

Publication Publication Date Title
CN105956510B (en) Bar code processing method and bar code scanner
US7946491B2 (en) Method, apparatus, and computer program product for providing a camera barcode reader
US9715647B2 (en) Two-dimensional barcode to avoid unintentional scanning
EP1619604B1 (en) Code type determining method and code boundary detecting method
US8254683B2 (en) Code image processing method
JP4558043B2 (en) System and method for aiming an optical code scanning device
US7648072B2 (en) Two-dimensional code detection system and two-dimensional code detection program
US7044378B2 (en) System and method for imaging and decoding optical codes using at least two different imaging settings
US20090220126A1 (en) Processing an image of an eye
JP4059173B2 (en) Optical information reading apparatus and optical information reading method
KR20070032919A (en) A storage medium storing a two-dimensional code detection method, a detection device, and a detection program
US20140119665A1 (en) System and method for finding saddle point-like structures in an image and determining information from the same
CN111476053A (en) Identification method and device
EP2633473B1 (en) Method and apparatus for capturing form document with imaging scanner
US20130094695A1 (en) Method and apparatus for auto-detecting orientation of free-form document using barcode
JP4398498B2 (en) Code boundary detection method
CN109448013B (en) QR code image binarization processing method with local uneven illumination
US20170046547A1 (en) Validating a decoded barcode as an expected barcode
JP2019046330A (en) Optical type information reading device
CN106909956B (en) A kind of the boundary independent positioning method and device of one-dimension code
EP2790125A1 (en) Method and apparatus for decoding a non-planar barcode
JP2023061880A (en) Collation device and program
CN117034981A (en) Bar code scanning method, device, equipment and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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

Granted publication date: 20180626

Termination date: 20190429

CF01 Termination of patent right due to non-payment of annual fee