CN112241642A - Two-dimensional code identification method, device, equipment and storage medium - Google Patents

Two-dimensional code identification method, device, equipment and storage medium Download PDF

Info

Publication number
CN112241642A
CN112241642A CN201910656705.1A CN201910656705A CN112241642A CN 112241642 A CN112241642 A CN 112241642A CN 201910656705 A CN201910656705 A CN 201910656705A CN 112241642 A CN112241642 A CN 112241642A
Authority
CN
China
Prior art keywords
dimensional code
code image
image
identified
images
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910656705.1A
Other languages
Chinese (zh)
Other versions
CN112241642B (en
Inventor
李云廷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910656705.1A priority Critical patent/CN112241642B/en
Publication of CN112241642A publication Critical patent/CN112241642A/en
Application granted granted Critical
Publication of CN112241642B publication Critical patent/CN112241642B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/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/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10712Fixed beam scanning
    • G06K7/10722Photodetector array or CCD scanning
    • G06K7/10732Light sources
    • 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
    • G06K7/1491Methods for optical code recognition the method including quality enhancement steps the method including a reconstruction step, e.g. stitching two pieces of bar code together to derive the full bar code

Landscapes

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

Abstract

The invention provides a method, a device, equipment and a storage medium for identifying a two-dimensional code. The method comprises the following steps: when a two-dimension code scanning mode is started, a flash lamp triggering instruction is obtained and used for triggering the flash lamp to be turned on and turned off gradually, in the process that the flash lamp is turned on and turned off gradually, image acquisition is carried out on the two-dimension code to be recognized, at least two-dimension code images are obtained, two-dimension code recognition is carried out on the at least two-dimension code images, and a recognition result is obtained, wherein the recognition result comprises content or operation corresponding to the two-dimension code to be recognized, the two-dimension code is recognized quickly and accurately under the condition that a user does not need to manually adjust the angle of the terminal device, convenience is improved, and user experience is improved.

Description

Two-dimensional code identification method, device, equipment and storage medium
Technical Field
The present invention relates to the field of two-dimension code identification control, and in particular, to a method, an apparatus, a device, and a storage medium for identifying a two-dimension code.
Background
With the continuous popularization of terminal devices, information is acquired through a two-dimensional code and actual application operation is more and more frequent, and the two-dimensional code is widely applied to various scenes, such as payment, login, information inquiry, information sharing and the like, so that how to accurately and quickly complete two-dimensional code scanning and identification becomes more important.
In the prior art, when a two-dimensional code is scanned at night or in an environment with weak ambient light, an additional light source is needed to improve the recognition rate of the two-dimensional code, for example, the light source provided by the terminal device itself, such as a flash lamp installed on the terminal device, or a light source provided by other devices, illuminates the two-dimensional code, so that the two-dimensional code is easier to recognize.
However, the light source is provided through other devices, which means that the user needs to carry more light source devices, the convenience is poor, and when the light source provided through the terminal device itself illuminates the two-dimensional code, a light reflection spot can be generated on the two-dimensional code image, when the light reflection spot is too large, the two-dimensional code is still difficult to be identified, the angle and the position of the user to adjust the scanning many times are needed to reduce the influence of the light reflection spot, and thus, the scheme in the prior art can cause the user to have poor convenience when scanning the two-dimensional code, and the user experience is poor.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for identifying a two-dimensional code, which are convenient and quick to identify under the condition that the two-dimensional code needs to be identified at night or when ambient light is weak.
In a first aspect, the present invention provides a method for identifying a two-dimensional code, including:
when a two-dimensional code scanning mode is started, a flash lamp triggering instruction is obtained; the flash lamp triggering instruction is used for triggering the flash lamp to be lightened and gradually extinguished;
in the process that the flash lamp is turned on and gradually turned off, image acquisition is carried out on the two-dimension code to be recognized, and at least two-dimension code images are obtained;
and performing two-dimension code recognition on the at least two-dimension code images to obtain a recognition result, wherein the recognition result comprises the content or operation corresponding to the two-dimension code to be recognized.
In a possible implementation manner, the performing two-dimensional code recognition on the at least two-dimensional code images to obtain a recognition result includes:
traversing and identifying each two-dimension code image in the at least two-dimension code images;
and if the first two-dimensional code image exists in the at least two-dimensional code images and can be identified, obtaining the identification result according to the first two-dimensional code image.
Further, the method further comprises:
if the at least two-dimension code images can not be identified, acquiring a non-reflection area image in each two-dimension code image;
superposing the non-reflective area images of each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
In a possible implementation manner, the performing two-dimensional code recognition on the at least two-dimensional code images includes:
sequentially identifying the at least two-dimension code images according to a preset sequence;
if the current two-dimensional code image can be identified, acquiring the identification result according to the current two-dimensional code image, and ending the identification process, otherwise, if the current two-dimensional code image cannot be identified, acquiring a non-reflective area image in the current two-dimensional code image, identifying the next two-dimensional code image according to the preset sequence, and repeating the step until all the at least two-dimensional code images are processed;
superposing the non-reflective area images corresponding to each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
In a specific implementation manner, the second two-dimensional code image includes a plurality of pixel points, and the superimposing processing is performed on the non-reflective area image in each two-dimensional code image to obtain the second two-dimensional code image, including:
calculating the gray value of each pixel point in the non-reflective area of the second two-dimensional code image according to at least two non-reflective area images;
and acquiring the average value of the gray value of each pixel point in the non-reflection area of the second two-dimensional code image, and taking the average value as the gray value of each pixel point in the reflection area of the second two-dimensional code image.
Specifically, the method further comprises:
acquiring a two-dimensional code area and a light reflecting area of a two-dimensional code image;
determining whether the reflective area is smaller than a preset value;
if the reflecting area is smaller than a preset value, decoding the content of the two-dimensional code area to determine whether the two-dimensional code image can be identified;
and if the light reflecting area is larger than or equal to the preset value, determining that the two-dimensional code image cannot be identified.
Further, the decoding the content of the two-dimensional code area to determine whether the two-dimensional code image can be identified includes:
if the two-dimensional code area is successfully decoded, determining that the two-dimensional code image can be identified;
and if the two-dimensional code area is failed to be decoded, determining that the two-dimensional code image cannot be identified.
Optionally, the method further includes:
if the second two-dimensional code image fails to be identified, generating prompt information and pushing the prompt information; the prompt information is used for prompting: and adjusting the position or angle of scanning, or adjusting the time for which the flash lamp is turned on and off, and then rescanning.
In a second aspect, the present invention provides an apparatus for recognizing a two-dimensional code, the apparatus comprising:
the acquisition module is used for acquiring a flash lamp trigger instruction after the two-dimensional code scanning mode is started; the flash lamp triggering instruction is used for triggering the flash lamp to be lightened and gradually extinguished;
the acquisition module is used for acquiring images of the two-dimensional code to be recognized in the process of lighting and gradually turning off the flash lamp to acquire at least two-dimensional code images;
and the processing module is used for carrying out two-dimension code identification on the at least two-dimension code images to obtain an identification result, wherein the identification result comprises the content or operation corresponding to the two-dimension code to be identified.
In a specific implementation manner, the processing module is specifically configured to:
traversing and identifying each two-dimension code image in the at least two-dimension code images;
and if the first two-dimensional code image exists in the at least two-dimensional code images and can be identified, obtaining the identification result according to the first two-dimensional code image.
Further, the processing module is specifically configured to:
if the at least two-dimension code images can not be identified, acquiring a non-reflection area image in each two-dimension code image;
superposing the non-reflective area images of each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
In a specific implementation manner, the processing module is specifically configured to:
sequentially identifying the at least two-dimension code images according to a preset sequence;
if the current two-dimensional code image can be identified, acquiring the identification result according to the current two-dimensional code image, and ending the identification process, otherwise, if the current two-dimensional code image cannot be identified, acquiring a non-reflective area image in the current two-dimensional code image, identifying the next two-dimensional code image according to the preset sequence, and repeating the step until all the at least two-dimensional code images are processed;
superposing the non-reflective area images corresponding to each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
In a specific implementation manner, the processing module is specifically configured to:
calculating the gray value of each pixel point in the non-reflective area of the second two-dimensional code image according to at least two non-reflective area images;
and acquiring the average value of the gray value of each pixel point in the non-reflection area of the second two-dimensional code image, and taking the average value as the gray value of each pixel point in the reflection area of the second two-dimensional code image.
In particular, the method comprises the following steps of,
the acquisition module is also used for acquiring a two-dimensional code area and a light reflection area of the two-dimensional code image;
the processing module is further configured to:
determining whether the reflective area is smaller than a preset value;
if the reflecting area is smaller than a preset value, decoding the content of the two-dimensional code area to determine whether the two-dimensional code image can be identified;
and if the light reflecting area is larger than or equal to the preset value, determining that the two-dimensional code image cannot be identified.
Further, the processing module is specifically configured to:
if the two-dimensional code area is successfully decoded, determining that the two-dimensional code image can be identified;
and if the two-dimensional code area is failed to be decoded, determining that the two-dimensional code image cannot be identified.
Optionally, the processing module is further configured to:
if the second two-dimensional code image fails to be identified, generating prompt information and pushing the prompt information; the prompt information is used for prompting: and adjusting the position or angle of scanning, or adjusting the time for which the flash lamp is turned on and off, and then rescanning.
In a third aspect, the present invention provides a terminal device, including: a memory and a processor;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored in the memory, so that the processor executes the two-dimensional code identification method according to the first aspect.
In a fourth aspect, the present invention provides a storage medium comprising: a readable storage medium and a computer program for implementing the two-dimensional code recognition method according to the first aspect.
The invention provides a method, a device, equipment and a storage medium for identifying two-dimensional codes, which are characterized in that after a two-dimensional code scanning mode is started, a flash lamp trigger instruction is obtained and used for triggering the flash lamp to be turned on and gradually turned off, in the process of turning on and gradually turning off the flash lamp, the two-dimensional code to be identified is subjected to image acquisition, at least two-dimensional code images are obtained, the two-dimensional code images are subjected to two-dimensional code identification, and an identification result is obtained, wherein the identification result comprises the content or operation corresponding to the two-dimensional code to be identified. The method has the advantages that the recognition result of any two-dimension code image which can be recognized is obtained, the influence of a light reflecting area caused by light reflecting spots on two-dimension code recognition can be automatically overcome, the problem that in the prior art, convenience in two-dimension code scanning is poor when light at night or around is weak is solved without adjusting scanning angles and positions for many times by a user, and user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1-a-1, fig. 1-a-2, and fig. 1-a-3 are schematic structural diagrams of a two-dimensional code according to an embodiment of the present invention;
fig. 1-b is a schematic structural diagram of a two-dimensional code according to an embodiment of the present invention;
fig. 1-c is a schematic structural diagram of a two-dimensional code according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a first embodiment of a method for identifying a two-dimensional code according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a change of flash lamp intensity with time in a method for identifying a two-dimensional code according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a second embodiment of a method for identifying a two-dimensional code according to the present invention;
fig. 5 is a schematic flowchart of a third embodiment of a method for identifying a two-dimensional code according to the present invention;
fig. 6 is a schematic flowchart of a fourth embodiment of a method for identifying a two-dimensional code according to the present invention;
fig. 7 is a schematic flowchart of a fifth embodiment of a method for identifying a two-dimensional code according to the present invention;
fig. 8 is a schematic structural diagram of a first two-dimensional code recognition apparatus according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As used herein, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Reference throughout this specification to "one embodiment" or "another embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in this embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The two-dimensional code to be identified in the invention includes but is not limited to the following three types: 1. a two-dimensional code (DM) code as shown in fig. 1-a-1, 1-a-2 and 1-a-3, a structure of the DM code including a position detection pattern as shown in fig. 1-a-1 and 1-a-2 and a Data area as shown in fig. 1-a-3; 2. a two-dimensional (QR) code as shown in fig. 1-b, in summary, the symbol of the QR code is composed of the following parts: a quiet zone, a position detection pattern, a correction pattern (there is version without this part), a reference grid, version information, format information, and a data zone, wherein the number of black dots on the reference grid is referred to as the version number of the QR code, and the QR code has 40 versions, and the constituent parts of each version are slightly different; 3. the two-dimensional Code (Maxi Code) shown in fig. 1-c is a two-dimensional Code with a fixed size, a fixed data capacity and a fixed data arrangement order, and is composed of a position detection pattern, a direction correction pattern, a data area, a reservation module, and a dead zone. Unlike other two-dimensional codes, in which the shape of the smallest module is a hexagon, it will be understood by those skilled in the art that the position of the two-dimensional code can be determined by the position detection pattern of the two-dimensional code, information of the two-dimensional code is acquired by identifying the data area of the two-dimensional code, and different classes of two-dimensional codes have different data verification capabilities, for example, a DM code can be successfully identified when about 40% of the information is lost, and a QR code can be successfully identified when about 30% of the information is lost.
Based on the above information, the present invention provides a method for identifying a two-dimensional code, so that the two-dimensional code to be identified can be identified quickly and accurately at night or in a dark environment, which is described below with reference to several specific embodiments.
Fig. 2 is a schematic flow chart of a first embodiment of a method for identifying a two-dimensional code according to an embodiment of the present invention, where an execution main body of the present invention is a terminal device with a flash lamp and an image capture device, for example, an electronic device with an image capture function, such as a personal computer PC, a notebook, a tablet, a wearable product, an intelligent home appliance, and an intelligent robot, as shown in fig. 2, the method includes:
s1: and when the two-dimension code scanning mode is started, acquiring a flash lamp triggering instruction.
As will be understood by those skilled in the art, when a two-dimensional code needs to be scanned, the terminal device may start the two-dimensional code scanning mode by receiving an instruction input by a user, or start the two-dimensional code scanning mode by invoking other modules, so as to identify the two-dimensional code to be identified.
In this step, in the using process, a user can align a camera of the terminal device with the two-dimensional code to be recognized, and then obtain a flash lamp trigger instruction, where the flash lamp trigger instruction is used to trigger the flash lamp to be turned on and gradually turned off, and preferably, the terminal device controls the flash lamp to be instantly turned on according to the flash lamp trigger instruction and gradually turned off within 1 to 2 seconds, fig. 3 is a schematic diagram of the change of the flash lamp intensity with time in the two-dimensional code recognition method provided by the embodiment of the present invention, and fig. 3 is a schematic diagram of the change of the flash lamp intensity with time in the process of turning on the flash lamp to gradually turn off the flash lamp.
In the specific implementation of the scheme, the specific modes for acquiring the flash lamp trigger instruction at least include the following modes:
in the first mode, a flash trigger instruction input by a user is received, for example, a flash control selected by the user through a human-computer interaction interface is received, or a flash trigger instruction input by the user according to a preset screen trigger mode (for example, double-click, finger joint touch, stroke and the like) is received.
In the second mode, a flash lamp trigger instruction input by a user according to a preset key operation mode (for example, long-time pressing of a volume key and the like) is received.
In a third mode, the flash lamp trigger instruction may be generated according to a preset condition, for example, the flash lamp trigger instruction is generated when the acquisition device of the terminal device is positioned to the two-dimensional code through the position detection pattern of the two-dimensional code, and for example, the flash lamp trigger instruction is generated after the two-dimensional code scanning mode is started for 3 seconds.
S2: and in the process of lightening and gradually extinguishing the flash lamp, carrying out image acquisition on the two-dimension code to be identified, and acquiring at least two-dimension code images.
In this step, it should be understood that, in the process that the flash lamp is turned on and gradually turned off, the flash lamp irradiates the two-dimensional code, a light reflection spot, that is, a light reflection region, is formed on the two-dimensional code, the size of the light reflection region is maximized after the flash lamp is instantly turned on, the light reflection region gradually decreases in the process of gradually turning off, along with the change of the brightness of the flash lamp, the terminal controls its own image acquisition device, for example, the camera performs image acquisition on the two-dimensional code to be recognized, may perform image acquisition according to a preset acquisition frequency, may perform image acquisition according to a preset acquisition time point, may perform corresponding image acquisition according to a preset flash lamp brightness value, and the setting of the time interval should take into account the frame rate setting of the acquisition device itself.
Due to the irradiation of the flash lamp, the at least two collected two-dimensional code images have light reflecting areas with different degrees in the two-dimensional code areas, and the areas outside the light reflecting areas are non-light reflecting areas, so that the at least two collected two-dimensional code images all comprise the light reflecting areas and the non-light reflecting areas.
S3: and carrying out two-dimensional code recognition on the at least two-dimensional code images to obtain a recognition result.
In this step, the two-dimensional code recognition is performed on at least two-dimensional code images, so that a recognition result can be obtained, specifically, each two-dimensional code image can be subjected to the two-dimensional code recognition, a decoding result of any two-dimensional code image which can be recognized is obtained, and the decoding result is used as the recognition result.
Further, before decoding according to the two-dimensional code graph, whether the two-dimensional code graph is decoded or not needs to be confirmed according to the size of a light reflecting area in the two-dimensional code graph, if the size of the light reflecting area in the current two-dimensional code graph is larger than or equal to a preset value, it is determined that the two-dimensional code graph cannot be recognized, if the size of the light reflecting area in the current two-dimensional code graph is smaller than the preset value, the two-dimensional code graph is decoded, and then, if the decoding is successful, an identification result is obtained, and if the decoding is failed, it is determined that the current two-dimensional code graph cannot be recognized.
The two-dimensional code image can be identified when the information loss caused by the reflection area of any one of the at least two-dimensional code images does not exceed the information loss which can be overcome by the two-dimensional code to be identified, and then the non-reflection area in the two-dimensional code image is decoded to obtain an identification result.
The recognition result includes content or operation corresponding to the two-dimensional code to be recognized, for example: if the two-dimensional code is a two-dimensional code for payment, a payment page is obtained through recognition, so that a user can complete payment operation, if the two-dimensional code is a personal two-dimensional code of an application, friend addition operation can be performed through recognition, and if the two-dimensional code is a commodity two-dimensional code, commodity information and the like of the commodity can be acquired through recognition.
In the method for identifying a two-dimensional code provided by this embodiment, after a two-dimensional code scanning mode is started, a flash lamp trigger instruction is obtained, the flash lamp trigger instruction is used to trigger the flash lamp to be turned on and gradually turned off, and in the process that the flash lamp is turned on and gradually turned off, image acquisition is performed on a two-dimensional code to be identified, at least two-dimensional code images are obtained, two-dimensional code identification is performed on the at least two-dimensional code images, and an identification result is obtained, where the identification result includes content or operation corresponding to the two-dimensional code to be identified, in the present invention, at night or when ambient light is dark, the flash lamp is used to assist in identifying the two-dimensional code, at least two-dimensional code images are acquired in the process that the flash lamp is turned on and turned off, each two-dimensional code image has a reflective area with different sizes under the irradiation of a reflective lamp, the at least two, the influence of the light reflecting area caused by the light reflecting light spots on two-dimensional code identification can be automatically overcome, a user does not need to adjust the scanning angle and position for multiple times, the problem that in the prior art, convenience in two-dimensional code scanning is poor when light is weak at night or around is solved, and user experience is improved.
Fig. 4 is a flowchart illustrating a second embodiment of a method for identifying a two-dimensional code according to an embodiment of the present invention, as shown in fig. 4, this embodiment still includes steps S1 and S2 in the embodiment shown in fig. 2, and after step S2, this embodiment further includes:
s301: and traversing and identifying each two-dimensional code image in the at least two-dimensional code images.
In this step, the terminal device may simultaneously identify each two-dimensional code image, or may complete the identification of each two-dimensional code image in a random order or a preset order, specifically, first, the terminal device determines whether each two-dimensional code image can be decoded, for example, determines whether the size of the light reflection area is smaller than a preset value, decodes the two-dimensional code image if the size of the light reflection area is smaller than the preset value, otherwise, determines that the two-dimensional code image cannot be identified, and then decodes the two-dimensional code image determined to be decoded, obtains a decoding result, and uses the decoding result as an identification result.
S302: and if the first two-dimensional code image exists in the at least two-dimensional code images and can be identified, obtaining an identification result according to the first two-dimensional code image.
The first two-dimensional code image is a two-dimensional code image which can be identified from at least two-dimensional code images. In this step, if the first two-dimensional code can be recognized, the decoding result of the first two-dimensional code is used as the recognition result, and the recognition result is pushed to the user, and the recognition process is ended at the same time.
In the embodiment, the terminal device performs traversal identification on each two-dimensional code image in the at least two-dimensional code images, judges whether a first two-dimensional code image capable of being identified exists in the at least two-dimensional code images, if so, acquires an identification result according to the first two-dimensional code image, and performs traversal acquisition on the at least two-dimensional code images with different light reflecting areas to acquire the identification result, so that the two-dimensional code is quickly identified.
In a specific implementation manner, fig. 5 is a schematic flowchart of a third embodiment of a method for identifying a two-dimensional code according to an embodiment of the present invention, and as shown in fig. 5, the determining whether each two-dimensional code image in at least two-dimensional code images can be identified includes:
s401: and acquiring a two-dimensional code area and a light reflecting area of the two-dimensional code image.
The terminal equipment positions the area of the two-dimensional code in the image by running a two-dimensional code recognition algorithm, records the size of the area of the two-dimensional code, detects the light reflection area and records the size of the light reflection area.
Specifically, the detecting the light-reflecting region includes: in the two-dimensional code area, whether the gray value of each pixel is larger than a threshold value W is judged pixel by pixel (the gray value range of the pixels in the two-dimensional code area is 0-255, 255 is a white gray value, 0 is a black gray value, and W is 255 usually), if yes, the pixel is determined to be a reflective pixel, marking is carried out, after the whole two-dimensional code area is traversed, the number of the reflective pixels is counted, and the size of the reflective area can be obtained.
S402: it is determined whether the light reflecting area is less than a preset value.
In this step, a preset value is determined in advance according to the data verification capability of the two-dimensional codes of different categories, where the preset value may be a ratio of the light reflection region to the two-dimensional code region, or a pixel size of the light reflection region, and then the terminal device determines whether the light reflection region is smaller than the preset value by comparing the light reflection region determined in step S401 with the preset value.
S403: if the light reflecting area is smaller than the preset value, decoding the content of the two-dimensional code area to determine whether the two-dimensional code image can be identified.
When the light reflecting area is smaller than a preset value, decoding the content of the two-dimensional code area, namely decoding according to the content of the non-light reflecting area, and if the two-dimensional code area is decoded successfully, determining that the two-dimensional code image can be identified; and if the decoding of the two-dimensional code area is unsuccessful, the two-dimensional code image cannot be identified.
S404: and if the light reflecting area is larger than or equal to the preset value, determining that the two-dimensional code image cannot be identified.
If the light reflection area is larger than or equal to the preset value, the information loss caused by the light reflection area is beyond the data verification capability of the current two-dimensional code, and the two-dimensional code image cannot be identified.
It can be seen that, in the embodiment shown in fig. 5, when the light reflection area is smaller than the preset value, and the content of the corresponding two-dimensional code area can be successfully decoded, the two-dimensional code image can be identified, otherwise, the two-dimensional code image cannot be identified, by judging the size of the light reflection area, the two-dimensional code image with the light reflection area exceeding the preset value is determined as the two-dimensional code image which cannot be identified, and decoding is attempted for the two-dimensional code with the light reflection area smaller than the preset value, and if the decoding is successful, the two-dimensional code image can be identified and the identification result is obtained, so that the two-dimensional code can be quickly and accurately identified.
On the basis of the embodiments shown in fig. 4 and fig. 5, fig. 6 is a schematic flow diagram of a fourth embodiment of a method for identifying a two-dimensional code according to an embodiment of the present invention, as shown in fig. 6, the method further includes:
s303: and if at least two-dimensional code images can not be identified, acquiring a non-reflection area image in each two-dimensional code image.
According to the traversal recognition result in step S301, specifically, the method for determining whether each two-dimensional code image can be recognized may be a process as shown in fig. 5, and if it is determined that at least two-dimensional code images cannot be recognized, the non-reflective area image in the two-dimensional code image is obtained, and each non-reflective area image is recorded.
S304: and overlapping the non-reflection area images of each two-dimensional code image to obtain a second two-dimensional code image.
Specifically, according to at least two non-reflective area images, the gray value of each pixel point in the non-reflective area of the second two-dimensional code image is calculated, the average value of the gray values of each pixel point in the non-reflective area of the second two-dimensional code image is obtained, and the average value is used as the gray value of each pixel point in the reflective area of the second two-dimensional code image.
Further, calculating the gray value of each pixel point in the non-reflective area of the second two-dimensional code image according to at least two non-reflective area images, including: and calculating the gray value of the pixel point in the second two-dimensional code image by calculating the ratio of the accumulated gray value of each pixel point to the non-reflection image count, and performing the calculation pixel by pixel to obtain the gray value of each pixel point in the non-reflection area of the second two-dimensional code image, namely the gray value of each pixel point in the non-reflection area of the second two-dimensional code image. It should be understood that the second two-dimensional code image obtained through the superposition processing will maximize the non-light reflection area and reduce the information loss caused by the light reflection area.
S305: and identifying the second two-dimensional code image to obtain an identification result.
And identifying the second two-dimensional code image obtained through superposition processing, namely decoding the two-dimensional code area in the second two-dimensional code image to obtain an identification result.
In a specific implementation manner, if the second two-dimensional code image is failed to be identified, that is, decoding fails, for example, information loss caused by a light reflection area of the second two-dimensional code image exceeds data verification capability of the two-dimensional code, so that decoding fails, prompt information is generated and pushed; the prompt information is used for prompting: and adjusting the position or angle of scanning, or adjusting the time for which the flash lamp is turned on and off, and then rescanning.
In this embodiment, if none of the at least two-dimensional code images can be identified, a non-reflective area image in each two-dimensional code image is obtained, the non-reflective area image of each two-dimensional code image is subjected to superposition processing to obtain a second two-dimensional code image, the second two-dimensional code image is identified to obtain an identification result, the second two-dimensional code image obtained by superposing the multiple two-dimensional code images has a larger non-reflective area, information loss caused by a reflective area is reduced, identification is easier, and success rate of two-dimensional code identification is improved.
Fig. 7 is a schematic flowchart of a fifth embodiment of a method for identifying a two-dimensional code according to an embodiment of the present invention, as shown in fig. 7, this embodiment still includes steps S1 and S2 in the embodiment shown in fig. 2, and after step S2, this embodiment further includes:
s310: and sequentially identifying at least two-dimension code images according to a preset sequence.
In this step, the terminal device sequentially identifies the at least two-dimension code images according to a preset sequence, where the preset sequence may be a time sequence of the at least two-dimension code images during collection, and the two-dimension code images collected first are identified first.
S320: if the current two-dimension code image can be identified, obtaining an identification result according to the current two-dimension code image, and ending the identification process, otherwise, if the current two-dimension code image cannot be identified, obtaining a non-reflection area image in the current two-dimension code image, identifying the next two-dimension code image according to a preset sequence, and repeating the step until all at least two-dimension code images are processed.
In this step, the terminal device first determines whether the current two-dimensional code image can be identified, and in a specific implementation manner, determining whether the current two-dimensional code image can be identified may be determined by the embodiment shown in fig. 5, and processing is performed according to a determination result: if the current two-dimensional code image can be identified, obtaining an identification result by decoding the two-dimensional code image, returning and pushing the identification result to a user, ending the identification process, and not identifying the two-dimensional code image behind the current two-dimensional code image; if the current two-dimensional code image can not be identified, acquiring a non-reflection area image in the current two-dimensional code image, storing the non-reflection area image, and identifying the next two-dimensional code image according to a preset sequence.
S330: and overlapping the non-reflection area images corresponding to each two-dimensional code image to obtain a second two-dimensional code image.
And if any two-dimensional code image which can be identified does not exist, performing superposition processing according to the at least two non-reflective area images stored in the step S320 to obtain a second two-dimensional code image.
The specific implementation process of this step is similar to step S304, and is not described here again.
S340: and identifying the second two-dimensional code image to obtain an identification result.
The specific implementation process of this step is similar to step S305, and is not described here again.
In the embodiment, at least two-dimension code images are sequentially identified according to a preset sequence, if the current two-dimension code image can be identified, an identification result is obtained according to the current two-dimension code image, the identification process is finished, otherwise, if the current two-dimension code image cannot be identified, a non-reflective area image in the current two-dimension code image is obtained, the next two-dimension code image is identified according to the preset sequence, the steps are repeated until all the at least two-dimension code images are processed, the non-reflective area images corresponding to each two-dimension code image are superposed to obtain a second two-dimension code image, the second two-dimension code image is identified to obtain the identification result, firstly, each two-dimension code image is sequentially identified, if the two-dimension code image which can be identified exists, the identification of the two-dimension code to be identified is finished, the quick identification of the two-dimensional code is realized under the condition that the angle of the terminal equipment is not required to be manually adjusted by a user, further, if at least two-dimensional code images cannot be identified, at least two non-reflective area images corresponding to the at least two-dimensional code images are overlapped to obtain a second two-dimensional code image with a maximized non-reflective area, the influence of a reflective area on the identification of the two-dimensional code is reduced, the quick and accurate identification of the two-dimensional code is realized, the convenience is increased, and the user experience is improved.
Fig. 8 is a schematic structural diagram of a first embodiment of an apparatus for identifying a two-dimensional code according to an embodiment of the present invention, and as shown in fig. 8, the apparatus 10 includes:
the acquisition module 11: when the two-dimension code scanning mode is started, the method is used for acquiring a flash lamp triggering instruction; the flash lamp triggering instruction is used for triggering the flash lamp to be lightened and gradually extinguished;
the acquisition module 12: the two-dimensional code recognition device is used for acquiring images of a two-dimensional code to be recognized in the process that the flash lamp is turned on and gradually turned off, and acquiring at least two-dimensional code images;
the processing module 13: and the two-dimension code recognition module is used for carrying out two-dimension code recognition on the at least two-dimension code images to obtain a recognition result, wherein the recognition result comprises the content or operation corresponding to the two-dimension code to be recognized.
The two-dimensional code recognition device 10 provided by the embodiment includes: the system comprises an acquisition module 11, an acquisition module 12 and a processing module 13, wherein after a two-dimensional code scanning mode is started, a flash lamp triggering instruction is acquired, the flash lamp triggering instruction is used for triggering the flash lamp to be turned on and gradually turned off, in the process that the flash lamp is turned on and gradually turned off, image acquisition is carried out on a two-dimensional code to be identified, at least two-dimensional code images are acquired, two-dimensional code identification is carried out on the at least two-dimensional code images, an identification result is acquired, the identification result comprises the content or operation corresponding to the two-dimensional code to be identified, in the invention, at night or when ambient light is dark, the flash lamp is used for assisting in identifying the two-dimensional code, the at least two-dimensional code images are acquired in the process that the flash lamp is turned on and turned off, each two-dimensional code image has different-reflection light areas under the irradiation of a reflection lamp, the at least, the influence of the light reflecting area caused by the light reflecting light spots on two-dimensional code identification can be automatically overcome, a user does not need to adjust the scanning angle and position for multiple times, the problem that in the prior art, convenience in two-dimensional code scanning is poor when light is weak at night or around is solved, and user experience is improved.
In a specific implementation manner, the processing module 13 is specifically configured to:
traversing and identifying each two-dimension code image in the at least two-dimension code images;
and if the first two-dimensional code image exists in the at least two-dimensional code images and can be identified, obtaining the identification result according to the first two-dimensional code image.
In a specific implementation manner, the processing module 13 is specifically configured to:
if the at least two-dimension code images can not be identified, acquiring a non-reflection area image in each two-dimension code image;
superposing the non-reflective area images of each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
In a specific implementation manner, the processing module 13 is specifically configured to:
sequentially identifying the at least two-dimension code images according to a preset sequence;
if the current two-dimensional code image can be identified, acquiring the identification result according to the current two-dimensional code image, and ending the identification process, otherwise, if the current two-dimensional code image cannot be identified, acquiring a non-reflective area image in the current two-dimensional code image, identifying the next two-dimensional code image according to the preset sequence, and repeating the step until all the at least two-dimensional code images are processed;
superposing the non-reflective area images corresponding to each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
In a specific implementation manner, the processing module 13 is specifically configured to:
calculating the gray value of each pixel point in the non-reflective area of the second two-dimensional code image according to at least two non-reflective area images;
and acquiring the average value of the gray value of each pixel point in the non-reflection area of the second two-dimensional code image, and taking the average value as the gray value of each pixel point in the reflection area of the second two-dimensional code image.
In a specific implementation manner, the obtaining module 11 is further configured to obtain a two-dimensional code region and a light reflection region of the two-dimensional code image;
the processing module 13 is further configured to:
determining whether the reflective area is smaller than a preset value;
if the reflecting area is smaller than a preset value, decoding the content of the two-dimensional code area to determine whether the two-dimensional code image can be identified;
and if the light reflecting area is larger than or equal to the preset value, determining that the two-dimensional code image cannot be identified.
In a specific implementation manner, the processing module 13 is specifically configured to:
if the two-dimensional code area is successfully decoded, determining that the two-dimensional code image can be identified;
and if the two-dimensional code area is failed to be decoded, determining that the two-dimensional code image cannot be identified.
In a specific implementation manner, the processing module 13 is further configured to:
if the second two-dimensional code image fails to be identified, generating prompt information and pushing the prompt information; the prompt information is used for prompting: and adjusting the position or angle of scanning, or adjusting the time for which the flash lamp is turned on and off, and then rescanning.
The two-dimensional code recognition device provided in this embodiment may implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 9 shows a terminal device, and the embodiment of the present invention is only described with reference to fig. 9 as an example, which does not mean that the present invention is limited thereto.
Fig. 9 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present invention. The terminal device provided by the embodiment includes, but is not limited to, a mobile phone, a computer, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
As shown in fig. 9, the terminal device 20 provided in this embodiment may include: a memory 201, a processor 202, a flash 204, and an image capture device 205; optionally, a bus 203 may also be included. The bus 203 is used to realize connection between the elements.
The memory 201 stores computer-executable instructions;
the processor 202 executes the computer-executable instructions stored in the memory 201, so that the processor executes the two-dimensional code identification method provided by any one of the foregoing embodiments.
Wherein, the memory 201 and the processor 202 are electrically connected directly or indirectly to realize the data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines, such as via bus 203. The memory 201 stores computer-executable instructions for implementing the data access control method, including at least one software functional module that can be stored in the memory 201 in the form of software or firmware, and the processor 202 executes various functional applications and data processing by running software programs and modules stored in the memory 201.
The Memory 201 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 201 is used for storing programs, and the processor 202 executes the programs after receiving the execution instructions. Further, the software programs and modules in the memory 201 may also include an operating system, which may include various software components and/or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.
The processor 202 may be an integrated circuit chip having signal processing capabilities. The Processor 202 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and so on. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. It will be appreciated that the configuration of fig. 9 is merely illustrative and may include more or fewer components than shown in fig. 9 or have a different configuration than shown in fig. 9. The components shown in fig. 9 may be implemented in hardware and/or software.
The embodiment of the present invention further provides a computer-readable storage medium, where computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the method for identifying a two-dimensional code provided in any one of the above method embodiments can be implemented.
The computer-readable storage medium in this embodiment may be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, etc. that is integrated with one or more available media, and the available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., SSDs), etc.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (18)

1. A two-dimensional code recognition method is characterized by comprising the following steps:
when a two-dimensional code scanning mode is started, a flash lamp triggering instruction is obtained; the flash lamp triggering instruction is used for triggering the flash lamp to be lightened and gradually extinguished;
in the process that the flash lamp is turned on and gradually turned off, image acquisition is carried out on the two-dimension code to be recognized, and at least two-dimension code images are obtained;
and performing two-dimension code recognition on the at least two-dimension code images to obtain a recognition result, wherein the recognition result comprises the content or operation corresponding to the two-dimension code to be recognized.
2. The method according to claim 1, wherein the performing two-dimensional code recognition on the at least two-dimensional code images to obtain a recognition result comprises:
traversing and identifying each two-dimension code image in the at least two-dimension code images;
and if the first two-dimensional code image exists in the at least two-dimensional code images and can be identified, obtaining the identification result according to the first two-dimensional code image.
3. The method of claim 2, further comprising:
if the at least two-dimension code images can not be identified, acquiring a non-reflection area image in each two-dimension code image;
superposing the non-reflective area images of each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
4. The method according to claim 1, wherein the performing two-dimensional code recognition on the at least two-dimensional code images comprises:
sequentially identifying the at least two-dimension code images according to a preset sequence;
if the current two-dimensional code image can be identified, acquiring the identification result according to the current two-dimensional code image, and ending the identification process, otherwise, if the current two-dimensional code image cannot be identified, acquiring a non-reflective area image in the current two-dimensional code image, identifying the next two-dimensional code image according to the preset sequence, and repeating the step until all the at least two-dimensional code images are processed;
superposing the non-reflective area images corresponding to each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
5. The method according to claim 3 or 4, wherein the second two-dimensional code image includes a plurality of pixel points, and the superimposing the non-reflection area image in each two-dimensional code image to obtain the second two-dimensional code image includes:
calculating the gray value of each pixel point in the non-reflective area of the second two-dimensional code image according to at least two non-reflective area images;
and acquiring the average value of the gray value of each pixel point in the non-reflection area of the second two-dimensional code image, and taking the average value as the gray value of each pixel point in the reflection area of the second two-dimensional code image.
6. The method according to any one of claims 1 to 4, further comprising:
for any one frame of the two-dimensional code image,
acquiring a two-dimensional code area and a light reflecting area of a two-dimensional code image;
determining whether the reflective area is smaller than a preset value;
if the reflecting area is smaller than a preset value, decoding the content of the two-dimensional code area to determine whether the two-dimensional code image can be identified;
and if the light reflecting area is larger than or equal to the preset value, determining that the two-dimensional code image cannot be identified.
7. The method of claim 6, wherein the decoding the content of the two-dimensional code region to determine whether the two-dimensional code image can be identified comprises:
if the two-dimensional code area is successfully decoded, determining that the two-dimensional code image can be identified;
and if the two-dimensional code area is failed to be decoded, determining that the two-dimensional code image cannot be identified.
8. The method of claim 7, further comprising:
if the second two-dimensional code image fails to be identified, generating prompt information and pushing the prompt information; the prompt information is used for prompting: and adjusting the position or angle of scanning, or adjusting the time for which the flash lamp is turned on and off, and then rescanning.
9. An apparatus for recognizing a two-dimensional code, the apparatus comprising:
the acquisition module is used for acquiring a flash lamp trigger instruction after the two-dimensional code scanning mode is started; the flash lamp triggering instruction is used for triggering the flash lamp to be lightened and gradually extinguished;
the acquisition module is used for acquiring images of the two-dimensional code to be recognized in the process of lighting and gradually turning off the flash lamp to acquire at least two-dimensional code images;
and the processing module is used for carrying out two-dimension code identification on the at least two-dimension code images to obtain an identification result, wherein the identification result comprises the content or operation corresponding to the two-dimension code to be identified.
10. The apparatus of claim 9, wherein the processing module is specifically configured to:
traversing and identifying each two-dimension code image in the at least two-dimension code images;
and if the first two-dimensional code image exists in the at least two-dimensional code images and can be identified, obtaining the identification result according to the first two-dimensional code image.
11. The apparatus of claim 10, wherein the processing module is specifically configured to:
if the at least two-dimension code images can not be identified, acquiring a non-reflection area image in each two-dimension code image;
superposing the non-reflective area images of each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
12. The apparatus of claim 9, wherein the processing module is specifically configured to:
sequentially identifying the at least two-dimension code images according to a preset sequence;
if the current two-dimensional code image can be identified, acquiring the identification result according to the current two-dimensional code image, and ending the identification process, otherwise, if the current two-dimensional code image cannot be identified, acquiring a non-reflective area image in the current two-dimensional code image, identifying the next two-dimensional code image according to the preset sequence, and repeating the step until all the at least two-dimensional code images are processed;
superposing the non-reflective area images corresponding to each two-dimensional code image to obtain a second two-dimensional code image;
and identifying the second two-dimensional code image to obtain the identification result.
13. The apparatus according to claim 11 or 12, wherein the processing module is specifically configured to:
calculating the gray value of each pixel point in the non-reflective area of the second two-dimensional code image according to at least two non-reflective area images;
and acquiring the average value of the gray value of each pixel point in the non-reflection area of the second two-dimensional code image, and taking the average value as the gray value of each pixel point in the reflection area of the second two-dimensional code image.
14. The apparatus according to any one of claims 9 to 12,
the acquisition module is also used for acquiring a two-dimensional code area and a light reflection area of the two-dimensional code image;
the processing module is further configured to:
determining whether the reflective area is smaller than a preset value;
if the reflecting area is smaller than a preset value, decoding the content of the two-dimensional code area to determine whether the two-dimensional code image can be identified;
and if the light reflecting area is larger than or equal to the preset value, determining that the two-dimensional code image cannot be identified.
15. The apparatus of claim 14, wherein the processing module is specifically configured to:
if the two-dimensional code area is successfully decoded, determining that the two-dimensional code image can be identified;
and if the two-dimensional code area is failed to be decoded, determining that the two-dimensional code image cannot be identified.
16. The apparatus of claim 15, wherein the processing module is further configured to:
if the second two-dimensional code image fails to be identified, generating prompt information and pushing the prompt information; the prompt information is used for prompting: and adjusting the position or angle of scanning, or adjusting the time for which the flash lamp is turned on and off, and then rescanning.
17. A terminal device, comprising: the device comprises a flash lamp, an image acquisition device, a memory and a processor;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored in the memory, so that the processor executes the two-dimensional code identification method according to any one of claims 1 to 8.
18. A storage medium, comprising: a readable storage medium and a computer program for implementing the two-dimensional code recognition method according to any one of claims 1 to 8.
CN201910656705.1A 2019-07-19 2019-07-19 Two-dimensional code identification method, device, equipment and storage medium Active CN112241642B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910656705.1A CN112241642B (en) 2019-07-19 2019-07-19 Two-dimensional code identification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910656705.1A CN112241642B (en) 2019-07-19 2019-07-19 Two-dimensional code identification method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112241642A true CN112241642A (en) 2021-01-19
CN112241642B CN112241642B (en) 2024-02-23

Family

ID=74168250

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910656705.1A Active CN112241642B (en) 2019-07-19 2019-07-19 Two-dimensional code identification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112241642B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113436576A (en) * 2021-05-28 2021-09-24 荣耀终端有限公司 OLED display screen dimming method and device applied to two-dimensional code scanning
CN113607419A (en) * 2021-08-02 2021-11-05 广东工业大学 Engine cylinder block electronic tag detection device and method
CN114548136A (en) * 2021-11-18 2022-05-27 福建星网天合智能科技有限公司 Method, device, equipment and medium for analyzing light-reflecting two-dimensional code picture
CN116451719A (en) * 2023-04-17 2023-07-18 笃准机器人智能科技(苏州)有限公司 Method for identifying two-dimensional code and character code on surface of workpiece after electrophoresis
CN117787309A (en) * 2023-12-13 2024-03-29 佛山鑫码电子科技有限公司 Code scanning method and device based on double-color light source irradiation

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020181772A1 (en) * 1998-06-30 2002-12-05 Keigo Ihara Two-dimensional code recognition processing method, two-dimensional code recognition processing apparatus, and storage medium
CN102625534A (en) * 2012-03-20 2012-08-01 惠州Tcl移动通信有限公司 Flash lamp control device for mobile terminal
CN106896994A (en) * 2015-12-21 2017-06-27 阿里巴巴集团控股有限公司 A kind of frame display methods and device
CN107220578A (en) * 2017-05-31 2017-09-29 维沃移动通信有限公司 A kind of two-dimensional code scanning recognition methods, device, mobile terminal and storage medium
CN107818283A (en) * 2017-11-02 2018-03-20 深圳天珑无线科技有限公司 Quick Response Code image pickup method, mobile terminal and computer-readable recording medium
CN107844730A (en) * 2017-11-07 2018-03-27 维沃移动通信有限公司 A kind of graphic code scan method and mobile terminal
CN107944321A (en) * 2017-11-28 2018-04-20 努比亚技术有限公司 A kind of image-recognizing method, terminal and computer-readable recording medium
CN108763999A (en) * 2018-04-17 2018-11-06 维沃移动通信有限公司 Barcode recognition method and terminal device
CN109190436A (en) * 2018-07-30 2019-01-11 努比亚技术有限公司 A kind of two-dimensional code identification method, mobile terminal and storage medium
JP2019046330A (en) * 2017-09-06 2019-03-22 キヤノン電子株式会社 Optical type information reading device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020181772A1 (en) * 1998-06-30 2002-12-05 Keigo Ihara Two-dimensional code recognition processing method, two-dimensional code recognition processing apparatus, and storage medium
CN102625534A (en) * 2012-03-20 2012-08-01 惠州Tcl移动通信有限公司 Flash lamp control device for mobile terminal
CN106896994A (en) * 2015-12-21 2017-06-27 阿里巴巴集团控股有限公司 A kind of frame display methods and device
CN107220578A (en) * 2017-05-31 2017-09-29 维沃移动通信有限公司 A kind of two-dimensional code scanning recognition methods, device, mobile terminal and storage medium
JP2019046330A (en) * 2017-09-06 2019-03-22 キヤノン電子株式会社 Optical type information reading device
CN107818283A (en) * 2017-11-02 2018-03-20 深圳天珑无线科技有限公司 Quick Response Code image pickup method, mobile terminal and computer-readable recording medium
CN107844730A (en) * 2017-11-07 2018-03-27 维沃移动通信有限公司 A kind of graphic code scan method and mobile terminal
CN107944321A (en) * 2017-11-28 2018-04-20 努比亚技术有限公司 A kind of image-recognizing method, terminal and computer-readable recording medium
CN108763999A (en) * 2018-04-17 2018-11-06 维沃移动通信有限公司 Barcode recognition method and terminal device
CN109190436A (en) * 2018-07-30 2019-01-11 努比亚技术有限公司 A kind of two-dimensional code identification method, mobile terminal and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113436576A (en) * 2021-05-28 2021-09-24 荣耀终端有限公司 OLED display screen dimming method and device applied to two-dimensional code scanning
CN113436576B (en) * 2021-05-28 2022-05-06 荣耀终端有限公司 OLED display screen dimming method and device applied to two-dimensional code scanning
CN113607419A (en) * 2021-08-02 2021-11-05 广东工业大学 Engine cylinder block electronic tag detection device and method
CN114548136A (en) * 2021-11-18 2022-05-27 福建星网天合智能科技有限公司 Method, device, equipment and medium for analyzing light-reflecting two-dimensional code picture
CN116451719A (en) * 2023-04-17 2023-07-18 笃准机器人智能科技(苏州)有限公司 Method for identifying two-dimensional code and character code on surface of workpiece after electrophoresis
CN116451719B (en) * 2023-04-17 2023-10-27 笃准机器人智能科技(苏州)有限公司 Method for identifying two-dimensional code and character code on surface of workpiece after electrophoresis
CN117787309A (en) * 2023-12-13 2024-03-29 佛山鑫码电子科技有限公司 Code scanning method and device based on double-color light source irradiation

Also Published As

Publication number Publication date
CN112241642B (en) 2024-02-23

Similar Documents

Publication Publication Date Title
CN112241642B (en) Two-dimensional code identification method, device, equipment and storage medium
CN107690653B (en) Method and device for acquiring fingerprint image and terminal equipment
CN108090405B (en) Face recognition method and terminal
EP2843510A2 (en) Method and computer-readable recording medium for recognizing an object using captured images
US11093773B2 (en) Liveness detection method, apparatus and computer-readable storage medium
CN109409277B (en) Gesture recognition method and device, intelligent terminal and computer storage medium
CN108090340B (en) Face recognition processing method, face recognition processing device and intelligent terminal
US8965051B2 (en) Method and apparatus for providing hand detection
CN104899490A (en) Terminal positioning method and user terminal
USRE47608E1 (en) Predictive triggering in an electronic device
CN105653171A (en) Fingerprint identification based terminal control method, terminal control apparatus and terminal
CN111507122A (en) Graphic code identification method and device, storage medium and terminal
CN107729833B (en) Face detection method and related product
CN111080665B (en) Image frame recognition method, device, equipment and computer storage medium
CN113268211B (en) Image acquisition method, device, electronic equipment and storage medium
CN111859322A (en) Identity verification method and device and electronic equipment
CN111950446A (en) Fingerprint identification method and device and terminal equipment
CN109558719B (en) Unlocking method and terminal
CN112752012A (en) Camera starting method and device, electronic equipment and storage medium
CN115061380A (en) Device control method and device, electronic device and readable storage medium
CN110401775B (en) Alarm clock setting method, alarm clock setting device and mobile terminal
KR20230100368A (en) Service providing system and method for proividing parking warning, service providing apparatus therefor and non-transitory computer readable medium having computer program recorded thereon
CN113408447A (en) Fingerprint identification method, fingerprint identification device and storage medium
CN108985127B (en) Method, device and equipment for identifying one-dimensional manifold code and readable storage medium
CN112749769A (en) Graphic code detection method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant