CN113449535A - Two-dimensional code scanning and identifying optimization processing method and system - Google Patents

Two-dimensional code scanning and identifying optimization processing method and system Download PDF

Info

Publication number
CN113449535A
CN113449535A CN202110799042.6A CN202110799042A CN113449535A CN 113449535 A CN113449535 A CN 113449535A CN 202110799042 A CN202110799042 A CN 202110799042A CN 113449535 A CN113449535 A CN 113449535A
Authority
CN
China
Prior art keywords
decoding
camera
setting
dimensional code
code scanning
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.)
Pending
Application number
CN202110799042.6A
Other languages
Chinese (zh)
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.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202110799042.6A priority Critical patent/CN113449535A/en
Publication of CN113449535A publication Critical patent/CN113449535A/en
Pending legal-status Critical Current

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/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • 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/1495Methods for optical code recognition the method including an image compression step

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Electromagnetism (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Studio Devices (AREA)
  • Telephone Function (AREA)

Abstract

The invention provides an optimization processing method and system for two-dimension code scanning identification, which relate to the technical field of two-dimension code scanning identification, and the method comprises the following steps: importing Android source codes of a two-dimensional code scanning library ZXing; setting a decoding format according to the source code, and optimizing a decoding algorithm; cutting the decoding data of the useless area according to the optimized decoding and a preset code scanning area; optimizing the mode of processing images by the camera, and setting the camera frame processing mode to be parallel; adjusting a camera driving mode, and setting a preview size, a picture size, a magnification factor and a focusing strategy; using the optimized decoding data, processing an image mode and a camera driving mode by a camera, and scanning and identifying the two-dimensional code; the invention can greatly improve the two-dimensional code scanning efficiency, improve the recognition success rate, has better stability and effectively improves the application experience of users.

Description

Two-dimensional code scanning and identifying optimization processing method and system
Technical Field
The invention relates to the technical field of two-dimensional code scanning and identification, in particular to an optimization processing method and system for two-dimensional code scanning and identification.
Background
At present, in the Android terminal mobile APP development process, the Android two-dimensional code scanning function is mostly realized by using native ZXing or ZBAR in a Gitlab open source community. In the function implementation process, developers often integrate simple processing of ZXing or ZBAR packages into APP for direct use directly based on official demo, and the implementation mode often has the following serious problems:
1. the scanning efficiency is seriously influenced by the Android mobile phone configuration, and a large number of scanning failure conditions can be caused by the height of mobile phone pixels; 2. the environment influence is extremely large, and poor recognition can be caused by light, reflection, dust, distance and the like; 3. when the printed label two-dimensional code is not particularly clear, for example, some pixel points are fuzzy, the overall scanning speed is reduced, and even the printing fails; 4. the scanning recognition speed is slow, the user experience is poor, and the automatic zooming function is not provided.
In summary, the implementation manner of simple integration of native ZXing or ZBar brings technical problems of low scanning efficiency, easy environmental interference, poor stability, high failure rate, poor compatibility, and the like, and a technical scheme capable of overcoming the above defects is urgently needed.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides an optimization processing method and system for two-dimensional code scanning and recognition.
The optimization processing process comprises the following steps: setting a decoding format; the decoding algorithm is optimized, the recognition speed is higher, and the recognition precision of the low-resolution image is higher; cutting invalid decoding data, cutting useless areas and reducing the data amount of decoding; the camera frame parallel processing mode is set, so that the two-dimensional code detection speed can be greatly increased; setting camera parameters, selecting the optimal preview size/picture size, and improving the identification precision; the amplification factor setting module is arranged, so that the problem of adaptation of the mobile phone is perfectly solved; and setting a focusing strategy, and increasing the analysis frequency by adopting a continuous focusing mode, so that the analysis frequency is increased by shortening the focusing time, and the code scanning performance is improved.
In a first aspect of the embodiments of the present invention, an optimization processing method for two-dimensional code scanning and identification is provided, where the method includes:
importing Android source codes of a two-dimensional code scanning library ZXing;
setting a decoding format according to the source code, and optimizing a decoding algorithm;
cutting the decoding data of the useless area according to the optimized decoding and a preset code scanning area;
optimizing the mode of processing images by the camera, and setting the camera frame processing mode to be parallel;
adjusting a camera driving mode, and setting a preview size, a picture size, a magnification factor and a focusing strategy;
and (4) carrying out two-dimensional code scanning and identification by using the optimized decoding data and the camera processing image mode and the camera driving mode.
Further, setting a decoding format according to the source code, including:
the decoding formats are set to QR Code and Code 128.
Further, the decoding algorithm is optimized, and the method comprises the following steps:
the algorithm priority in the decoding processing program is changed, GlobalHistogramBinarizer decoding is preferentially used, and the decoding is changed into hybrid Binarizer decoding when the decoding fails.
Further, optimizing the mode of processing images by the camera, setting the camera frame processing mode to be parallel, includes:
in the camera frame processing process, after acquiring one frame of data from an onPreviewFrame function, a decode task is thrown into a thread pool, and setOneShot-PreviewCallback is called to acquire the next frame of data; and if one task detects the two-dimensional code, setting the successfully detected identification variable to true, and ignoring other tasks.
Further, adjusting a camera driving mode, and setting a preview size, a picture size, a magnification factor and a focusing strategy includes:
setting a preview size, a picture size and a magnification factor according to camera parameters of the mobile terminal;
the focusing strategy is set to a continuous focusing mode.
In a second aspect of the embodiments of the present invention, an optimization processing system for two-dimensional code scanning and recognition is provided, where the system includes:
the import module is used for importing Android source codes of the two-dimensional code scanning library ZXing;
the decoding format setting module is used for setting a decoding format according to the source code;
the decoding algorithm optimizing module is used for optimizing a decoding algorithm;
the data cutting module is used for cutting the decoding data of the useless area according to the optimized decoding and a preset code scanning area;
the frame processing mode setting module is used for optimizing the mode of the camera for processing the images and setting the frame processing mode of the camera to be parallel;
the camera driving setting module is used for adjusting a camera driving mode and setting a preview size, a picture size, a magnification factor and a focusing strategy;
and the scanning identification module is used for carrying out two-dimensional code scanning identification by utilizing the optimized decoding data, the camera processing image mode and the camera driving mode.
Further, the decoding format setting module is specifically configured to:
the decoding formats are set to QR Code and Code 128.
Further, the decoding algorithm optimization module is specifically configured to:
the algorithm priority in the decoding processing program is changed, GlobalHistogramBinarizer decoding is preferentially used, and the decoding is changed into hybrid Binarizer decoding when the decoding fails.
Further, the frame processing mode setting module is specifically configured to:
in the camera frame processing process, after acquiring one frame of data from an onPreviewFrame function, a decode task is thrown into a thread pool, and setOneShot-PreviewCallback is called to acquire the next frame of data; and if one task detects the two-dimensional code, setting the successfully detected identification variable to true, and ignoring other tasks.
Further, the camera driving setting module is specifically configured to:
setting a preview size, a picture size and a magnification factor according to camera parameters of the mobile terminal;
the focusing strategy is set to a continuous focusing mode.
In a third aspect of the embodiments of the present invention, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements an optimization processing method for two-dimensional code scanning identification when executing the computer program.
In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, where a computer program is stored, and the computer program, when executed by a processor, implements an optimization processing method for two-dimensional code scanning recognition.
The two-dimensional code scanning and recognizing optimization processing method and system provided by the invention can adjust and optimize the decoding process, the image processing efficiency, the camera driving strategy and the like in the two-dimensional code scanning and recognizing process, and greatly improve the two-dimensional code scanning efficiency and the recognition success rate by reducing the decoding format, optimizing the decoding algorithm, reducing the decoding data, changing the frame processing serial into parallel, optimizing the camera setting and setting the proper amplification factor and focusing factor, thereby having better stability and effectively improving the application experience of users.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of an optimization processing method for two-dimensional code scanning and recognition according to an embodiment of the present invention.
Fig. 2 is a schematic code diagram for setting a decoding format according to an embodiment of the present invention.
FIG. 3 is a code diagram of decoding algorithm optimization according to an embodiment of the present invention.
FIG. 4 is a code diagram of reducing invalid decoded data according to an embodiment of the present invention.
Fig. 5A and 5B are schematic diagrams of codes for setting a camera frame processing mode according to an embodiment of the invention.
FIG. 6 is a code diagram of optimizing camera settings according to an embodiment of the present invention.
Fig. 7A and 7B are code diagrams illustrating setting suitable magnification according to an embodiment of the present invention.
FIG. 8A is a code diagram of setting a continuous focusing mode according to an embodiment of the present invention.
FIG. 8B is a code diagram for setting a focusing strategy according to an embodiment of the present invention.
Fig. 9 is a schematic diagram of an architecture of an optimization processing system for two-dimensional code scanning identification according to an embodiment of the present invention.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, an optimization processing method and system for two-dimensional code scanning and recognition are provided, and the method and system relate to the technical field of two-dimensional code scanning and recognition. The optimization processing process comprises the following steps: setting a decoding format, and mainly aiming at two most main formats, namely QR Code and Code 128; the decoding algorithm is optimized, the recognition speed is higher, and the recognition precision of the low-resolution image is higher; cutting invalid decoding data, cutting useless areas and reducing the data amount of decoding; the camera frame parallel processing mode is set, so that the two-dimensional code detection speed can be greatly increased; setting camera parameters, selecting the optimal preview size/picture size, and improving the identification precision; the amplification factor setting module is arranged, so that the problem of adaptation of the mobile phone is perfectly solved; and setting a focusing strategy, and increasing the analysis frequency by adopting a continuous focusing mode, so that the analysis frequency is increased by shortening the focusing time, and the code scanning performance is improved.
In the embodiments of the present invention, terms to be described include:
two-dimensional code: the coding mode widely used on the mobile equipment can store more information and represent more data types than the traditional Bar Code Bar Code;
QR Code: a matrix two-dimensional code symbol has the advantages of large information capacity, high reliability, capability of representing various character information of Chinese characters and images, strong security and anti-counterfeiting performance and the like of a one-dimensional bar code and other two-dimensional bar codes.
Code 128: one high density barcode, CODE128 CODE, can represent 128 characters from ASCII 0 to ASCII 127, and is called 128 CODE. Including numeric, alphabetic, and symbolic characters.
Zbar: the zbar algorithm is a bar CODE which is open on the internet at present, and is a two-dimensional CODE detection algorithm, and the algorithm can identify most kinds of one-dimensional CODEs (bar CODEs), such as I25, CODE 39 and CODE 128.
ZXing: ZXing is an open source, 1D/2D barcode image processing library implemented in Java in a variety of formats, which contains ports for linking to other languages. ZXing can realize that the built-in camera of the mobile phone is used for scanning and decoding the bar code.
ZXing provides two binarization algorithms in total, one is a hybrid Binarizer, and the other is a GlobalHistogramBinarizer;
the hybrid Binarizer algorithm uses a higher-level algorithm, and the operation requirement is higher; the globalprostagrbinarizer recognition rate is higher.
The GlobalHistogramBinarizer algorithm is suitable for low-end equipment, and has low requirements on a CPU and a memory of a mobile phone; this algorithm chooses all black points to compute and therefore cannot handle both shadow and fade cases.
The hybrid binary algorithm is slower in execution efficiency than the globalprostumgrammbinary algorithm, but the identification is relatively more effective, and the selection method is specially designed for analyzing the continuous black block two-dimensional code image with white as the background and is more suitable for analyzing the two-dimensional code image with serious shadow and gradual change.
And (3) decoding: and (3) restoring the digital code into the content, information and data represented by the digital code by a specific method.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Fig. 1 is a schematic flow chart of an optimization processing method for two-dimensional code scanning and recognition according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step S101, importing Android source codes of a two-dimensional code scanning library ZXing;
step S102, setting a decoding format according to the source code, and optimizing a decoding algorithm;
step S103, cutting the decoding data of the useless area according to the optimized decoding and a preset code scanning area;
step S104, optimizing the mode of the camera for processing the images, and setting the camera frame processing mode to be parallel;
step S105, adjusting a camera driving mode, and setting a preview size, a picture size, a magnification factor and a focusing strategy;
and step S106, carrying out two-dimensional code scanning and identification by using the optimized decoding data and the camera processing image mode and the camera driving mode.
In order to explain the optimization processing method of the two-dimensional code scanning recognition more clearly, each step is described in detail below.
And S101, importing Android source codes of a two-dimensional code scanning library ZXing.
And S102, setting a decoding format according to the source code, and optimizing a decoding algorithm.
Wherein, the decoding formats are set as QR Code and Code 128.
The algorithm priority in the decoding processing program is changed, GlobalHistogramBinarizer decoding is preferentially used, and the decoding is changed into hybrid Binarizer decoding when the decoding fails.
And step S103, cutting the decoding data of the useless area according to the optimized decoding and a preset code scanning area.
And step S104, optimizing the mode of the camera for processing the images, and setting the camera frame processing mode to be parallel.
In the camera frame processing process, after acquiring one frame of data from an onPreviewFrame function, a decode task is thrown into a thread pool, and setOneShot-PreviewCallback is called to acquire the next frame of data; if one task detects the two-dimensional code, setting the isSuccess (detection success identification) variable to true, and ignoring other tasks.
And step S105, adjusting a camera driving mode, and setting a preview size, a picture size, a magnification factor and a focusing strategy.
Setting a preview size, a picture size and a magnification factor according to camera parameters of the mobile terminal;
the focusing strategy is set to a continuous focusing mode.
And step S106, carrying out two-dimensional code scanning and identification by using the optimized decoding data and the camera processing image mode and the camera driving mode.
According to the optimization processing method for the two-dimensional code scanning recognition, the decoding process, the image processing efficiency, the camera driving strategy and the like are adjusted and optimized, the decoding format can be reduced, the decoding algorithm is optimized, the decoding data is reduced, the frame processing serial is changed into parallel, the camera setting is optimized, the proper amplification factor and focusing factor are set, the two-dimensional code scanning efficiency is greatly improved, the recognition success rate is improved, good customer experience is achieved, the hardware compatibility is improved, and through the project comprehensive test, after the specific implementation scheme of the algorithm is adopted, the android two-dimensional code scanning success rate is increased to 99.8%, the scanning speed is increased by 60%, and the stability is excellent.
It should be noted that although the operations of the method of the present invention have been described in the above embodiments and the accompanying drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the operations shown must be performed, to achieve the desired results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
In order to explain the optimization processing method of the two-dimensional code scanning identification more clearly, a specific embodiment is described below.
The optimization processing method for two-dimensional code scanning recognition provided by the invention mainly performs customized optimization on ZXing through three aspects of a decoding process, image processing efficiency and a camera driving strategy, and improves the success rate and processing efficiency of two-dimensional code scanning recognition. Wherein, the main process is as follows:
1. the decoding format is reduced.
Fig. 2 is a schematic code diagram for setting a decoding format according to an embodiment of the present invention.
Since ZXing supports 15 formats by default, but does not actually use so many decoding patterns, it is mainly implemented for the two most dominant formats QR Code and Code 128.
2. And optimizing a decoding algorithm.
Referring to fig. 3, a code diagram of decoding algorithm optimization according to an embodiment of the present invention is shown.
The algorithm is changed in decoderhandler (decode handler), globalsistogrammbinarizer decoding is prioritized, and decoding failure is transferred to hybrid binarizer decoding.
3. Invalid decoded data is reduced.
Referring to fig. 4, a code diagram for reducing invalid decoded data according to an embodiment of the present invention is shown.
In the development process, the code scanning area can be adjusted, the useless area can be cut, and the data size of decoding can be reduced.
4. The processing of the camera frames is changed from serial to parallel.
Referring to fig. 5A and 5B, there are shown code diagrams for setting a camera frame processing mode according to an embodiment of the invention.
Acquiring one frame of data from onPreviewFrame (), dropping the decode task into the thread pool, and immediately calling setOneShot-PreviewCallback () to acquire the next frame of data.
When a certain task detects a two-dimensional code, immediately setting an isSuccess variable as true, and ignoring other tasks; therefore, the speed of detecting the two-dimensional code can be greatly accelerated.
5. The camera settings are optimized.
Referring to fig. 6, a code diagram for optimizing camera settings according to an embodiment of the invention is shown.
And selecting the optimal preview size and picture size.
6. Setting the appropriate magnification.
Referring to fig. 7A and 7B, schematic code diagrams for setting suitable magnification according to an embodiment of the present invention are shown.
According to the camera parameters of the mobile terminal, setting one-N of the pick-and-place large multiple value as the current amplification factor, and overcoming the adaptation problem of the mobile terminal.
7. And setting a reasonable focusing strategy.
Referring to fig. 8A, a code diagram for setting a continuous focusing mode according to an embodiment of the invention is shown.
And adopting a continuous focusing mode to improve the resolution frequency.
Further, referring to fig. 8B, a code diagram for setting a focusing strategy according to an embodiment of the invention is shown. Not only needs to realize focusing mode calibration through an algorithm, but also needs to realize a focusing strategy; and the auxiliary selection touch area focuses, and the double fingers zoom the focusing times.
Wherein items 1-3 are used to optimize the decoding process; step 4, optimizing the image processing mode of the camera; items 5-7 are used to optimize the camera drive mode. Through reducing the decoding format, optimizing the decoding algorithm, reducing the decoding data, frame processing serial changes into parallel, optimize the camera setting, set up suitable magnification and the multiple of focusing, promote two-dimensional code scanning efficiency by a wide margin, improve the discernment success rate to possess good customer experience, improve algorithm compatibility, through the comprehensive test of project, adopt this algorithm after the tall and erect two-dimensional code of ann scan success rate rise to 99.8%, and scanning speed promotes 60%, stability is splendid.
Having described the method of the exemplary embodiment of the present invention, an optimization processing system for two-dimensional code scanning recognition of the exemplary embodiment of the present invention will be described with reference to fig. 9.
The implementation of the two-dimensional code scanning and identifying optimization processing system can refer to the implementation of the above method, and repeated details are not repeated. The term "module" or "unit" used hereinafter may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Based on the same inventive concept, the invention also provides an optimization processing system for two-dimensional code scanning and recognition, as shown in fig. 9, the system comprises:
the importing module 910 is configured to import an Android source code of the two-dimensional code scanning library ZXing;
a decoding format setting module 920, configured to set a decoding format according to the source code;
a decoding algorithm optimizing module 930 for optimizing the decoding algorithm;
a data clipping module 940, configured to clip decoded data of the useless region according to the optimized decoding and according to a preset code scanning region;
a frame processing mode setting module 950 for optimizing the mode of the camera for processing the image and setting the camera frame processing mode to be parallel;
a camera driving setting module 960, configured to adjust a camera driving manner, and set a preview size, a picture size, a magnification factor, and a focusing strategy;
and a scanning recognition module 970, configured to perform two-dimensional code scanning recognition by using the optimized decoded data, the camera processing image mode, and the camera driving mode.
In this embodiment, the decoding format setting module 920 is specifically configured to:
the decoding formats are set to QR Code and Code 128.
In this embodiment, the decoding algorithm optimizing module 930 is specifically configured to:
the algorithm priority in the decoding processing program is changed, GlobalHistogramBinarizer decoding is preferentially used, and the decoding is changed into hybrid Binarizer decoding when the decoding fails.
In this embodiment, the frame processing mode setting module 950 is specifically configured to:
in the camera frame processing process, after acquiring one frame of data from an onPreviewFrame function, a decode task is thrown into a thread pool, and setOneShot-PreviewCallback is called to acquire the next frame of data; and if one task detects the two-dimensional code, setting the isSuccess variable to true, and ignoring other tasks.
In this embodiment, the camera driving setting module 960 is specifically configured to:
setting a preview size, a picture size and a magnification factor according to camera parameters of the mobile terminal;
the focusing strategy is set to a continuous focusing mode.
It should be noted that although several modules of the optimization processing system for two-dimensional code scan recognition are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the modules described above may be embodied in one module according to embodiments of the invention. Conversely, the features and functions of one module described above may be further divided into embodiments by a plurality of modules.
Based on the aforementioned inventive concept, as shown in fig. 10, the present invention further provides a computer device 100, which includes a memory 110, a processor 120, and a computer program 130 stored in the memory 110 and executable on the processor 120, wherein the processor 120 implements the aforementioned two-dimensional code scanning recognition optimization processing method when executing the computer program 130.
Based on the foregoing inventive concept, the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the foregoing optimization processing method for two-dimensional code scanning recognition.
The two-dimensional code scanning and recognizing optimization processing method and system provided by the invention can adjust and optimize the decoding process, the image processing efficiency, the camera driving strategy and the like in the two-dimensional code scanning and recognizing process, and greatly improve the two-dimensional code scanning efficiency and the recognition success rate by reducing the decoding format, optimizing the decoding algorithm, reducing the decoding data, changing the frame processing serial into parallel, optimizing the camera setting and setting the proper amplification factor and focusing factor, thereby having better stability and effectively improving the application experience of users.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. An optimization processing method for two-dimensional code scanning and identification is characterized by comprising the following steps:
importing Android source codes of a two-dimensional code scanning library ZXing;
setting a decoding format according to the source code, and optimizing a decoding algorithm;
cutting the decoding data of the useless area according to the optimized decoding and a preset code scanning area;
optimizing the mode of processing images by the camera, and setting the camera frame processing mode to be parallel;
adjusting a camera driving mode, and setting a preview size, a picture size, a magnification factor and a focusing strategy;
and (4) carrying out two-dimensional code scanning and identification by using the optimized decoding data and the camera processing image mode and the camera driving mode.
2. The method of claim 1, wherein the setting of the decoding format according to the source code comprises:
the decoding formats are set to QR Code and Code 128.
3. The two-dimensional code scanning and recognizing optimization processing method according to claim 1, wherein the optimization of the decoding algorithm comprises:
the algorithm priority in the decoding processing program is changed, GlobalHistogramBinarizer decoding is preferentially used, and the decoding is changed into hybrid Binarizer decoding when the decoding fails.
4. The optimization processing method for two-dimensional code scanning recognition according to claim 1, wherein the optimizing the mode of the camera for processing the image sets the camera frame processing mode to be parallel, and the optimizing processing method comprises:
in the camera frame processing process, after acquiring one frame of data from an onPreviewFrame function, a decode task is thrown into a thread pool, and setOneShot-PreviewCallback is called to acquire the next frame of data; and if one task detects the two-dimensional code, setting the successfully detected identification variable to true, and ignoring other tasks.
5. The optimization processing method of two-dimensional code scanning recognition according to claim 1, wherein adjusting a camera driving mode and setting a preview size, a picture size, a magnification factor and a focusing strategy comprises:
setting a preview size, a picture size and a magnification factor according to camera parameters of the mobile terminal;
the focusing strategy is set to a continuous focusing mode.
6. An optimization processing system for two-dimensional code scanning identification is characterized by comprising:
the import module is used for importing Android source codes of the two-dimensional code scanning library ZXing;
the decoding format setting module is used for setting a decoding format according to the source code;
the decoding algorithm optimizing module is used for optimizing a decoding algorithm;
the data cutting module is used for cutting the decoding data of the useless area according to the optimized decoding and a preset code scanning area;
the frame processing mode setting module is used for optimizing the mode of the camera for processing the images and setting the frame processing mode of the camera to be parallel;
the camera driving setting module is used for adjusting a camera driving mode and setting a preview size, a picture size, a magnification factor and a focusing strategy;
and the scanning identification module is used for carrying out two-dimensional code scanning identification by utilizing the optimized decoding data, the camera processing image mode and the camera driving mode.
7. The optimization processing system for two-dimensional code scanning recognition according to claim 6, wherein the decoding format setting module is specifically configured to:
the decoding formats are set to QR Code and Code 128.
8. The optimization processing system for two-dimensional code scanning identification according to claim 6, wherein the decoding algorithm optimization module is specifically configured to:
the algorithm priority in the decoding processing program is changed, GlobalHistogramBinarizer decoding is preferentially used, and the decoding is changed into hybrid Binarizer decoding when the decoding fails.
9. The optimization processing system for two-dimensional code scanning identification according to claim 6, wherein the frame processing mode setting module is specifically configured to:
in the camera frame processing process, after acquiring one frame of data from an onPreviewFrame function, a decode task is thrown into a thread pool, and setOneShot-PreviewCallback is called to acquire the next frame of data; and if one task detects the two-dimensional code, setting the successfully detected identification variable to true, and ignoring other tasks.
10. The optimization processing system for two-dimensional code scanning recognition according to claim 6, wherein the camera driving setting module is specifically configured to:
setting a preview size, a picture size and a magnification factor according to camera parameters of the mobile terminal;
the focusing strategy is set to a continuous focusing mode.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 5 when executing the computer program.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any of claims 1 to 5.
CN202110799042.6A 2021-07-15 2021-07-15 Two-dimensional code scanning and identifying optimization processing method and system Pending CN113449535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110799042.6A CN113449535A (en) 2021-07-15 2021-07-15 Two-dimensional code scanning and identifying optimization processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110799042.6A CN113449535A (en) 2021-07-15 2021-07-15 Two-dimensional code scanning and identifying optimization processing method and system

Publications (1)

Publication Number Publication Date
CN113449535A true CN113449535A (en) 2021-09-28

Family

ID=77816279

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110799042.6A Pending CN113449535A (en) 2021-07-15 2021-07-15 Two-dimensional code scanning and identifying optimization processing method and system

Country Status (1)

Country Link
CN (1) CN113449535A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115329795A (en) * 2022-10-17 2022-11-11 北京搜狐新动力信息技术有限公司 Method and device for identifying two-dimensional code
CN115375625A (en) * 2022-07-25 2022-11-22 北京数美时代科技有限公司 Two-dimensional code detection decoding method, system, electronic device and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115375625A (en) * 2022-07-25 2022-11-22 北京数美时代科技有限公司 Two-dimensional code detection decoding method, system, electronic device and medium
CN115329795A (en) * 2022-10-17 2022-11-11 北京搜狐新动力信息技术有限公司 Method and device for identifying two-dimensional code

Similar Documents

Publication Publication Date Title
CN113449535A (en) Two-dimensional code scanning and identifying optimization processing method and system
US20140097246A1 (en) Method and device for batch scanning 2d barcodes
JP5262869B2 (en) Image processing system, image processing server, MFP, and image processing method
JP4192847B2 (en) Code reader and program
US20130153662A1 (en) Barcode Photo-image Processing System
CN102880849A (en) Two-dimension code recognition method and device
US10650204B2 (en) Barcode detection method and barcode detection system for increasing detection efficiency by using gray level flip counts
CA2709006A1 (en) Systems and methods for animating barcodes
WO2009106518A1 (en) Method and arrangement for retrieving information comprised in a barcode
US20230037838A1 (en) Method of optically reading information code and control of the method
CN109598162A (en) Identify method, apparatus, terminal device and the storage medium of two dimensional code
CN111476053B (en) Identification method and device
US8100339B2 (en) Preamble data generating method and related apparatus for quick response code
CN111507122A (en) Graphic code identification method and device, storage medium and terminal
CN105824701A (en) Identification code scanning method and system
CN111539236A (en) Method for reading multiple bar codes at one time
JP5358384B2 (en) Optical information reading apparatus and imaging condition setting method thereof
JP5673257B2 (en) Code reading apparatus, code reading method and code reading program
US20130314755A1 (en) Image capture device for extracting textual information
CN101556618A (en) Streaming media playing method and terminal thereof
CN111611788B (en) Data processing method and device, electronic equipment and storage medium
TWI399963B (en) Two dimensional barcode recognition system on mobile phone
US8908970B2 (en) Textual information extraction method using multiple images
Jiang et al. Batch Reading densely arranged QR codes
WO2010055795A1 (en) Method and device for reading optical automatic-recognition code

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