CN116563830A - Identification code identification method, device and storage medium - Google Patents

Identification code identification method, device and storage medium Download PDF

Info

Publication number
CN116563830A
CN116563830A CN202210103435.3A CN202210103435A CN116563830A CN 116563830 A CN116563830 A CN 116563830A CN 202210103435 A CN202210103435 A CN 202210103435A CN 116563830 A CN116563830 A CN 116563830A
Authority
CN
China
Prior art keywords
camera module
identification code
identification
target image
preset
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
CN202210103435.3A
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202210103435.3A priority Critical patent/CN116563830A/en
Publication of CN116563830A publication Critical patent/CN116563830A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Studio Devices (AREA)

Abstract

The disclosure relates to an identification method, an identification device and a storage medium for identification codes. And receiving a scanning instruction of a preset application for calling a camera module of the terminal equipment to scan, calling a first camera module of the terminal equipment to acquire a first target image of a preset target, determining whether an identification code is identified in the first target image, if not, switching the first target image to a second camera module of the terminal equipment based on the reason of failure in identification, and acquiring a second target image of the preset target through the second camera module so as to identify the identification code in the second target image. Through automatic analysis discernment failure reason and automatic switch-over corresponding module of making a video recording, can promote the terminal equipment and to the discernment success rate of identification code, can conveniently discern the identification code more fast, promoted user experience.

Description

Identification code identification method, device and storage medium
Technical Field
The disclosure relates to the technical field of electronic devices, and in particular relates to a method and a device for identifying an identification code and a storage medium.
Background
With the development of intelligent mobile equipment, such as terminal equipment, the configuration of a camera module of the terminal equipment is obviously improved, and due to the identification code, such as a two-dimensional bar code, the technology has the advantages of large information capacity, low cost, easiness in transmission and the like, and the two-dimensional bar code is promoted to be applied to industries of mobile payment, sharing of bicycles, express logistics and the like more widely. In the related art, when the barcode is scanned and identified, only one camera module of the terminal device is usually used, for example, the main camera module is used for two-dimensional code identification, and sometimes the camera and the focal length are required to be manually adjusted so that the barcode clearly falls into the range of the camera.
Therefore, how to quickly and conveniently perform identification code recognition is a problem to be solved.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides an identification method, an identification device and a medium for identifying an identification code.
According to a first aspect of embodiments of the present disclosure, there is provided an identification method of an identification code, which is applied to a terminal device, the identification method including:
receiving a scanning instruction of a camera module of a preset application calling terminal device for scanning;
acquiring a first target image of a preset target through a first camera module;
determining whether the identification code is identified in the first target image;
if not, based on the recognition failure reason, switching to a second camera module, acquiring a second target image of the preset target through the second camera module, and recognizing the recognition code in the second target image.
In an exemplary embodiment, switching to the second camera module based on the identification failure cause includes:
when the identification failure is caused by the fact that the area ratio of the area where the identification code is located in the first target image is smaller than a first preset threshold value, switching to a long-focus camera module of the terminal equipment;
when the identification failure is caused by that the area where the identification code is located comprises part of the identification code, switching to a wide-angle camera module of the terminal equipment;
when the identification failure is caused by that the area ratio of the area where the identification code is located in the first target image is larger than a second preset threshold value, switching to a micro-distance camera module of the terminal equipment;
and when the recognition failure is caused by that the noise in the area where the identification code is located is larger than a preset noise threshold value, switching to a black-and-white camera module of the terminal equipment.
In an exemplary embodiment, the identification method includes:
and powering up the second camera module after receiving the scanning instruction.
In an exemplary embodiment, the identification method includes:
and after switching to the second camera module, closing the first camera module.
In an exemplary embodiment, before the first target image of the preset target is acquired by the first camera module, the identifying method includes: and determining whether the area where the identification code is located is stable.
In an exemplary embodiment, the determining whether the area in which the identification code is located is stable includes:
acquiring a preset number of images within a preset time length, and determining a difference value between the positions of the areas where the identification codes are located in any two frames of images;
and when all the difference values are in a preset range, determining that the area where the identification code is located is stable.
According to a second aspect of the embodiments of the present disclosure, there is provided an identification device for an identification code, which is applied to a terminal device, the identification device including:
and a receiving module: the scanning instruction is configured to receive a scanning instruction of a camera module of a preset application calling terminal device;
the acquisition module is used for: the camera module is configured to acquire a first target image of a preset target through the first camera module;
a first determination module: is configured to determine whether the identification code is identified in the first target image;
and a switching module: if not, switching to a second camera module based on the recognition failure reason, acquiring a second target image of the preset target through the second camera module, and recognizing the recognition code in the second target image.
In an exemplary embodiment, the switching module is configured to:
when the identification failure is caused by the fact that the area ratio of the area where the identification code is located in the first target image is smaller than a first preset threshold value, switching to a long-focus camera module of the terminal equipment;
when the identification failure is caused by that the area where the identification code is located comprises part of the identification code, switching to a wide-angle camera module of the terminal equipment;
when the identification failure is caused by that the area ratio of the area where the identification code is located in the first target image is larger than a second preset threshold value, switching to a micro-distance camera module of the terminal equipment;
and when the recognition failure is caused by that the noise in the area where the identification code is located is larger than a preset noise threshold value, switching to a black-and-white camera module of the terminal equipment.
In an exemplary embodiment, the identification means comprises:
and (5) a power-on module: and the second camera module is powered on after receiving the scanning instruction.
In an exemplary embodiment, the switching module is configured to:
and after switching to the second camera module, closing the first camera module.
In an exemplary embodiment, the identification means comprises: a second determination module: is configured to determine whether the area in which the identification code is located is stable.
In an exemplary embodiment, the second determination module is configured to:
acquiring a preset number of images within a preset time length, and determining a difference value between the positions of the areas where the identification codes are located in any two frames of images;
and when all the difference values are in a preset range, determining that the area where the identification code is located is stable.
According to a third aspect of the embodiments of the present disclosure, there is provided an identification device for an identification code, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the identification method of the identification code of any of the first aspects of the embodiments of the present disclosure.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium, which when executed by a processor of a terminal device, causes the terminal device to perform a method of identifying an identification code, the method comprising the method of identifying an identification code of any one of the first aspects of embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
after a scanning instruction of a preset application for calling a camera module of the terminal equipment to scan is received, a first camera module of the terminal equipment is called to acquire a first target image of a preset target, whether an identification code is identified in the first target image is determined, if the identification code is not identified, the identification code is switched to a second camera module of the terminal equipment based on the reason of identification failure, and a second target image of the preset target is acquired through the second camera module so as to identify the identification code in the second target image. The failure cause is automatically analyzed and the corresponding camera module is automatically switched, so that the success rate of identification of the terminal equipment to the identification code can be improved, the user can use the identification code to identify the function more conveniently and efficiently, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of identifying an identification code according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating determining whether an area of an identification code in a first target image is stable according to an exemplary embodiment;
FIG. 3 is a block diagram of an identification device for identifying a code, according to an exemplary embodiment;
fig. 4 is a block diagram (general structure of a terminal device) showing an identification device of an identification code according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
An exemplary embodiment of the present disclosure provides an identification method of an identification code, as shown in fig. 1, fig. 1 is a flowchart of an identification method of an identification code according to an exemplary embodiment, the identification method of an identification code is applied to a terminal device, the terminal device includes a plurality of camera modules, and as shown in fig. 1, the identification method of an identification code includes the steps of:
step S101: receiving a scanning instruction of a camera module of a preset application calling terminal device for scanning;
step S102: acquiring a first target image of a preset target through a first camera module;
step S103: determining whether an identification code is identified in the first target image;
step S104: if not, based on the recognition failure reason, switching to a second camera module, acquiring a second target image of the preset target through the second camera module, and recognizing the recognition code in the second target image.
According to the identification method of the identification code, which is provided by the exemplary embodiment of the disclosure, after a scanning instruction of a preset application for calling a camera module of the terminal equipment to scan is received, a first camera module of the terminal equipment is called to acquire a first target image of a preset target, whether the identification code is identified in the first target image is determined, if the identification code is not identified, the identification code is switched to a second camera module of the terminal equipment based on the reason of identification failure, and the second target image is acquired through the second camera module to identify the identification code. In the identification method of the identification code provided by the exemplary embodiment of the disclosure, the characteristic that the terminal equipment comprises a plurality of camera modules is utilized, the plurality of camera modules are used for identifying the identification code under different conditions, and after the user fails to scan the identification code by using the first camera module, the identification code can be automatically switched to the second camera module for identification according to the identification failure reason, so that the identification success rate of the identification code is improved, and the user experience is improved.
In step S101, a scan instruction for invoking a camera module of a terminal device to scan by a preset application is received.
The scanning instruction of receiving the preset application and calling the camera module of the terminal equipment to scan can be a code scanning payment instruction in mobile payment software such as WeChat, payment treasury and the like, or a code scanning riding instruction such as dripping, beauty team and the like, and can call the camera module of the terminal equipment through the scanning instruction similar to the scanning instruction of scanning once as long as the application software can acquire the authority of the camera module of the terminal equipment. The camera module of the terminal equipment is used for scanning the identification code, and the identification code can be a two-dimensional code or any other identification code which can be identified.
In step S102, a first target image of a preset target is acquired through a first camera module.
After receiving the scanning instruction, starting the first camera module, and acquiring a first target image of a preset target through the first camera module. The first camera module of the terminal device may be a main camera module of a camera module of the terminal device, which is a main common camera module of the terminal device. The main camera module is started, for example, the configuration of a register controlling the start of the main camera module is written into the main camera module, for example, the relevant configuration of stream on of a corresponding register is written into the main camera module, so as to start the main camera module. The terminal device may include a register for controlling the start of the main camera module only, so as to control the start of the main camera module separately. After the main camera module is started, acquiring image data of a preset target, and displaying a first target image corresponding to the preset target acquired by the main camera module on a preview interface of a preset application. The preset target may be an identification code, and the first target image of the preset target is obtained through the camera module of the terminal device, that is, the first camera module can obtain an image of a shooting area corresponding to the identification code.
In step S103, it is determined whether an identification code is identified in the first target image.
After the first target image is acquired, whether the identification code can be identified in the acquired first target image can be detected, if the identification code can be identified in the first target image, the identification code analysis is completed, and the identification code identification method is ended. If the identification code cannot be identified in the first target image, determining the reason of the identification failure, and correspondingly switching to the corresponding camera module according to the reason of the identification failure.
In step S104, if not, based on the failure recognition reason, the camera is switched to the second camera module, and the second camera module obtains the second target image of the preset target, so as to recognize the identification code in the second target image.
If the first target image has no identifiable identification code, indicating that the identification fails, switching the camera module to a second camera module of the terminal equipment through the reason of the identification failure, acquiring a second target image of a preset target through the second camera module, and identifying the second target image. When switching to the second camera module of the terminal equipment, writing the configuration of the register started by the controller into the second camera module. For example, the relevant configuration of stream on of the corresponding register is written into the second camera module to start the second camera module. The terminal device may include a register for controlling the start of the second camera module only, so as to separately control the start of the second camera module. After the second camera module is started, acquiring image data of a preset target, displaying a second target image corresponding to the preset target acquired by the second camera module on a preview interface of a preset application, and re-identifying an identification code in the image. The second camera module can be a long focus camera module, a wide angle camera module, a micro-distance camera module, a black-and-white camera module and the like.
In an exemplary embodiment of the disclosure, after a scan instruction of a preset application for calling a camera module of a terminal device to scan is received, a first camera module of the terminal device is called to acquire a first target image of a preset target, if an identification code is not identified in the first target image, based on a reason of identification failure, a second camera module of the terminal device is switched to acquire a second target image of the preset target again and identify the identification code in the second target image, so that after the user fails to identify the identification code by using the first camera module, other camera modules are automatically switched to acquire images, the identification success rate of the identification code is improved, and user experience is improved.
In an exemplary embodiment of the present disclosure, switching to the second camera module based on the identification failure cause includes:
when the identification failure reason is that the area occupation ratio of the area where the identification code is located in the first target image is smaller than a first preset threshold value, switching to a tele camera module of the terminal equipment;
when the identification failure reasons are that the area where the identification code is located comprises part of the identification code, switching to a wide-angle camera module of the terminal equipment;
when the identification failure reason is that the area ratio of the area where the identification code is located in the first target image is larger than a second preset threshold value, switching to a micro-distance camera module of the terminal equipment;
and when the reason of the identification failure is that the noise in the area where the identification code is located is larger than a preset noise threshold value, switching to a black-and-white camera module of the terminal equipment.
If the identification code in the first target image acquired by the first camera module of the terminal equipment fails to be identified, namely the identification code is not identified in the first target image acquired by the first camera module, determining the reason of the identification failure, switching the reason to the second camera module of the terminal equipment according to the identification failure reason, acquiring the second target image of the preset target by the second camera module, identifying the identification code in the second target image, and completing the identification of the identification code. In the exemplary embodiment of the disclosure, when the identification code of the first target image acquired by the first camera module fails to identify, the second camera module is automatically switched to the second camera module based on the reason of the identification failure so as to realize the identification code identification, so that manual operation of a user is not needed, and user experience is improved.
When the reason of the identification failure is that the area ratio of the area where the identification code is located in the first target image is smaller than a first preset threshold, and the first preset threshold is the minimum area ratio of the area where the identification code is located in the first target image just capable of identifying the identification code, the obtained area where the identification code is located is very small relative to the whole shooting area of the first shooting module, which is caused by the fact that the terminal equipment is too far away from the identification code, if the identification code fails, the identification code can be switched to the tele shooting module of the terminal equipment, and the second target image is obtained for identification code identification after the preset target is amplified.
When the cause of the recognition failure is that the area where the identification code is located includes a part of the identification code, for example, when the aspect ratio of the identifiable part of the identification code is different from the standard aspect ratio. The difference is caused by the fact that the area where the identification code is located at the edge of the shooting area of the first shooting module. The first shooting module is limited by the shooting area, so that the identification code in the first target image is cut to be incomplete, the wide-angle shooting module of the terminal equipment or the ultra-wide-angle shooting module can be switched at the moment, the shooting area is enlarged, the second target image is acquired, the whole identification code can be displayed in the second target image, and the identification code identification is carried out on the second target image.
When the reason of the recognition failure is that the area ratio of the area where the recognition code is located in the first target image is larger than the second preset threshold, the second preset threshold is that the largest area ratio of the area where the recognition code is located in the first target image can be just displayed in the first target image and the recognition code can be recognized, and the obtained area where the recognition code is located is quite large compared with the whole shooting area of the first shooting module, because the distance between the terminal equipment and the recognition code is smaller than the focusing distance of the first shooting module, focusing cannot be performed, and if the recognition code fails, the second target image shot at a short distance can be obtained by switching to the micro-distance shooting module of the terminal equipment at the moment for recognition.
When the recognition failure causes that the noise in the area where the recognition code is located is larger than a preset noise threshold value, the preset noise threshold value is the maximum noise value when the recognition code can be just recognized. The noise can comprise image color noise, and the recognition code fails to recognize due to the fact that the color noise of the area where the recognition code is located is large, at the moment, the black-and-white camera module of the terminal equipment can be switched, the contrast of a preset target is enhanced, and a second target image is acquired for recognition.
The reason for failure in recognition of the identification code is determined through the characteristics of the area where the identification code is located, and the corresponding second camera module is switched according to the reason for failure in recognition, so that the preset target can be further recognized, and the success rate of recognition of the identification code is improved.
In an exemplary embodiment of the present disclosure, the second camera module is powered on after receiving the scan instruction.
After receiving the scanning instruction, namely after receiving the scanning instruction of calling the camera module of the terminal equipment by the preset application to scan, powering up the first camera module of the terminal equipment and powering up the second camera module. And calling the first camera module to acquire a first target image, wherein the second camera module is in a power-on state at the moment and can be called at any time. The power-on means that the camera module is electrified and is in a state of being called at any time. When the first camera module fails to accurately identify the identification code after the second camera module is electrified, the second camera module can be called at any time, so that the second camera module can acquire a second target image corresponding to a preset target to identify the identification code. When the second camera module is in a power-on state, the second camera module is not called, so that the use power is small, the running state of the terminal equipment is not influenced, the power consumption of the terminal equipment is not influenced, the second camera module can be called at any time, the flexibility of identification code identification is improved, and the power consumption of the terminal equipment is not increased.
In an exemplary embodiment of the present disclosure, the first camera module is turned off after switching to the second camera module.
The first target image acquired by the first camera module fails to identify the identification code, the first target image is switched to the second target image continuously acquired by the second camera module, the second camera module is started, and the first camera module can be closed in order to reduce the power consumption of the terminal equipment. The second camera module is started to write the relevant configuration of the stream on of the corresponding register into the second camera module, and simultaneously write the relevant configuration of the stream off of the corresponding register into the first camera module to close the first camera module. In the identification process of the identification code provided by the exemplary embodiment of the disclosure, although the identification code is identified by utilizing the plurality of camera modules of the terminal equipment, only one camera module of the terminal equipment is started at the same time, so that the power consumption of the terminal equipment is not increased, and the user experience is increased.
In a disclosed exemplary embodiment, before acquiring a first target image of a preset target by a first camera module, the method includes: determining whether the area where the identification code is located is stable.
When a user scans the identification code by using a preset application of the terminal equipment, the situation that the area where the identification code is located is unstable can occur due to some uncertainty factors. At this time, when the identification code is identified, the identification failure is easy to occur, and meanwhile, the reason of the identification failure is determined inaccurately, so that before the first target image of the preset target is acquired through the first camera module, whether the area where the identification code is located is stable is determined.
As shown in fig. 2, fig. 2 is a flowchart illustrating a determination of whether an area where an identification code is located in a first target image is stable, and as shown in fig. 2, the determination of whether the area where the identification code is located is stable includes the following steps:
step S201: acquiring a preset number of images within a preset time length, and determining a difference value between the positions of the areas where the identification codes are located in any two frames of images;
step S202: and when all the difference values are in the preset range, determining that the area where the identification code is located is stable.
Acquiring a preset number of images within a preset time length, determining a difference value between the positions of the areas where the identification codes are located in any two frames of images, and determining that the areas where the identification codes are located are stable when all the difference values are within a preset range, so that a first target image can be acquired. Judging whether the area where the identification code is located is stable or not can further improve the success rate of identification of the identification code.
In step S201, a preset number of images are acquired within a preset time period, and a difference value between positions of areas where identification codes in any two frames of images are located is determined.
The method for identifying the area where the identification code is located may be any method capable of identifying the area where the identification code is located in the image by, for example, identifying the area where the identification code is located in the image by a learning model, such as a convolutional neural network identification model, determining the relative position of the area where the identification code is located in the image, and calculating the difference value of the relative position of the area where the identification code is located in any two frames of images.
In step S202, when all the difference values are within the preset range, it is determined that the area where the identification code is located is stable.
When the difference value of the relative positions of the areas where the identification codes are located in any two frames of images is within a preset range, the positions of the areas where the identification codes are located in the images are relatively stable, and a first target image can be obtained.
In an exemplary embodiment of the present disclosure, when the second camera module needs to be switched to further identify the identification code, the user may be prompted whether to switch to the second camera module. For example in the form of a pop-up window to prompt the user if a handover is required.
When the terminal equipment is switched to the second camera module, if the position of the terminal equipment needs to be adjusted so that the second camera module accurately acquires the identification code, a user can be prompted to adjust a mode, for example, a popup window mode is used for prompting the user of the position needing to be moved, so that the second camera module accurately scans the identification code. For example, after the second camera module is switched to, the preset target, namely the area where the identification code is located, cannot be located in the shooting area of the second camera module, and the terminal equipment pops up prompt information to prompt a user to adjust the position of the terminal equipment to sweep the code, so that the identification success rate of the identification code is improved, and the user experience is improved.
In an exemplary embodiment of the disclosure, determining whether the second camera module exists in the terminal device, and if not, prompting a user to adjust the position of the terminal device to identify the identification code.
And when the identification code is not identified in the first target image acquired through the first camera module, determining the type of the second camera module to be switched according to the identification failure reason. Before determining to switch to the second camera module, determining whether the second camera module of the type exists in the terminal equipment, and if so, directly switching to the second camera module; if the second camera module of the type does not exist, prompting the user to adjust the position of the terminal equipment to scan the code again. For example, a user is prompted in a popup window mode to need a code scanning position of the mobile terminal device, so that the first camera module can acquire a first target image of a preset target again.
According to the identification method of the identification code, which is provided by the exemplary embodiment of the disclosure, after a scanning instruction of a preset application for calling a camera module of the terminal equipment to scan is received, a first camera module of the terminal equipment is called to acquire a first target image of a preset target, whether the identification code is identified in the first target image is determined, if the identification code is not identified, the identification code is switched to a second camera module of the terminal equipment based on the reason of identification failure, and a second target image of the preset target is acquired through the second camera module so as to identify the identification code in the second target image. The failure cause is automatically analyzed and the corresponding camera module is automatically switched, so that the success rate of identification of the terminal equipment to the identification code can be improved, the user can use the identification code to identify the function more conveniently and efficiently, and the user experience is improved.
Fig. 3 is a block diagram of an identification device for identifying a code, according to an exemplary embodiment. Referring to fig. 3, the apparatus includes:
the receiving module 301: the scanning instruction is configured to receive a scanning instruction of a camera module of a preset application calling terminal device;
the acquisition module 302: the camera module is configured to acquire a first target image of a preset target through the first camera module;
the first determination module 303: is configured to determine whether the identification code is identified in the first target image;
the switching module 304: if not, switching to a second camera module based on the recognition failure reason, acquiring a second target image of the preset target through the second camera module, and recognizing the recognition code in the second target image.
In an alternative embodiment, the switching module 304 is configured to:
when the identification failure is caused by the fact that the area ratio of the area where the identification code is located in the first target image is smaller than a first preset threshold value, switching to a long-focus camera module of the terminal equipment;
when the identification failure is caused by that the area where the identification code is located comprises part of the identification code, switching to a wide-angle camera module of the terminal equipment;
when the identification failure is caused by that the area ratio of the area where the identification code is located in the first target image is larger than a second preset threshold value, switching to a micro-distance camera module of the terminal equipment;
and when the recognition failure is caused by that the noise in the area where the identification code is located is larger than a preset noise threshold value, switching to a black-and-white camera module of the terminal equipment.
In an alternative embodiment, the identification means comprises:
power-on module 305: and the second camera module is powered on after receiving the scanning instruction.
In an alternative embodiment, the switching module 304 is configured to:
and after switching to the second camera module, closing the first camera module.
In an alternative embodiment, the identification means comprises: the second determination module 306: is configured to determine whether the area in which the identification code is located is stable.
In an alternative embodiment, the second determining module 306 is configured to:
acquiring a preset number of images within a preset time length, and determining a difference value between the positions of the areas where the identification codes are located in any two frames of images;
and when all the difference values are in a preset range, determining that the area where the identification code is located is stable.
Fig. 4 is a block diagram illustrating an identification device 1000 for an identification code according to an exemplary embodiment. For example, apparatus 1000 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 4, the apparatus 1000 may include one or more of the following components: a processing component 1002, a memory 1004, a power component 1006, a multimedia component 1008, an audio component 1010, an input/output (I/O) interface 1012, a sensor component 1014, and a communication component 1016.
The processing component 1002 generally controls overall operation of the apparatus 1000, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1002 can include one or more processors 1020 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 1002 can include one or more modules that facilitate interaction between the processing component 1002 and other components. For example, the processing component 1002 can include a multimedia module to facilitate interaction between the multimedia component 1008 and the processing component 1002.
The memory 1004 is configured to store various types of data to support operations at the device 1000. Examples of such data include instructions for any application or method operating on the device 1000, contact data, phonebook data, messages, pictures, videos, and the like. The memory 1004 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 1006 provides power to the various components of the device 1000. The power components 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 1000.
The multimedia component 1008 includes a screen between the device 1000 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia assembly 1008 includes a front-facing camera and/or a rear-facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 1000 is in an operational mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 1010 is configured to output and/or input audio signals. For example, the audio component 1010 includes a Microphone (MIC) configured to receive external audio signals when the device 1000 is in an operational mode, such as a call mode, a recording mode, and a speech recognition mode. The received audio signals may be further stored in memory 1004 or transmitted via communication component 1016. In some embodiments, the audio component 1010 further comprises a speaker for outputting audio signals.
The I/O interface 1012 provides an interface between the processing assembly 1002 and peripheral interface modules, which may be a keyboard, click wheel, buttons, and the like. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 1014 includes one or more sensors for providing status assessment of various aspects of the device 1000. For example, the sensor assembly 1014 may detect an on/off state of the device 1000, a relative positioning of the components, such as a display and keypad of the apparatus 1000, the sensor assembly 1014 may also detect a change in position of the apparatus 1000 or a component of the apparatus 1000, the presence or absence of user contact with the apparatus 1000, an orientation or acceleration/deceleration of the apparatus 1000, and a change in temperature of the apparatus 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 1014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 can also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1016 is configured to facilitate communication between the apparatus 1000 and other devices, either wired or wireless. The device 1000 may access a wireless network based on a communication standard, such as WiFi,4G or 5G, or a combination thereof. In one exemplary embodiment, the communication component 1016 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 1000 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 1004, including instructions executable by processor 1020 of apparatus 1000 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
A non-transitory computer readable storage medium, which when executed by a processor of a terminal device, causes the terminal device to perform a method of identifying an identification code, the method comprising any of the identification code identification methods provided by embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

1. An identification method of an identification code, characterized by being applied to a terminal device, the identification method comprising:
receiving a scanning instruction of a camera module of a preset application calling terminal device for scanning;
acquiring a first target image of a preset target through a first camera module;
determining whether the identification code is identified in the first target image;
if not, based on the recognition failure reason, switching to a second camera module, acquiring a second target image of the preset target through the second camera module, and recognizing the recognition code in the second target image.
2. The method according to claim 1, wherein switching to the second camera module based on the cause of the recognition failure comprises:
when the identification failure is caused by the fact that the area ratio of the area where the identification code is located in the first target image is smaller than a first preset threshold value, switching to a long-focus camera module of the terminal equipment;
when the identification failure is caused by that the area where the identification code is located comprises part of the identification code, switching to a wide-angle camera module of the terminal equipment;
when the identification failure is caused by that the area ratio of the area where the identification code is located in the first target image is larger than a second preset threshold value, switching to a micro-distance camera module of the terminal equipment;
and when the recognition failure is caused by that the noise in the area where the identification code is located is larger than a preset noise threshold value, switching to a black-and-white camera module of the terminal equipment.
3. The method of identifying an identification code according to claim 1, wherein the method of identifying comprises:
and powering up the second camera module after receiving the scanning instruction.
4. The method of identifying an identification code according to claim 1, wherein the method of identifying comprises:
and after switching to the second camera module, closing the first camera module.
5. The method according to any one of claims 1 to 4, wherein before the first target image of the preset target is acquired by the first camera module, the method comprises: and determining whether the area where the identification code is located is stable.
6. The method of claim 5, wherein determining whether the area in which the identification code is located is stable comprises:
acquiring a preset number of images within a preset time length, and determining a difference value between the positions of the areas where the identification codes are located in any two frames of images;
and when all the difference values are in a preset range, determining that the area where the identification code is located is stable.
7. An identification device for an identification code, characterized in that it is applied to a terminal device, said identification device comprising:
and a receiving module: the scanning instruction is configured to receive a scanning instruction of a camera module of a preset application calling terminal device;
the acquisition module is used for: the camera module is configured to acquire a first target image of a preset target through the first camera module;
a first determination module: is configured to determine whether the identification code is identified in the first target image;
and a switching module: if not, switching to a second camera module based on the recognition failure reason, acquiring a second target image of the preset target through the second camera module, and recognizing the recognition code in the second target image.
8. The identification device of claim 7, wherein the switching module is configured to:
when the identification failure is caused by the fact that the area ratio of the area where the identification code is located in the first target image is smaller than a first preset threshold value, switching to a long-focus camera module of the terminal equipment;
when the identification failure is caused by that the area where the identification code is located comprises part of the identification code, switching to a wide-angle camera module of the terminal equipment;
when the identification failure is caused by that the area ratio of the area where the identification code is located in the first target image is larger than a second preset threshold value, switching to a micro-distance camera module of the terminal equipment;
and when the recognition failure is caused by that the noise in the area where the identification code is located is larger than a preset noise threshold value, switching to a black-and-white camera module of the terminal equipment.
9. The identification device of an identification code according to claim 7, wherein the identification device comprises:
and (5) a power-on module: and the second camera module is powered on after receiving the scanning instruction.
10. The identification device of claim 7, wherein the switching module is configured to:
and after switching to the second camera module, closing the first camera module.
11. The identification device of an identification code according to any of claims 7-10, characterized in that the identification device comprises: a second determination module: is configured to determine whether the area in which the identification code is located is stable.
12. The identification device of claim 11, wherein the second determination module is configured to:
acquiring a preset number of images within a preset time length, and determining a difference value between the positions of the areas where the identification codes are located in any two frames of images;
and when all the difference values are in a preset range, determining that the area where the identification code is located is stable.
13. An identification device for an identification code, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the identification method of the identification code of any of claims 1-6.
14. A non-transitory computer readable storage medium, which when executed by a processor of a terminal device, causes the terminal device to perform a method of identifying an identification code, the method comprising the method of identifying an identification code of any of claims 1-6.
CN202210103435.3A 2022-01-27 2022-01-27 Identification code identification method, device and storage medium Pending CN116563830A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210103435.3A CN116563830A (en) 2022-01-27 2022-01-27 Identification code identification method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210103435.3A CN116563830A (en) 2022-01-27 2022-01-27 Identification code identification method, device and storage medium

Publications (1)

Publication Number Publication Date
CN116563830A true CN116563830A (en) 2023-08-08

Family

ID=87488499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210103435.3A Pending CN116563830A (en) 2022-01-27 2022-01-27 Identification code identification method, device and storage medium

Country Status (1)

Country Link
CN (1) CN116563830A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117725941A (en) * 2024-02-02 2024-03-19 荣耀终端有限公司 Code scanning method and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117725941A (en) * 2024-02-02 2024-03-19 荣耀终端有限公司 Code scanning method and electronic equipment

Similar Documents

Publication Publication Date Title
CN106572299B (en) Camera opening method and device
US10452890B2 (en) Fingerprint template input method, device and medium
CN105095881A (en) Method, apparatus and terminal for face identification
CN105245775A (en) Method and device for camera imaging, and mobile terminal
CN108717542B (en) Method and device for recognizing character area and computer readable storage medium
CN107480785B (en) Convolutional neural network training method and device
CN108040213B (en) Method and apparatus for photographing image and computer-readable storage medium
EP3758343B1 (en) Method and device for controlling image acquisition component and storage medium
CN112929561A (en) Multimedia data processing method and device, electronic equipment and storage medium
CN110399082B (en) Terminal attribute control method and device, electronic equipment and medium
CN116563830A (en) Identification code identification method, device and storage medium
CN116188343B (en) Image fusion method and device, electronic equipment, chip and medium
CN108319899B (en) Fingerprint identification method and device
CN117412169A (en) Focus tracking method, apparatus, electronic device and storage medium
CN114666490B (en) Focusing method, focusing device, electronic equipment and storage medium
CN112702514B (en) Image acquisition method, device, equipment and storage medium
CN112580387B (en) Fingerprint input method and device and electronic equipment
US20200356977A1 (en) Method and device for controlling application and computer-readable storage medium
CN107682623B (en) Photographing method and device
CN107707819B (en) Image shooting method, device and storage medium
CN105391942A (en) Automatic shooting method and device
CN108536858A (en) The method and apparatus write
CN110876015B (en) Method and device for determining image resolution, electronic equipment and storage medium
CN109862252B (en) Image shooting method and device
CN114004245A (en) Bar code information identification method, device, 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