CN111723593A - Bar code positioning method and positioning device - Google Patents

Bar code positioning method and positioning device Download PDF

Info

Publication number
CN111723593A
CN111723593A CN202010566778.4A CN202010566778A CN111723593A CN 111723593 A CN111723593 A CN 111723593A CN 202010566778 A CN202010566778 A CN 202010566778A CN 111723593 A CN111723593 A CN 111723593A
Authority
CN
China
Prior art keywords
frequency domain
bar code
image
filter template
preset filter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010566778.4A
Other languages
Chinese (zh)
Other versions
CN111723593B (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.)
Institute of Microelectronics of CAS
Original Assignee
Institute of Microelectronics of CAS
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 Institute of Microelectronics of CAS filed Critical Institute of Microelectronics of CAS
Priority to CN202010566778.4A priority Critical patent/CN111723593B/en
Priority claimed from CN202010566778.4A external-priority patent/CN111723593B/en
Publication of CN111723593A publication Critical patent/CN111723593A/en
Application granted granted Critical
Publication of CN111723593B publication Critical patent/CN111723593B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image

Abstract

The invention discloses a bar code positioning method and a bar code positioning device, relates to the technical field of image processing, and aims to solve the problem that the effects of positioning and correcting bar codes are poor due to the influence of various interference factors. The bar code positioning method comprises the following steps: acquiring a preset filter template; obtaining a plurality of image block sequences with different sizes; obtaining a plurality of frequency domain characteristic sequences; obtaining a plurality of frequency domain response graphs; determining a plurality of spatial domain response maps from the plurality of frequency domain response maps; and determining the position of the bar code in the original image according to the plurality of spatial domain response images. The bar code positioning device comprises the bar code positioning method provided by the technical scheme. The barcode positioning method provided by the invention is used for improving the image information acquisition precision and speed.

Description

Bar code positioning method and positioning device
Technical Field
The invention relates to the technical field of image processing, in particular to a bar code positioning method and a bar code positioning device.
Background
Bar codes are widely used in many fields such as commodity circulation, article management, online payment, postal management and the like due to the advantages of a far higher success rate of reading manual records, a reading rate of more than 40 characters per second, low technical application cost, simple and convenient equipment operation and the like.
The core of the bar code technology is coding and decoding information, wherein a coding part is arranged according to a given coding rule through black and white color blocks or color bars, so that the purpose of containing specific information is achieved. The decoding portion needs to go through two steps of image scanning and decoding. Since image scanning is often performed manually, the scanned barcode image is not a regular geometric figure but includes various image distortions caused by scanning tools, lighting conditions, manual operation errors, and the like. In the decoding step, the actual scanned image is converted into a regular bar code graph through operations of positioning, correction and the like, and finally the information contained in the bar code is reversely identified according to the encoding rule.
The traditional bar code decoding technology is influenced by various interference factors, so that the bar code positioning and correcting effects are poor, and the accuracy and the speed of decoding are reduced. The existing solution is to perform operations such as light equalization, binarization, location mark point detection and the like on an original image. However, for the original picture with strong interference, the decoding effect is still limited when the original picture is extracted by the method.
Disclosure of Invention
The invention aims to provide a bar code positioning method and a positioning device, which are used for quickly and accurately positioning the position of a bar code in an image and have strong environmental interference resistance.
In order to achieve the above purpose, the invention provides the following technical scheme:
a bar code location method, comprising:
acquiring a preset filter template;
respectively traversing the original image by utilizing traversal blocks with different sizes to obtain a plurality of image block sequences with different sizes;
normalizing the image block sequences into the same size as the preset filter template and converting the image block sequences into a frequency domain to obtain a plurality of frequency domain characteristic sequences;
filtering the frequency domain characteristic sequences by using a preset filter template to obtain a plurality of frequency domain response graphs;
determining a plurality of spatial domain response maps from the plurality of frequency domain response maps;
and determining the position of the bar code in the original image according to the plurality of spatial domain response images.
Compared with the prior art, in the barcode positioning method provided by the invention, the filter template is obtained, and the filter template trained by the standard image in various environments is used for filtering the plurality of frequency domain feature sequences, so that the influence of various environmental factors is avoided when the barcode position in the image is obtained. And traversing the original image by utilizing the traversal blocks with different sizes to obtain a plurality of image block sequences with different sizes. In general, the size of the barcode in the original image cannot be known in advance. According to the invention, the original image is traversed by utilizing the traversal blocks with different scales to obtain a plurality of image block sequences under different sizes, and the bar code is positioned in the plurality of image block sequences under different sizes, so that the accuracy of positioning the bar code can be improved to a certain extent. And normalizing the image block sequences into the same size as the preset filter template and converting the image block sequences into a frequency domain to obtain a plurality of frequency domain characteristic sequences. Because the calculation complexity in the frequency domain is low, the normalized image block sequence is converted into the frequency domain for correlation operation, so that the calculation complexity of the bar code positioning method can be reduced, and the quick positioning can be realized. And finally, converting the obtained frequency domain response image into a space domain to obtain a space domain response image, and determining the position of the bar code in the original image according to the plurality of space domain response images. The invention only uses the preset filter template to filter a plurality of image block sequences converted into the frequency domain, and then carries out simple comparison operation to obtain the frequency domain response diagram. Compared with the prior art, the method needs operations such as light equalization, binarization, positioning mark point detection and the like on the image, obviously reduces the calculation complexity and saves the positioning time. In addition, in the positioning process of the bar code, the invention only considers a plurality of image block sequences obtained by traversing from one original image, and obtains the pixel information from the plurality of image block sequences under different sizes, so that the obtained bar code positioning result is more accurate.
The present invention also provides a barcode positioning apparatus, comprising: a processor; the processor is used for operating a computer program or instructions to execute the bar code positioning method.
Compared with the prior art, the beneficial effects of the barcode positioning device provided by the invention are the same as those of the barcode positioning method in the technical scheme, and are not repeated herein.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a first flowchart of a barcode positioning method according to an embodiment of the present invention;
FIG. 2 is a second flowchart of a barcode positioning method according to an embodiment of the present invention;
FIG. 3 is a block diagram of a flow chart of a barcode positioning method in an embodiment of the present invention;
FIG. 4 is a fourth flowchart of a barcode positioning method in an embodiment of the present invention;
FIG. 5 is a block diagram of a flow chart of a barcode positioning method in an embodiment of the present invention;
FIG. 6 is a block diagram illustrating a sixth flowchart of a barcode positioning method according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a barcode positioning device in an embodiment of the present invention;
fig. 8 is a schematic hardware structure diagram of a barcode positioning device in an embodiment of the present invention.
Detailed Description
In order to facilitate clear description of technical solutions of the embodiments of the present invention, in the embodiments of the present invention, terms such as "first" and "second" are used to distinguish the same items or similar items having substantially the same functions and actions. For example, the first threshold and the second threshold are only used for distinguishing different thresholds, and the sequence order of the thresholds is not limited. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
It is to be understood that the terms "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a and b combination, a and c combination, b and c combination, or a, b and c combination, wherein a, b and c can be single or multiple.
Before describing the embodiments of the present invention, the related terms related to the embodiments of the present invention are first explained as follows:
traversal (Traversal) refers to making one visit to each node in the tree (or graph) in turn along a certain search route.
The bar code in the embodiment of the invention mainly comprises a one-dimensional code and a two-dimensional code, and the data information is coded by adopting a specific arrangement mode of black and white blocks.
With the advent of the mobile internet age, two-dimensional codes represented by Quick Response codes (QR codes) are widely used in the fields of retail transactions, production process monitoring, article tracking, health management, scientific research, transportation, office automation, mobile electronics, and the like.
The technical point of the bar code includes encoding and decoding processes. Wherein the decoding part needs to quickly and accurately identify the barcode image in the actual scene. Due to the influence of factors such as illumination, shooting angle, background interference and the like, certain technical difficulty exists in extracting the bar code, and the conventional solution is to perform operations such as light equalization, binarization, bar code positioning mark point detection and the like on an original image. However, for original pictures with strong interference, the conventional method has limited effect, resulting in great reduction of the barcode recognition accuracy.
In order to solve the above problems, an embodiment of the present invention discloses a barcode positioning apparatus, including: a processor. The processor is used for running a computer program or instructions to execute the bar code positioning method.
The barcode positioning method can be used for accurately and quickly positioning the barcode in the image, and the barcode may be a one-dimensional code or a two-dimensional code, but is not limited thereto. The barcode positioning method may be performed by a barcode positioning apparatus. The following embodiments are described with the barcode positioning device as the main implementation body.
Fig. 1 shows a schematic diagram of a barcode positioning method provided by an embodiment of the present invention. As shown in fig. 1, a barcode positioning method provided in an embodiment of the present invention includes:
step 101: the barcode positioning device acquires a preset filter template. The preset filter template is obtained by training a plurality of standard images under different environmental factors.
Step 102: the bar code positioning device respectively traverses the original image by utilizing the traversal blocks with different sizes to obtain a plurality of image block sequences with different sizes. It should be understood that the different sizes may be divided according to an equal ratio series, or may be divided randomly according to a uniform distribution, a gaussian distribution, etc., but are not limited thereto.
Illustratively, the pixel area in the original image is 30 × 30 pixels2、60*60pixel2Or 90 by 90 pixels2The image blocks traverse the original image to obtain a plurality of image block groups with the same sizeA sequence of image blocks. For example, in terms of 30 x 30 pixels of image pixel area2The image block traverses the original image, and a plurality of image pixels with the pixel area of 30 x 30 pixels can be obtained2In this case, the plurality of image blocks form an image block sequence.
Step 103: the barcode positioning device normalizes the image block sequences to be the same as the preset filter template in size and converts the image block sequences to a frequency domain to obtain a plurality of frequency domain characteristic sequences.
Illustratively, the image pixel area is 30 × 30 pixels2The image block sequence is normalized to the same size as the preset filter template, and the pixel area of the normalized image is 30 x 30 pixels2The image block sequence is converted into a frequency domain by two-dimensional fast Fourier transform to obtain an image with 30 pixels by 30 pixels2The frequency domain signature sequence of (1).
Step 104: and the bar code positioning device carries out filtering processing on the frequency domain characteristic sequences by using a preset filter template to obtain a plurality of frequency domain response graphs. It should be appreciated that the plurality of frequency domain response maps may characterize the correlation of the pre-set filtering template with the barcode in the frequency domain.
For example, the above-mentioned plurality of frequency domain feature sequences may be image pixels with an area of 60 × 60 pixels2The frequency domain signature sequence of (1). Filtering by using preset filter template to obtain image pixel with 60 x 60 pixels2The frequency domain characteristic sequence is filtered to obtain the pixel area of 60 x 60 pixels of the image2Frequency domain response map of (1). Because the operation complexity is low in the frequency domain, the operation complexity can be reduced and the operation speed can be accelerated by filtering the image in the frequency domain.
Step 105: the barcode positioning device determines a plurality of spatial domain response maps from the plurality of frequency domain response maps.
For example, the frequency domain response maps may be image pixels with 60 by 60 pixels2Frequency domain response map of (1). The image pixel area is 60 x 60pixel2The frequency domain response map is converted into an image with 60 by 60 pixels2The spatial domain response map of (a). Since the invention is to obtain the original imageThe position of the bar code, and only a spectrogram can be obtained in the frequency domain, so that the relationship between frequency transformation and amplitude change is obtained, and the image still needs to be converted into the spatial domain after the complex operation is finished so as to obtain the spatial coordinate of the central point of the image.
Step 106: the barcode positioning device determines the position of the barcode in the original image according to the plurality of spatial domain response maps. The position coordinate of the pixel corresponding to the maximum response value and the original size of the space domain response map where the maximum response value is located can be determined based on the plurality of space domain response maps, and the position of the barcode in the original image can be determined based on the position coordinate of the pixel corresponding to the maximum response value and the original size of the space domain response map where the maximum response value is located.
According to the bar code positioning method, the original image is traversed by utilizing the plurality of traversal blocks with different sizes, and a plurality of image block sequences under different sizes are obtained. Positioning the bar code in the image block sequences with different sizes can improve the accuracy of bar code positioning to a certain extent. The plurality of frequency domain characteristic sequences are filtered through the trained preset filter template, and the preset filter template is obtained by training standard images in different environments, so that the influence of various environmental factors can be avoided when the barcode position in the image is obtained by filtering the plurality of frequency domain characteristic sequences through the preset filter template. Meanwhile, the bar code positioning method of the invention carries out the correlation operation in the frequency domain, thereby reducing the operation complexity and accelerating the acquisition efficiency.
As a possible implementation manner, as shown in fig. 2, the acquiring of the preset filter by the barcode positioning apparatus includes:
step 1011: the barcode positioning device acquires standard image features. It should be understood that the standard image herein refers to a standard image acquired under different circumstances and the like.
In practical applications, the position coordinates of a standard barcode may be manually selected, and the image feature within the frame may be extracted, where the image feature may be the pixel value of each pixel in the standard barcode, but is not limited thereto.
Step 1012: and the bar code positioning device converts the standard image characteristics into a frequency domain to obtain standard frequency domain characteristics. The acquired standard image features can be converted into a frequency domain by using two-dimensional fast Fourier transform to obtain standard frequency domain features.
Step 1013: and the bar code positioning device carries out filtering processing on the standard frequency domain characteristics by using a filtering algorithm to obtain a preset filter. The expression of the filtering algorithm here is:
Figure BDA0002547897310000071
wherein the content of the first and second substances,
Figure BDA0002547897310000072
is the fourier transform of a preset filter template f,
Figure BDA0002547897310000073
is the fourier transform of the standard image features of (a),
Figure BDA0002547897310000074
is the fourier transform of the gaussian desired response, λ is the regular term coefficient, subscript j refers to the element at the jth position, I is the identity matrix, ⊙ denotes the Hadamard product operation.
The deduction process of the filtering algorithm is as follows:
Figure BDA0002547897310000075
wherein: f is the preset filter template to be trained, x is the standard image feature, y is the gaussian expected response, and λ is the regular term coefficient. D is 1,2, …, D is the index of the characteristic channel.
Since the correlation operation has high computational complexity, the above equation can convert the correlation operation in the spatial domain into the Hadamard product operation (denoted by symbol [) in the frequency domain by fast fourier transform.
The training formula of the preset filter template converted into the frequency domain is as follows:
Figure BDA0002547897310000076
Figure BDA0002547897310000077
wherein the content of the first and second substances,
Figure BDA0002547897310000078
and
Figure BDA0002547897310000079
respectively, the Fourier transform of a preset filtering template f, a standard image feature x and a Gaussian label y.
The above equation can be decomposed into single element solutions:
Figure BDA00025478973100000710
where the subscript j indicates the element of the jth position. A closed-form solution can thus be obtained:
Figure BDA0002547897310000081
wherein I is an identity matrix.
In an alternative, as shown in fig. 3, the bar code positioning apparatus normalizes each of the plurality of image block sequences to the same size as the preset filter template and converts the image block sequences to the frequency domain, and obtaining the plurality of frequency domain feature sequences includes:
step 1031: the barcode positioning device normalizes the image block sequences to be the same as the preset filter template in size, and the normalized image block sequences are obtained.
For example, when the pixel area size of the filter template is preset to be 60 × 60 pixels2Each image block in the sequence of image blocks has a pixel area size of 30 x 30 pixels2The pixel area of each image block in the sequence of image blocks needs to be normalized to 60 x 60 pixels2
Step 1032: and the bar code positioning device converts the normalized image block sequences into a frequency domain by utilizing two-dimensional fast Fourier transform to obtain a plurality of frequency domain characteristic sequences. It should be understood that the plurality of image block sequences herein includes an image block in each image block sequence.
For example, the image positioning apparatus converts the image blocks in each image block sequence to the frequency domain to obtain the corresponding frequency domain features in each frequency domain feature sequence.
In an alternative, each of the plurality of frequency-domain features includes a sub-frequency-domain feature of a different channel corresponding thereto. The different channels here may be RGB channels.
As shown in fig. 4, the above barcode positioning apparatus performs filtering processing on a plurality of frequency domain feature sequences by using a preset filter template to obtain a plurality of frequency domain response maps includes:
step 1041: the bar code positioning device carries out Hadamard product operation on the preset filter template and the sub-frequency domain characteristics of different channels in the plurality of frequency domain characteristic sequences to obtain a plurality of filtering sub-frequency domain characteristic sequences of different channels.
In practical application, the barcode positioning device performs hadamard product operation on the obtained sub-frequency domain characteristics of each frequency domain characteristic sequence in different channels and a preset filter template to obtain a plurality of filtering sub-frequency domain characteristic sequences of different channels.
The expression of the Hadamard product operation is as follows:
Figure BDA0002547897310000091
wherein the content of the first and second substances,
Figure BDA0002547897310000092
is the fourier transform of a preset filter template f,
Figure BDA0002547897310000093
is the fourier transform of the standard image features, the index i indicates the ith position, is the sign of the conjugate operation, ⊙ indicates the multiplication of the corresponding elements.
Step 1042: the bar code positioning device correspondingly superposes the plurality of filtered sub-frequency domain characteristic sequences of different channels to obtain a plurality of frequency domain response graphs.
In practical application, in the case that the channel is an RGB channel, the barcode positioning device superimposes the filter sub-feature at the a position of the R channel, the filter sub-feature at the a position of the G channel, and the filter sub-feature at the a position of the B channel of each filter sub-sequence. And superposing the filtering sub-feature at the B position of the R channel, the filtering sub-feature at the B position of the G channel and the filtering sub-feature at the B position of the B channel, and so on to obtain a plurality of frequency domain response graphs.
As a possible implementation manner, the determining, by the barcode positioning apparatus, the spatial domain response map according to the plurality of frequency domain response maps includes:
step 1051: and the bar code positioning device carries out two-dimensional fast Fourier inverse transformation on the frequency domain response images to obtain a plurality of spatial domain response images. And the bar code positioning device carries out two-dimensional Inverse Fast Fourier Transform (IFFT) on each obtained frequency domain response image to obtain a corresponding response image of a spatial domain.
As a possible implementation manner, as shown in fig. 5, the determining, by the barcode positioning apparatus, the position of the barcode in the original image according to the plurality of spatial domain response maps includes:
step 1061: the barcode positioning device determines a spatial domain response map having a maximum response value from the plurality of spatial domain response maps.
In practical applications, each point on the spatial domain response map has a specific value, i.e. a response value. In the case of determining the maximum value among all the response values on the plurality of spatial domain response maps, the spatial domain response map having the maximum response value may be determined, and it should be understood that the spatial domain response map is one of the plurality of spatial domain response maps, and the spatial domain response map is most effective in response, and may be a response map including the information of the entire two-dimensional code in the original image. After the spatial domain response map having the maximum response value is determined, images other than the map are not processed.
Step 1062: and the bar code positioning device determines the position coordinates of the pixel corresponding to the maximum response value in the space domain response map with the maximum response value according to the space domain response map with the maximum response value. After the maximum response value is determined, the position coordinates of the maximum response value are then determined in the spatial domain response map having the maximum response value.
Step 1063: the barcode positioning device determines the position coordinate of the pixel corresponding to the maximum response value in the spatial domain response map with the maximum response value as the center point coordinate of the position of the barcode in the original image.
Step 1064: the barcode positioning apparatus determines the size of the spatial domain response map having the maximum response value as the outer frame size of the barcode in the original image. It should be understood that the size of the spatial domain response map herein does not refer to the original size of the spatial domain response map, but rather the size that needs to be processed.
Step 1065: the bar code positioning device determines the position of the bar code in the original image according to the center point coordinate of the position of the bar code in the original image and the size of the outer frame of the bar code in the original image. Under the condition that the position coordinates of the central point of the bar code and the size of the outer frame of the bar code are known, the position of the bar code in the original image can be accurately determined.
For example, the position of the barcode may be calculated according to the following formula:
Figure BDA0002547897310000101
here, ifft2 represents a two-dimensional inverse fast fourier transform, and r is a response map of the correlation operation. And determining the position of the bar code in the original image according to the position of the maximum value of the pixel value in the r.
In one possible implementation, as shown in fig. 6, the determining, by the barcode positioning apparatus, the size of the spatial domain response map having the maximum response value as the outer frame size of the barcode in the original image includes:
step 1064-1: the bar code positioning device determines the proportional relation between the size of the outer frame of the preset filter template and the size of the bar code in the preset filter template. It should be understood that the preset filter template here is also an image with a two-dimensional code, i.e. with an outer frame. And the spatial domain response map with the maximum response value is obtained by utilizing the preset filter template training, and under the condition of determining the spatial domain response map with the maximum response value, the outer frame size of the spatial domain response map with the maximum response value can be determined only by determining the proportional relation between the size of the barcode in the preset filter template and the outer frame size of the preset filter template.
Step 1064-2: and the bar code positioning device scales the space domain response image with the maximum response value according to the proportional relation between the size of the outer frame of the preset filter template and the size of the bar code in the preset filter template to obtain the scaled size of the space domain response image with the maximum response value.
Step 1064-3: the bar code positioning device determines the scaled size of the spatial domain response map with the maximum response value as the outer frame size of the bar code in the original image.
The scheme provided by the embodiment of the invention is mainly introduced from the perspective of a bar code positioning device. It will be appreciated that the bar code positioning device, in order to perform the above functions, includes corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the present invention can be implemented in hardware or a combination of hardware and computer software, with the exemplary elements and algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiment of the present invention, functional modules of a barcode positioning device and the like may be divided according to the above method, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 7 shows a block diagram of a barcode positioning apparatus 200 according to an embodiment of the present invention, in a case where a corresponding integrated unit is used. As shown in fig. 7, the barcode positioning apparatus 200 includes: a processing unit 201.
And the processing unit 201 is configured to support the barcode positioning apparatus 200 to perform steps 101 to 105 in the above embodiments.
The processing unit 201 is configured to support the barcode positioning apparatus 200 to perform steps 1051 to 1053 in the foregoing embodiments.
The processing unit 201 is configured to support the barcode positioning apparatus 200 to perform steps 1051-1 to 1051-2 in the foregoing embodiments.
And a processing unit 201, configured to support the barcode positioning apparatus 200 to perform steps 1031 to 1032 in the foregoing embodiment.
The processing unit 201 is used for supporting the barcode positioning device 200 to perform the steps 1052-1 to 1052-3 in the above embodiments.
The processing unit 201 is configured to support the barcode positioning apparatus 200 to perform steps 1001 and 1003 in the foregoing embodiment.
The processing unit 201 is configured to support the barcode positioning apparatus 200 to perform steps 1021 to 1022 in the above embodiments.
And a processing unit 201, configured to support the barcode positioning apparatus 200 to perform steps 1031 to 1032 in the foregoing embodiment.
In some possible implementations, the barcode positioning apparatus 200 may further include a storage unit 202 for storing program codes and data of the processing unit 201.
The processing Unit 201 may be a Processor or a controller, such as a Central Processing Unit (CPU), a general-purpose Processor, a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. A processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, a DSP and a microprocessor, or the like. The storage unit 202 may be a memory.
When the processing unit 201 is a processor and the storage unit 202 is a memory, the barcode positioning device according to the embodiment of the present invention may be the schematic structural diagram of the barcode positioning device 200 shown in fig. 8.
Fig. 8 is a schematic diagram illustrating a hardware structure of a barcode positioning apparatus 200 according to an embodiment of the present invention. As shown in FIG. 8, the bar code locator 200 includes a processor 210.
As shown in fig. 8, the processor 210 may be a general-purpose Central Processing Unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more ics for controlling the execution of programs according to the present invention.
As shown in fig. 8, the barcode positioning apparatus 200 may further include a communication line 230. Communication link 230 may include a path for transmitting information between the aforementioned components.
Optionally, as shown in fig. 8, the barcode positioning apparatus 200 may further include a memory 220. The memory 220 is used to store computer-executable instructions for performing aspects of the present invention and is controlled for execution by the processor 210. The processor 210 is configured to execute computer-executable instructions stored in the memory, so as to implement the barcode positioning method provided by the embodiment of the present invention.
As shown in fig. 8, the memory 220 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a Random Access Memory (RAM) or other types of dynamic storage devices that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 220 may be separate and coupled to the processor 210 via a communication line 230. The memory 220 may also be integrated with the processor 210.
Optionally, the computer-executable instructions in the embodiment of the present invention may also be referred to as application program codes, which is not specifically limited in this embodiment of the present invention.
In particular implementations, as one embodiment, processor 210 may include one or more CPUs, such as CPU0 and CPU1 in fig. 8, as shown in fig. 8.
In one implementation, as shown in FIG. 8, the barcode positioning apparatus 200 may comprise a plurality of processors, such as the processor 210 and the processor 240 in FIG. 8. Each of these processors may be a single core processor or a multi-core processor.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. The procedures or functions of the embodiments of the invention are performed in whole or in part when the computer program or instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a computer network, a terminal, user equipment, or other programmable device. The computer program or instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer program or instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wire or wirelessly. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that integrates one or more available media. The available media may be magnetic media, such as floppy disks, hard disks, magnetic tape; or optical media such as Digital Video Disks (DVDs); it may also be a semiconductor medium, such as a Solid State Drive (SSD).
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
While the invention has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the invention. Accordingly, the specification and figures are merely exemplary of the invention as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method of locating a bar code, comprising:
acquiring a preset filter template;
respectively traversing the original image by utilizing traversal blocks with different sizes to obtain a plurality of image block sequences with different sizes;
normalizing the image block sequences into the same size as the preset filter template and converting the image block sequences into a frequency domain to obtain a plurality of frequency domain characteristic sequences;
filtering the frequency domain characteristic sequences by using a preset filter template to obtain a plurality of frequency domain response graphs;
determining a plurality of spatial domain response maps from the plurality of frequency domain response maps;
and determining the position of the bar code in the original image according to the plurality of spatial domain response images.
2. The barcode positioning method according to claim 1, wherein the obtaining the preset filter template comprises:
acquiring standard image characteristics;
converting the standard image characteristics into a frequency domain to obtain standard frequency domain characteristics;
and carrying out filtering processing on the standard frequency domain characteristics by using a filtering algorithm to obtain the preset filter template.
3. The barcode positioning method according to claim 2, wherein the expression of the filtering algorithm is:
Figure FDA0002547897300000011
wherein the content of the first and second substances,
Figure FDA0002547897300000012
is the fourier transform of a preset filter template f,
Figure FDA0002547897300000013
is a fourier transform of a standard image feature,
Figure FDA0002547897300000014
is the fourier transform of the gaussian desired response, λ is the regular term coefficient, the index j refers to the element at the jth position, I is the identity matrix, ⊙ denotes the corresponding element multiplication.
4. The barcode positioning method of claim 1, wherein the normalizing the image block sequences to the same size as the preset filter template and converting the image block sequences to the frequency domain to obtain a plurality of frequency domain feature sequences comprises:
normalizing the image block sequences to be the same as the preset filter template in size to obtain the normalized image block sequences;
and converting the normalized image block sequences into a frequency domain by using two-dimensional fast Fourier transform to obtain a plurality of frequency domain characteristic sequences.
5. The method according to claim 1, wherein each of the plurality of sequences of frequency domain features comprises a sub-frequency domain feature of a different channel corresponding thereto;
the filtering the plurality of frequency domain characteristic sequences by using a preset filter template to obtain a plurality of frequency domain response graphs comprises:
performing Hadamard product operation on the preset filter template and the sub-frequency domain characteristics of different channels in the plurality of frequency domain characteristic sequences to obtain a plurality of filtering sub-frequency domain characteristic sequences of different channels;
and correspondingly superposing the plurality of filtered sub-frequency domain characteristic sequences of different channels to obtain a plurality of frequency domain response graphs.
6. The barcode positioning method according to claim 5, wherein the Hadamard product operation has an expression:
Figure FDA0002547897300000021
wherein the content of the first and second substances,
Figure FDA0002547897300000022
is the fourier transform of a preset filter template f,
Figure FDA0002547897300000023
is the fourier transform of the standard image features, the index i indicates the ith position, is the sign of the conjugate operation, ⊙ indicates the multiplication of the corresponding elements.
7. The method of claim 1, wherein determining a spatial domain response map from the plurality of frequency domain response maps comprises:
and performing two-dimensional fast Fourier inverse transformation on the plurality of frequency domain response graphs to obtain a plurality of spatial domain response graphs.
8. The barcode positioning method according to claim 1, wherein the determining the position of the barcode in the original image according to the plurality of spatial domain response maps comprises:
determining a spatial domain response map having a maximum response value from the plurality of spatial domain response maps;
determining the position coordinates of the pixel corresponding to the maximum response value in the spatial domain response map with the maximum response value according to the spatial domain response map with the maximum response value;
determining the position coordinate of the pixel corresponding to the maximum response value in the spatial domain response image with the maximum response value as the center point coordinate of the position of the bar code in the original image;
determining the size of the spatial domain response map with the maximum response value as the outer frame size of the bar code in the original image;
and determining the position of the bar code in the original image according to the coordinates of the central point of the position of the bar code in the original image and the size of the outer frame of the bar code.
9. The barcode positioning method of claim 8, wherein the determining the size of the spatial domain response map with the maximum response value as the outer frame size of the barcode in the original image comprises:
determining the proportional relation between the size of the outer frame of the preset filter template and the size of the bar code in the preset filter template;
scaling the space domain response graph with the maximum response value according to the proportional relation between the size of the outer frame of the preset filter template and the size of the bar code in the preset filter template to obtain the scaled size of the space domain response graph with the maximum response value;
and determining the scaled size of the spatial domain response map with the maximum response value as the outer frame size of the bar code in the original image.
10. A bar code positioning device, comprising: a processor; the processor is used for running a computer program or instructions to execute the barcode positioning method according to any one of claims 1 to 9.
CN202010566778.4A 2020-06-19 Bar code positioning method and positioning device Active CN111723593B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010566778.4A CN111723593B (en) 2020-06-19 Bar code positioning method and positioning device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010566778.4A CN111723593B (en) 2020-06-19 Bar code positioning method and positioning device

Publications (2)

Publication Number Publication Date
CN111723593A true CN111723593A (en) 2020-09-29
CN111723593B CN111723593B (en) 2024-05-10

Family

ID=

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204639A (en) * 2016-06-27 2016-12-07 开易(北京)科技有限公司 Based on frequency domain regression model target tracking method, system and senior drive assist system
CN108846851A (en) * 2018-04-25 2018-11-20 河北工业职业技术学院 Motion target tracking method and terminal device
CN109816077A (en) * 2019-01-16 2019-05-28 王诗会 A kind of hidden method of two-dimensional barcode information, device, electronic equipment and storage medium
CN109978923A (en) * 2019-04-04 2019-07-05 杭州电子科技大学 One kind being based on double-template dimension self-adaption correlation filtering method for tracking target and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106204639A (en) * 2016-06-27 2016-12-07 开易(北京)科技有限公司 Based on frequency domain regression model target tracking method, system and senior drive assist system
CN108846851A (en) * 2018-04-25 2018-11-20 河北工业职业技术学院 Motion target tracking method and terminal device
CN109816077A (en) * 2019-01-16 2019-05-28 王诗会 A kind of hidden method of two-dimensional barcode information, device, electronic equipment and storage medium
CN109978923A (en) * 2019-04-04 2019-07-05 杭州电子科技大学 One kind being based on double-template dimension self-adaption correlation filtering method for tracking target and system

Similar Documents

Publication Publication Date Title
US10762387B2 (en) Method and apparatus for processing image
Zamberletti et al. Robust angle invariant 1d barcode detection
CN109146963B (en) Image position offset detection method based on rapid feature matching
CN110348439B (en) Method, computer readable medium and system for automatically identifying price tags
US20030007690A1 (en) System and method for image pattern matching using a unified signal transform
CN111178290A (en) Signature verification method and device
WO2023284609A1 (en) Graphic code identification method and apparatus, computer device, and storage medium
CN109858542A (en) A kind of character identifying method and device
CN116311214B (en) License plate recognition method and device
CN111311593B (en) Multi-ellipse detection and evaluation algorithm, device and terminal
Bodnár et al. A novel method for barcode localization in image domain
CN111797642B (en) Bar code identification method and terminal
CN113516697A (en) Image registration method and device, electronic equipment and computer-readable storage medium
CN116188917B (en) Defect data generation model training method, defect data generation method and device
CN107423739B (en) Image feature extraction method and device
CN111723593B (en) Bar code positioning method and positioning device
CN112215266A (en) X-ray image contraband detection method based on small sample learning
CN111723593A (en) Bar code positioning method and positioning device
CN111753729A (en) False face detection method and device, electronic equipment and storage medium
CN114463764A (en) Table line detection method and device, computer equipment and storage medium
CN115272726A (en) Feature matching method and device, electronic equipment and storage medium
CN114758145A (en) Image desensitization method and device, electronic equipment and storage medium
CN114429628A (en) Image processing method and device, readable storage medium and electronic equipment
CN109389000B (en) Bar code identification method and computer applying same
CN111291240B (en) Method for processing data and data processing device

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