Method and device for removing motion blur of bar code image and bar code recognition equipment
By constructing a motion blur degenerate convolution template in the barcode recognition device to remove motion blur, the problem of low barcode recognition accuracy in dynamically changing environments is solved, and image clarity and recognition accuracy are improved.
Patent Information
- Application Number
- CN202411107702.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-01-03
AI Technical Summary
In a dynamically changing environment, barcode recognition equipment has low recognition accuracy due to motion blur. The prior art reduces image exposure time by improving hardware levels but leads to low barcode image contrast, which affects recognition accuracy.
By obtaining two-frame barcode images in the same video sequence, determining their motion vectors, and building a motion blur degradation convolution template, and applying this template to preprocess the image to remove motion blur and improve image clarity.
It improves the accuracy of barcode recognition in dynamically changing environments, enhances image clarity, and overcomes the problem of low contrast caused by hardware improvement.
Smart Images

Figure CN119251093A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of barcode recognition technology, for example, to a method and apparatus for removing motion blur from a barcode image, and a barcode recognition device. Background Art
[0002] During the use of barcode recognition equipment, if the barcode recognition equipment moves during the scanning process, or the scanned barcode itself moves, it will cause blurring during image acquisition, affecting recognition accuracy. Therefore, in a dynamically changing environment, such as a production line, logistics center, etc., the barcode recognition equipment needs to have a certain motion tolerance so that it can respond quickly and accurately recognize the moving barcode.
[0003] In the related art, the image exposure time is reduced by improving the hardware level, thereby improving the motion tolerance, for example, improving the lens transmittance and increasing the diameter of the camera's light hole.
[0004] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related art:
[0005] Reducing the image exposure time will also result in the barcode image having only a lower contrast, which will still affect the accuracy of barcode recognition in a dynamically changing environment.
[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0007] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0008] The embodiments of the present disclosure provide a method and apparatus for removing motion blur from a barcode image, and a barcode recognition device, so as to improve the accuracy of barcode recognition in a dynamically changing environment.
[0009] In some embodiments, a method for removing motion blur from a barcode image includes: acquiring a first barcode image and a second barcode image in the same video sequence, and determining a first acquisition time of the first barcode image and a second acquisition time of the second barcode image; determining a motion vector between the first barcode image and the second barcode image based on feature-based image matching; constructing a motion blur degraded convolution template based on the first acquisition time, the second acquisition time and the motion vector; and removing motion blur from the second barcode image based on the motion blur degraded convolution template.
[0010] Optionally, obtaining the first barcode image and the second barcode image includes: obtaining two frames of images collected continuously; using the first frame of image as the first barcode image and the second frame of image as the second barcode image; wherein the first barcode image and the second barcode image have overlapping areas, and there are recognizable texture features in the overlapping areas; the texture features include boundaries, center points, corner points or external contours.
[0011] Optionally, determining a motion vector between the first barcode image and the second barcode image based on feature image matching includes: performing image matching on the first barcode image and the second barcode image to determine common feature points of the first barcode image and the second barcode image; determining first feature point coordinates of the common feature point in the first barcode image, and second feature point coordinates of the common feature point in the second barcode image; calculating a motion vector based on the first feature point coordinates and the second feature point coordinates; wherein the common feature point includes a geometric center point, a centroid, a geometric center or a corner point.
[0012] Optionally, image matching is performed on the first barcode image and the second barcode image according to one or more of the following methods: a shape-based matching method; a grayscale-based matching method; a feature descriptor-based matching method; a correlation-based matching method.
[0013] Optionally, a motion blur degraded convolution template is constructed according to the first acquisition time, the second acquisition time and the motion vector, including: calculating the diameter of the motion blur degraded convolution template according to the first acquisition time, the second acquisition time and the motion vector; determining the motion direction according to the motion vector; and constructing the motion blur degraded convolution template based on the diameter and motion direction of the motion blur degraded convolution template.
[0014] Optionally, the first acquisition time includes a first acquisition start time and a first acquisition end time, and the second acquisition time includes a second acquisition start time and a second acquisition end time; calculating the diameter of the motion blurred degraded convolution template according to the first acquisition time, the second acquisition time and the motion vector, including: determining the acquisition time interval between the first barcode image and the second barcode image according to the first acquisition start time, the first acquisition end time, the second acquisition start time and the second acquisition end time; calculating the diameter of the motion blurred degraded convolution template according to the acquisition time interval, the motion vector, the first acquisition end time and the second acquisition end time.
[0015] Optionally, based on the diameter and motion direction of the motion blur degraded convolution template, a motion blur degraded convolution template is constructed, including: determining the initial template according to the diameter of the motion blur degraded convolution template; determining the weight of each element in the initial template according to the motion direction; filling the initial template according to the weight of each element to obtain the motion blur degraded convolution template.
[0016] Optionally, removing motion blur from the second barcode image according to the motion blur degradation convolution template includes: preprocessing the second barcode image; applying the motion blur degradation convolution template to the preprocessed second barcode image to remove motion blur from the preprocessed second barcode image.
[0017] In some embodiments, the apparatus for removing motion blur from a barcode image includes a processor and a memory storing program instructions, and the processor is configured to execute the above-mentioned method for removing motion blur from a barcode image when running the program instructions.
[0018] In some embodiments, a barcode recognition device includes: a barcode recognition device body; and the above-mentioned device for removing motion blur from a barcode image, which is installed on the barcode recognition device body.
[0019] The method and apparatus for removing motion blur from a barcode image and the barcode recognition device provided by the embodiments of the present disclosure can achieve the following technical effects:
[0020] In the disclosed embodiment, the first barcode image and the second barcode image are from the same video sequence, and are barcode images in the same motion scene under different time conditions. Therefore, there are common feature points between the first barcode image and the second barcode image, and the motion vector between the first barcode image and the second barcode image can be determined based on the common feature points by image matching based on the features. Then, based on the first acquisition time, the second acquisition time and the motion vector, the degradation model parameters of the image motion blur can be determined, thereby constructing a motion blur degradation convolution template, which provides accurate prior information for image de-motion blur. Finally, the second barcode image is subjected to motion blur removal based on the motion blur degradation convolution template, thereby improving the clarity of the barcode image, thereby improving the accuracy of barcode recognition in a dynamically changing environment.
[0021] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0023] Figure 1 is a schematic diagram of a method for removing motion blur from a barcode image provided by an embodiment of the present disclosure;
[0024] Figure 2 is a schematic diagram of a first barcode image and a second barcode image provided by an embodiment of the present disclosure;
[0025] Figure 3 is a schematic diagram of another method for removing motion blur from a barcode image provided by an embodiment of the present disclosure;
[0026] Figure 4 is a schematic diagram of another method for removing motion blur from a barcode image provided by an embodiment of the present disclosure;
[0027] Figure 5 is a schematic diagram of a motion blur degraded convolution template provided by an embodiment of the present disclosure;
[0028] Figure 6 It is a schematic diagram of a device for removing motion blur from a barcode image provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0030] The terms "first", "second", etc. in the technical solutions described in this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the disclosed embodiments described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0031] Unless otherwise stated, the term "plurality" means two or more.
[0032] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0033] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0034] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0035] Combination Figure 1As shown, the embodiment of the present disclosure provides a method for removing motion blur from a barcode image. The execution subject of the method may be a processor, and the method includes:
[0036] S001, the processor obtains a first barcode image and a second barcode image in the same video sequence, and determines a first acquisition time of the first barcode image and a second acquisition time of the second barcode image.
[0037] S002: The processor determines a motion vector between the first barcode image and the second barcode image based on feature image matching.
[0038] S003: The processor constructs a motion blur degradation convolution template according to the first acquisition time, the second acquisition time and the motion vector.
[0039] S004, the processor removes motion blur from the second barcode image according to the motion blur degradation convolution template.
[0040] In the disclosed embodiment, the first barcode image and the second barcode image are from the same video sequence, and are barcode images in the same motion scene under different time conditions. Therefore, there are common feature points between the first barcode image and the second barcode image, and the motion vector between the first barcode image and the second barcode image can be determined based on the common feature points by image matching based on the features. Then, based on the first acquisition time, the second acquisition time and the motion vector, the degradation model parameters of the image motion blur can be determined, thereby constructing a motion blur degradation convolution template, which provides accurate prior information for image de-motion blur. Finally, the second barcode image is subjected to motion blur removal based on the motion blur degradation convolution template, thereby improving the clarity of the barcode image, thereby improving the accuracy of barcode recognition in a dynamically changing environment.
[0041] Optionally, obtaining the first barcode image and the second barcode image includes: obtaining two frames of images collected continuously; using the first frame of image as the first barcode image and the second frame of image as the second barcode image; wherein the first barcode image and the second barcode image have overlapping areas, and there are recognizable texture features in the overlapping areas; the texture features include boundaries, center points, corner points or external contours.
[0042] Combination Figure 2As shown, taking the scanning of QR (Quick Response) code as an example, on the time axis T of the video sequence, the first barcode image is acquired from the first acquisition start time st1 to the first acquisition end time et1, and the second barcode image is acquired from the second acquisition start time st2 to the second acquisition end time et2. The two frames of images acquired continuously ensure the continuity of time and help analyze the dynamic changes between images. There are overlapping areas between the first barcode image and the second barcode image, such as the QR code part in the image, which can be used for image matching and feature point recognition. There are also recognizable texture features in the image, such as the corner points p1 and p2 of the QR code in the image.
[0043] Optionally, determining a motion vector between the first barcode image and the second barcode image based on feature image matching includes: performing image matching on the first barcode image and the second barcode image to determine common feature points of the first barcode image and the second barcode image; determining first feature point coordinates of the common feature point in the first barcode image, and second feature point coordinates of the common feature point in the second barcode image; calculating a motion vector based on the first feature point coordinates and the second feature point coordinates; wherein the common feature point includes a geometric center point, a centroid, a geometric center or a corner point.
[0044] Combination Figure 3 As shown, the embodiment of the present disclosure provides another method for removing motion blur from a barcode image, comprising:
[0045] S101: A processor acquires a first barcode image and a second barcode image in a same video sequence, and determines a first acquisition time of the first barcode image and a second acquisition time of the second barcode image.
[0046] S102: The processor performs image matching on the first barcode image and the second barcode image to determine common feature points of the first barcode image and the second barcode image.
[0047] S103, the processor determines the coordinates of the first feature point of the common feature point in the first barcode image, and the coordinates of the second feature point of the common feature point in the second barcode image.
[0048] S104: The processor calculates a motion vector according to the coordinates of the first feature point and the coordinates of the second feature point.
[0049] S105: The processor constructs a motion blur degradation convolution template according to the first acquisition time, the second acquisition time and the motion vector.
[0050] S106: The processor removes motion blur from the second barcode image according to the motion blur degradation convolution template.
[0051] By using the identifiable texture features in the image, the first barcode image and the second barcode image can be matched to determine the common feature points in the images. Then the coordinates of the first feature point of the common feature point in the first barcode image and the coordinates of the second feature point of the common feature point in the second barcode image are determined. Figure 2 For example, the coordinates of the first feature point are p1 (128, 227), and the coordinates of the second feature point are p2 (128, 361). Finally, based on the coordinates of the first feature point and the second feature point, the motion vector V = p2-p1 = (0, 134) of the QR code or barcode recognition device is determined.
[0052] Optionally, image matching is performed on the first barcode image and the second barcode image according to one or more of the following methods: a shape-based matching method; a grayscale-based matching method; a feature descriptor-based matching method; a correlation-based matching method.
[0053] In this embodiment, different matching methods can be selected to match the first barcode image and the second barcode image according to different actual situations. Image matching is a key technology in computer vision and image processing, which is used to find the same or similar features between the first barcode image and the second barcode image. Among them, the shape-based matching method focuses on the shape features of the object in the image, extracts the outline or boundary of the object, and uses shape descriptors (such as moments, curve lengths, curvatures, etc.) to identify and match the object. The grayscale-based matching method uses the grayscale value of the image for matching, and finds the matching area by comparing the grayscale histogram or other statistical characteristics of the image area. It is sensitive to illumination changes and noise, but is relatively simple to implement. The matching method based on feature descriptors first extracts key points in the image, and then generates descriptors for these key points. The descriptors can capture local features around the key points, such as SIFT (scale-invariant feature transform), SURF (accelerated robust features), ORB (Oriented FAST and Rotated BRIEF), etc. During the matching process, the best matching feature point pair is found by comparing the descriptors. Correlation-based matching methods find matches by calculating the correlation between image regions. Common correlation metrics include cross-correlation, normalized cross-correlation (NCC), etc., which have good robustness to grayscale changes and image geometric transformations. In addition to the above methods, there are also methods based on template matching and machine learning. Template matching searches for the best matching area on the image through a sliding window. Machine learning-based methods may use training data to learn the matching relationship between image features. In addition, in practical applications, the following factors need to be considered: image quality, including noise level, contrast, lighting conditions, etc.; feature distinguishability, including whether the object has a unique shape, texture or color; computing resources, including the different computational complexity of different matching methods, and the need to select a suitable method based on the actual application scenario; robustness, including the sensitivity of the matching method to image transformations (such as rotation, scaling, occlusion).
[0054] Optionally, a motion blur degraded convolution template is constructed according to the first acquisition time, the second acquisition time and the motion vector, including: calculating the diameter of the motion blur degraded convolution template according to the first acquisition time, the second acquisition time and the motion vector; determining the motion direction according to the motion vector; and constructing the motion blur degraded convolution template based on the diameter and motion direction of the motion blur degraded convolution template.
[0055] Combination Figure 4 As shown, the embodiment of the present disclosure provides another method for removing motion blur from a barcode image, comprising:
[0056] S201: The processor obtains a first barcode image and a second barcode image in the same video sequence, and determines a first acquisition time of the first barcode image and a second acquisition time of the second barcode image.
[0057] S202: The processor determines a motion vector between the first barcode image and the second barcode image based on feature image matching.
[0058] S203: The processor calculates the diameter of the motion blur degraded convolution template according to the first acquisition time, the second acquisition time and the motion vector.
[0059] S204: The processor determines the motion direction according to the motion vector.
[0060] S205: The processor constructs a motion blurred degraded convolution template based on the diameter and motion direction of the motion blurred degraded convolution template.
[0061] S206: The processor removes motion blur from the second barcode image according to the motion blur degradation convolution template.
[0062] In this embodiment, to construct a motion blur degraded convolution template, it is necessary to first determine the template size, that is, calculate the diameter of the motion blur degraded convolution template, and determine the motion direction according to the motion vector. Finally, the motion blur degraded convolution template is constructed according to the template diameter and the motion direction.
[0063] Optionally, the first acquisition time includes a first acquisition start time and a first acquisition end time, and the second acquisition time includes a second acquisition start time and a second acquisition end time; calculating the diameter of the motion blurred degraded convolution template according to the first acquisition time, the second acquisition time and the motion vector, including: determining the acquisition time interval between the first barcode image and the second barcode image according to the first acquisition start time, the first acquisition end time, the second acquisition start time and the second acquisition end time; calculating the diameter of the motion blurred degraded convolution template according to the acquisition time interval, the motion vector, the first acquisition end time and the second acquisition end time.
[0064] In this embodiment, based on the acquisition start time and acquisition end time of two consecutive frames of images, the acquisition time interval of the first barcode image and the second barcode image is calculated according to the following formula:
[0065] t=(et2+st2) / 2-(et1+st1) / 2
[0066] Wherein, t is the collection time interval, et2 is the second collection end time, st2 is the second collection start time, et1 is the first collection end time, and st1 is the first collection start time.
[0067] Then, the diameter of the motion blurred degraded convolution template is calculated according to the following formula:
[0068] d=V*(et2-et1) / t
[0069] Where d is the diameter of the motion blur degraded convolution template.
[0070] Optionally, based on the diameter and motion direction of the motion blur degraded convolution template, a motion blur degraded convolution template is constructed, including: determining the initial template according to the diameter of the motion blur degraded convolution template; determining the weight of each element in the initial template according to the motion direction; filling the initial template according to the weight of each element to obtain the motion blur degraded convolution template.
[0071] In this embodiment, it is necessary to first determine the type of motion blur based on the characteristics of the motion, such as whether it is uniform motion blur or non-uniform motion blur. After determining the diameter of the motion blur degraded convolution template, the initial template, including the shape and size of the template, can be defined in combination with the direction of motion. For example, if the direction of motion is horizontal, the initial template may be a horizontally extended rectangle. The weights of each element are calculated at each element position of the template. These weights reflect the degree of blur of the image at that position caused by motion. The weights usually decrease gradually along the direction of motion. The weights can be calculated using an appropriate blur model. Common models include Gaussian blur, uniform blur, etc. Finally, the weights of all elements are normalized to keep the image brightness unchanged. After filling the obtained weights into the initial template and verifying the initial template, the motion blur degraded convolution template can be obtained. Combined with Figure 5 FIG. 1 is a schematic diagram of a motion blur degraded convolution template with a diameter of 5 and uniform horizontal movement provided by an embodiment of the present disclosure. The motion blur degraded convolution template is actually a mean filter template including a direction.
[0072] Optionally, removing motion blur from the second barcode image according to the motion blur degradation convolution template includes: preprocessing the second barcode image; applying the motion blur degradation convolution template to the preprocessed second barcode image to remove motion blur from the preprocessed second barcode image.
[0073] Based on the second barcode image, the embodiment of the present disclosure provides a motion blur model:
[0074] y=k*x+n
[0075] Wherein, y is the second barcode image, k is the motion blur degraded convolution template, x is the second barcode image after removing motion blur, and n is the image noise.
[0076] In this motion blur model, the second barcode image with motion blur removed is convolved with the motion blur degraded convolution template, and then image noise is added. The resulting image is the acquired second barcode image. Therefore, by performing the inverse operation according to the motion blur model, preprocessing the second barcode image such as image noise removal, and then deconvolving it with the motion blur degraded convolution template, the second barcode image with motion blur removed can be obtained to achieve image enhancement. Finally, the obtained second barcode image with motion blur removed needs to be post-processed, including local contrast enhancement, sharpening filtering, etc., to optimize the image quality. If the deblurring effect is not ideal, it may be necessary to return to the template construction step, adjust the template parameters or algorithm, and then perform the deblurring process again.
[0077] Combination Figure 6 As shown, the embodiment of the present disclosure provides a device 300 for removing motion blur from a barcode image, including a processor 400 and a memory 401. Optionally, the device may also include a communication interface 402 and a bus 403. The processor 400, the communication interface 402, and the memory 401 may communicate with each other through the bus 403. The communication interface 402 may be used for information transmission. The processor 400 may call the logic instructions in the memory 401 to execute the method for removing motion blur from a barcode image of the above embodiment.
[0078] In addition, the logic instructions in the memory 401 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
[0079] The memory 401 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 400 executes the function application and data processing by running the program instructions / modules stored in the memory 401, that is, the method for removing motion blur from a barcode image in the above embodiment is implemented.
[0080] The memory 401 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 401 may include a high-speed random access memory and may also include a non-volatile memory.
[0081] The disclosed embodiments provide a barcode recognition device, including: a barcode recognition device body, and the above-mentioned device for removing motion blur from a barcode image. The device for removing motion blur from a barcode image is installed in the barcode recognition device body. The installation relationship described here is not limited to placement inside the barcode recognition device, but also includes installation connections with other components of the barcode recognition device, including but not limited to physical connections, electrical connections, or signal transmission connections. It can be understood by those skilled in the art that the device for removing motion blur from a barcode image can be adapted to a feasible barcode recognition device body, thereby realizing other feasible embodiments.
[0082] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned method for removing motion blur from a barcode image.
[0083] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0084] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the technical solutions recorded in this application. As used in the technical solutions recorded in this application, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0085] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0086] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0087] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for removing motion blur from a barcode image, characterized in that: include: In the same video sequence, a first barcode image and a second barcode image are acquired, and a first acquisition time of the first barcode image and a second acquisition time of the second barcode image are determined; Determine a motion vector between the first barcode image and the second barcode image based on feature-based image matching; Constructing a motion blur degradation convolution template according to the first acquisition time, the second acquisition time and the motion vector; The motion blur is removed from the second barcode image according to the motion blur degradation convolution template.
2. The method according to claim 1, characterized in that Acquiring a first barcode image and a second barcode image, including: Acquire two frames of images acquired continuously; The first frame image is used as the first barcode image, and the second frame image is used as the second barcode image; There is an overlapping area between the first barcode image and the second barcode image, and there are identifiable texture features in the overlapping area; the texture features include boundaries, center points, corner points or external contours.
3. The method according to claim 1, characterized in that Determining a motion vector between a first barcode image and a second barcode image based on feature-based image matching includes: Performing image matching on the first barcode image and the second barcode image to determine common feature points between the first barcode image and the second barcode image; Determine the coordinates of a first feature point of the common feature point in the first barcode image, and the coordinates of a second feature point of the common feature point in the second barcode image; Calculate a motion vector according to the coordinates of the first feature point and the coordinates of the second feature point; Among them, the common feature points include geometric center points, centroids, geometric centers or corner points.
4. The method according to claim 3, characterized in that Perform image matching on the first barcode image and the second barcode image according to one or more of the following methods: Shape-based matching methods; Grayscale-based matching method; Matching method based on feature descriptor; Correlation-based matching method.
5. The method according to claim 1, characterized in that: According to the first acquisition time, the second acquisition time and the motion vector, a motion blur degradation convolution template is constructed, including: Calculating the diameter of the motion blurred degraded convolution template according to the first acquisition time, the second acquisition time and the motion vector; According to the motion vector, determine the motion direction; Based on the diameter and motion direction of the motion blurred degraded convolution template, a motion blurred degraded convolution template is constructed.
6. The method according to claim 5, characterized in that The first acquisition time includes a first acquisition start time and a first acquisition end time, and the second acquisition time includes a second acquisition start time and a second acquisition end time; Calculating the diameter of the motion blurred degraded convolution template according to the first acquisition time, the second acquisition time and the motion vector, including: Determine the acquisition time interval between the first barcode image and the second barcode image according to the first acquisition start time, the first acquisition end time, the second acquisition start time and the second acquisition end time; The diameter of the motion blur degraded convolution template is calculated according to the acquisition time interval, the motion vector, the first acquisition end time, and the second acquisition end time.
7. The method according to claim 5, characterized in that Based on the diameter and motion direction of the motion blurred degraded convolution template, a motion blurred degraded convolution template is constructed, including: Determine the initial template according to the diameter of the motion blurred degraded convolution template; Determine the weight of each element in the initial template according to the direction of movement; According to the weight of each element, the initial template is filled to obtain the motion blurred degraded convolution template.
8. The method according to any one of claims 1 to 7, characterized in that: The second barcode image is subjected to motion blur removal according to the motion blur degradation convolution template, including: Preprocessing the second barcode image; The motion blur degradation convolution template is applied to the preprocessed second barcode image to remove motion blur from the preprocessed second barcode image.
9. A device for removing motion blur from a barcode image, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for removing motion blur from a barcode image according to any one of claims 1 to 8 when running the program instructions.
10. A barcode recognition device, characterized in that: include: Barcode recognition device body; The device for removing motion blur from a barcode image as claimed in claim 9 is installed on the barcode recognition device body.
