Image acquisition method, electronic device and storage medium

Through parallel acquisition and parameter adjustment of multiple cameras, the problem of unclear images caused by electronic equipment when the initial focus area is not at the imaging target is solved, achieving rapid identification of distant targets and improving image collection efficiency.

CN117425071BActive Publication Date: 2024-09-17HONOR DEVICE CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202311726713.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2024-09-17
Estimated Expiration
2043-12-15

AI Technical Summary

Technical Problem

When the camera is started, the initial focus area of ​​electronic equipment is usually not located at the imaging target, resulting in unclear images collected. It is necessary to adjust the acquisition parameters multiple times to obtain clear images, which takes a long time and affects functional efficiency.

Method used

Multiple cameras are used to collect images in parallel, and the acquisition parameters of the first camera are adjusted according to the imaging target detected by the second camera to quickly identify distant targets and improve target detection efficiency.

Benefits of technology

By taking advantage of the characteristics of multiple cameras, we can quickly identify distant targets, reduce focusing time, improve image collection efficiency, and reduce the time-consuming target recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117425071B
    Figure CN117425071B
Patent Text Reader

Abstract

The present application relates to the field of electronic technology, and in particular to an image acquisition method, an electronic device, and a computer-readable storage medium. The method is applied to an electronic device including a first camera and a second camera (such as a main camera and another camera). The method includes: when an acquisition instruction is detected, such as an instruction generated after a user opens a code scanning program, the first camera and the second camera are controlled to acquire data, and the acquisition screen of the first camera is displayed; corresponding to the imaging target not being detected in the image acquired by the first camera, such as the QR code not being detected, and the imaging target being detected in the first image acquired by the second camera with the first acquisition parameter, if the QR code is detected, the first camera is controlled to acquire data according to the first acquisition parameter to obtain a second image including the imaging target. The scheme of the present application can make full use of the acquisition capabilities of multiple cameras, improve the acquisition efficiency of the first camera, and the efficiency of identifying the imaging target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to an image acquisition method, electronic equipment and storage medium. Background Art

[0002] At present, more and more people use electronic devices (for example, mobile phones, tablet computers and other terminal devices, access control devices) to collect real-world environments, to obtain images of imaging targets (for example, graphic codes, people, animals, files, etc.) in the environment, and to implement related functions based on the images of the imaging targets collected. For example, electronic devices can identify the information carried in the graphic code by collecting images of the graphic code, and perform corresponding functions based on the identified information, such as accessing web pages, downloading applications (applications, APPs), following accounts, scanning codes to pay, etc. For another example, the access control system can collect user portraits in the environment to identify whether the user has the authority to pass through the access control system.

[0003] However, in actual application scenarios, the initial focus area of ​​the electronic device's camera when it is turned on is usually not in the area where the imaging target is located, so that the image of the imaging target in the image captured by the camera is not clear. The electronic device needs to constantly adjust the acquisition parameters (for example, adjust the focus area from near to far or from far to near) to obtain a clear image of the imaging target, which results in a long time for the electronic device to acquire a clear image of the imaging target, affecting the efficiency of the electronic device in implementing related functions based on the captured image. Summary of the invention

[0004] The purpose of this application is to provide an image acquisition method, an electronic device and a computer-readable storage medium.

[0005] In a first aspect, the present application provides an image acquisition method, which is applied to an electronic device, the electronic device comprising a first camera and a second camera; and the method comprises: detecting an acquisition instruction, controlling the first camera and the second camera to perform acquisition, and displaying the acquisition screen of the first camera; corresponding to the fact that no imaging target is detected in the image captured by the first camera, and detecting that there is an imaging target in the first image captured by the second camera with a first acquisition parameter; controlling the first camera to perform acquisition according to the first acquisition parameter to obtain a second image including the imaging target, and displaying the second image.

[0006] That is, in the embodiment of the present application, when the imaging target is not detected in the image captured by the first camera, but the imaging target is detected in the image captured by the second camera, the first camera can be controlled to readjust the acquisition parameters for acquisition to acquire an image including the imaging target. It can be understood that before the first camera re-acquires, the image of the imaging target in the acquisition screen displayed on the electronic device is not clear enough; and after the first camera re-acquires according to the first acquisition parameters of the second camera, the acquisition screen displayed on the electronic device can display a clearer imaging target, that is, the imaging target can be detected from the image newly captured by the first camera.

[0007] Through the embodiments of the present application, a second camera other than the first camera can be used for acquisition and target recognition. When the first camera does not recognize the imaging target but the second camera recognizes the imaging target, the first camera can be controlled according to the acquisition parameters of the second camera to acquire a sufficiently clear first target image of the imaging target, thereby speeding up the speed at which the first camera recognizes the imaging target and improving the target recognition efficiency of the first camera.

[0008] In a possible implementation of the first aspect above, the first camera collects images based on a first focus strategy, and the second camera collects images based on a second focus strategy, and the first focus strategy and the second focus strategy are different.

[0009] In a possible implementation of the first aspect, the first focusing strategy is to capture multiple images from near to far focus points, and the second focusing strategy is to capture multiple images from far to near focus points. The distance from the imaging target to the electronic device is greater than a preset distance.

[0010] That is, in the embodiment of the present application, the first focus strategy is to traverse the focus point or focus area of ​​the first camera from near to far, during which the first camera can continuously collect images based on a preset frequency, and the distance between the imaging target and the electronic device is greater than the preset distance, indicating that the imaging target is in the distance. Similarly, the second focus strategy is to traverse the focus point or focus area of ​​the second camera from far to near, during which the second camera can continuously collect images based on a preset frequency.

[0011] Through the embodiments of the present application, the second camera can quickly identify imaging targets in the distance, and enable the first camera to adjust according to the acquisition parameters of the second camera, so that the first camera can also quickly identify imaging targets in the distance, thereby improving the target detection efficiency of the first camera in this scenario (the imaging target is located at a relatively far distance).

[0012] In a possible implementation of the first aspect above, detecting the presence of an imaging target in a first image captured by a second camera with a first acquisition parameter includes: detecting a plurality of images captured by the second camera, whose acquisition range corresponds to the acquisition range of the first camera, and detecting the first image in which the imaging target exists.

[0013] That is, in the embodiment of the present application, the detection range of the image captured by the second camera and the detection range of the image captured by the first camera correspond to the same range of the real environment. For example, if the field of view of the image captured by the first camera is a first angle, the image captured by the second camera can be cropped and the cropped image can be detected; wherein the field of view corresponding to the cropped image is the first angle mentioned above.

[0014] In a possible implementation of the first aspect above, the first camera is controlled to perform acquisition according to the first acquisition parameter to obtain a second image including the imaging target, and the second image is displayed, including: determining the distance from the imaging target to the electronic device according to the first acquisition parameter; determining the second acquisition parameter required for the first camera to acquire the second image based on the distance from the imaging target to the electronic device; and controlling the first camera to perform acquisition with the second acquisition parameter to obtain the second image including the imaging target.

[0015] That is, in the embodiment of the present application, the distance from the imaging target to the electronic device is the object distance corresponding to the imaging target. It can be understood that when there are multiple imaging targets, the imaging target corresponding to the object distance is the imaging target located at the focus point.

[0016] In a possible implementation of the first aspect above, the first acquisition parameter and the second acquisition parameter are focus parameters respectively.

[0017] That is, in the embodiment of the present application, the focus parameter may be the motor position of the camera.

[0018] In a possible implementation of the first aspect, in response to detecting an imaging target in an image captured by the first camera, the second camera is controlled to stop capturing images.

[0019] In a possible implementation of the first aspect above, a plurality of imaging targets are displayed in the second image, and the method further includes: identifying a first imaging target selected by a user from the plurality of imaging targets.

[0020] In a possible implementation of the first aspect above, the number of first cameras is one, and the number of second cameras is multiple; detecting that an imaging target exists in a first image captured by the second camera with first acquisition parameters includes: detecting that an imaging target exists in a first image captured by one of the multiple second cameras with the first acquisition parameters.

[0021] In a possible implementation of the first aspect above, the first camera is a wide-angle camera, and the second camera is an ultra-wide-angle camera.

[0022] In a possible implementation of the first aspect, the imaging target includes at least one of a graphic code, a person, a scene, an object, text, and a document.

[0023] In a second aspect, the present application provides an image acquisition method, which is applied to an electronic device, the electronic device comprising a first camera and a second camera; and the method comprises: detecting an acquisition instruction, controlling the first camera and the second camera to perform acquisition, and displaying the acquisition screen of the first camera; corresponding to the imaging target not being detected in the image acquired by the first camera, and detecting the presence of the imaging target in the third image acquired by the second camera; switching the displayed acquisition screen of the first camera to the acquisition screen of the second camera, wherein the imaging target is displayed in the acquisition screen of the second camera.

[0024] That is, in the embodiment of the present application, when the imaging target is not detected in the image captured by the first camera, but the imaging target is detected in the image captured by the second camera, the captured screen of the first camera can be switched to the captured screen of the second camera. It can be understood that before the switching, the image of the imaging target in the captured screen displayed on the electronic device is not clear enough; after the switching, the captured screen displayed on the electronic device can display a clearer imaging target, that is, the imaging target can be detected from the image newly captured by the second camera.

[0025] Through an image acquisition method of an embodiment of the present application, the characteristics of different cameras can be fully utilized to display the acquisition image of a camera with higher detection efficiency in the current scene, for example, the second camera mentioned above, thereby improving the efficiency of detecting imaging targets.

[0026] In a possible implementation of the second aspect above, the captured image of the second camera is: a image corresponding to a capture range of the first camera and obtained by adjusting the image captured by the second camera.

[0027] That is, in the embodiment of the present application, the captured image of the second camera displayed and the captured image of the first camera displayed before the switch have the same range of corresponding real environment. For example, if the field of view of the image captured by the first camera is the first angle, the image captured by the second camera can be cropped and the cropped image can be displayed; wherein the field of view corresponding to the cropped image is the first angle mentioned above.

[0028] In a possible implementation of the second aspect, the first camera collects images based on a first focus strategy, and the second camera collects images based on a second focus strategy, and the first focus strategy and the second focus strategy are different.

[0029] In a possible implementation of the second aspect above, the first focusing strategy is to capture multiple images from a near focus point to a far focus point, and the second focusing strategy is to capture multiple images from a far focus point to a near focus point.

[0030] That is, in the embodiment of the present application, the first focus strategy is to traverse the focus point or focus area of ​​the first camera from near to far, during which the first camera can continuously collect images based on a preset frequency. Similarly, the second focus strategy is to traverse the focus point or focus area of ​​the second camera from far to near, during which the second camera can continuously collect images based on a preset frequency.

[0031] In a possible implementation of the second aspect above, detecting the presence of an imaging target in a first image captured by a second camera with a first acquisition parameter includes: detecting a plurality of images captured by the second camera, whose acquisition range corresponds to the acquisition range of the first camera, and detecting the first image in which the imaging target exists.

[0032] That is, in the embodiment of the present application, the detection range of the image captured by the second camera and the detection range of the image captured by the first camera correspond to the same range of the real environment. For example, if the field of view of the image captured by the first camera is a first angle, the image captured by the second camera can be cropped and the cropped image can be detected; wherein the field of view corresponding to the cropped image is the first angle mentioned above.

[0033] In a possible implementation of the second aspect above, there are multiple imaging targets, and the imaging targets are displayed in the capture screen of the second camera, including: displaying multiple imaging targets in the capture screen of the second camera; and identifying a first imaging target selected by the user from the multiple imaging targets.

[0034] In a possible implementation of the second aspect above, the number of first cameras is one, and the number of second cameras is multiple; detecting the presence of an imaging target in a third image captured by the second camera includes: detecting the presence of an imaging target in a third image captured by a target camera among the multiple second cameras; switching to the capture screen of the second camera includes: switching to the capture screen of the target camera.

[0035] In a possible implementation of the second aspect above, the first camera is a wide-angle camera, and the second camera is an ultra-wide-angle camera.

[0036] In a possible implementation of the second aspect, the imaging target includes at least one of a graphic code, a person, a scene, an object, text, and a document.

[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which, when the processor executes the instructions in the memory, enables the electronic device to execute the method of the first or second aspect mentioned above.

[0038] In a fourth aspect, an embodiment of the present application provides a storage medium having instructions stored thereon, and when the instructions are executed on an electronic device, the electronic device executes the method of the first aspect or the second aspect mentioned above.

[0039] In a fifth aspect, an embodiment of the present application provides a chip, the chip includes a programmable logic circuit and / or program instructions, and when the chip is running, the method of the first aspect or the second aspect mentioned above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1A According to the present application, a schematic diagram of a first imaging screen is shown;

[0041] Figure 1B According to the present application, a schematic diagram of a second imaging screen is shown;

[0042] Figure 2A According to an embodiment of the present application, a first interface schematic diagram of an electronic device 100 is shown;

[0043] Figure 2B According to an embodiment of the present application, a schematic diagram of a second interface of an electronic device 100 is shown;

[0044] Figure 3 According to an embodiment of the present application, a first flow chart of an image acquisition method is shown;

[0045] Figure 4 According to an embodiment of the present application, a second flow chart of an image acquisition method is shown;

[0046] Figure 5A A schematic diagram of a first imaging screen is shown according to an embodiment of the present application;

[0047] Figure 5B A schematic diagram of a second imaging screen is shown according to an embodiment of the present application;

[0048] Fig. 6A A schematic diagram of a third imaging screen is shown according to an embodiment of the present application;

[0049] Figure 6B A schematic diagram of a fourth imaging screen is shown according to an embodiment of the present application;

[0050] Figure 7 A third flow chart of an image acquisition method is shown according to an embodiment of the present application;

[0051] Figure 8 According to an embodiment of the present application, a hardware framework schematic diagram of an electronic device 100 is shown;

[0052] Fig. 9 According to an embodiment of the present application, a software structure block diagram of an electronic device 100 is shown. DETAILED DESCRIPTION

[0053] The illustrative embodiments of the present application include, but are not limited to, an image acquisition method, an electronic device, and a storage medium.

[0054] It should be understood that the imaging target in the embodiments of the present application may be a graphic code, a person, a scene, an animal, a file, text, a face, etc. For ease of description, in the following embodiments, the imaging target is a graphic code as an example to introduce the technical solution of the present application.

[0055] Generally speaking, electronic devices use a single camera to capture the image target and recognize the graphic code based on the image obtained by the camera. However, the initial focus area of ​​the camera is not at the graphic code, and then the camera needs to continuously adjust the focus area until it focuses on the graphic code, or the graphic code is within the depth of field range of the camera (i.e., the clear area), so that the image of the graphic code is clear enough. In other words, a single camera needs to spend a lot of time to obtain a clear image of the graphic code. Before this, the terminal device cannot recognize the graphic code, resulting in low efficiency in recognizing the graphic code.

[0056] It can be understood that the electronic device's acquisition interface displays the image captured by the camera, and the electronic device can control the camera to perform automatic focusing, that is, by controlling the motor or motor to control the movement of the focus lens group in the camera, change the focus point in the image or change the magnification of the image, so that the image near the focus point becomes clear. For example, the focus point is changed so that the focus point is located at the graphic code, or the image is enlarged based on optical zoom, so that the image of the graphic code becomes clear.

[0057] For example, in some embodiments, the electronic device may focus based on a specific focus strategy, which may not be able to quickly identify the graphic code in some scenarios. For example, when the focus strategy adopts a near-to-far strategy (i.e., focusing on a near object first, then gradually moving the focus area or focus point away, and focusing on a farther object), if the graphic code is in the far view of the acquisition screen (i.e., the acquisition imaging screen displayed on the electronic device when the user performs a code scanning operation), a long focusing process is required before the camera can focus on the graphic code or near the graphic code, so that the graphic code is within the depth of field range (clear range) to obtain a clear picture of the graphic code.

[0058] As an example, the electronic device may be a mobile terminal 10, and the real environment in front of the camera of the mobile terminal 10 is the environment near the parking lot gate. Figure 1A , Figure 1B For example, Figure 1A , Figure 1B The images of the code scanning interface are respectively illustrated in the figure, including the steering wheel 01 in the vehicle, the QR code 02 on the sign outside the windshield, and the QR code 03 on the wall behind the sign.

[0059] For example, the mobile terminal 10 focuses based on a near-to-far strategy. Figure 1A , the focus of the camera is located nearby, such as the steering wheel 01 in the car. At this time, the image of the steering wheel 01 is clear, and the images of the QR code 02 and the QR code 03 are blurred. Then, the focus moves from near to far; that is, the image distance of the lens is shortened and the object distance is lengthened. After a period of time, the focus moves to the QR code 02 on the signboard. At this time, the image of the QR code 02 changes from blurred to clear, allowing the mobile terminal 10 to recognize the QR code 02 and display a graphic code selection box around the QR code 02. At this time, since the QR code 03 is outside the depth of field, the image is relatively blurred. In the above process, it takes a long time for the mobile terminal 10 to detect the QR code 02, and the efficiency of detecting the QR code is low.

[0060] Similarly, if the electronic device adopts a focus strategy from far to near, when the graphic code is located close to the electronic device, the electronic device will need a long time to capture a clear image of the nearby graphic code because the camera first focuses on the distant area and then gradually focuses on the nearby area close to the graphic code.

[0061] That is to say, no matter whether the focus strategy is from near to far or from near to far, in some scenes, it may take a long time to capture a clear graphic code using only one camera to capture the image of the graphic code.

[0062] It can be understood that generally, multiple cameras are provided on electronic devices, for example, a main camera (wide-angle camera), an ultra-wide-angle camera, a macro camera, a fixed-focus camera, etc. are provided on a mobile phone. Therefore, in order to make full use of the acquisition capabilities of multiple cameras, in an image acquisition method provided in an embodiment of the present application, the electronic device can use multiple cameras in parallel to acquire images, and respectively detect whether there is an imaging target in the image acquired by each camera. If the imaging target is detected in the target image acquired by the target camera, the detection result based on the target camera can be displayed. For example, if the imaging target is not detected in the image acquired by the main camera, but has been detected in the image acquired by the macro camera, the imaging screen displayed by the electronic device can be switched to the acquisition screen of the macro camera, and the detected imaging target is displayed therein. In this way, the characteristics of different cameras can be fully utilized, and the acquisition screen of the camera with higher detection efficiency in the current scene can be displayed, for example, the above-mentioned target camera, so as to improve the efficiency of detecting the imaging target.

[0063] In some optional embodiments, the electronic device may use the first camera and at least one second camera in parallel to respectively use different focus strategies to capture images, and respectively detect whether there is an imaging target in the images captured by each camera. If the electronic device first detects the imaging target in the image captured by the first camera, it controls the first camera to capture the image of the imaging target; if the electronic device first detects the imaging target in the image captured by the third camera in at least one second camera, the electronic device may determine the focus information corresponding to the imaging target (for example, the distance from the imaging target to the electronic device) based on the current capture parameters (for example, focus parameters, etc.) of the third camera, and control the first camera to capture the image of the imaging target based on the determined focus information.

[0064] After the electronic device captures the image of the imaging target, it can realize the relevant functions. For example, when the imaging target is a QR code (or barcode), the electronic device can recognize the captured image containing the QR code, so as to realize functions such as payment and access to web pages. For example, in the parking scene shown in 1A, the electronic device can scan the QR code image next to the gate to realize the parking payment function. When the imaging target is a file, the electronic device can recognize the captured image of the file, so as to realize functions such as text recognition and file scanning. For another example, when the imaging target is a document, the electronic device can correct the image of the document after capturing the image of the document; for another example, when the imaging target is text, the electronic device can translate the text after capturing the image of the text; for another example, when the imaging target is a face, the electronic device can recognize the features of the face after capturing the face image to determine whether the user corresponding to the face has access rights to a certain system (such as an access control system).

[0065] In some embodiments, the electronic device may display the image captured by the first camera in real time on the screen of the electronic device, that is, on the capture interface triggered by the user clicking the camera control, without displaying the image captured by the second camera. Target detection is performed based on the images acquired by at least two cameras (including the first camera and at least one second camera) of the electronic device, and the imaging screen of the first camera is displayed in real time on the capture interface. If the first camera recognizes the imaging target, the electronic device can control the first camera to capture the image of the imaging target and display the image on the capture interface. If the third camera of at least one second camera detects the imaging target before the first camera, the electronic device can determine the focus information of the imaging target adopted by the third camera, and determine the distance between the imaging target and the electronic device based on the focus information, and then control the first camera to refocus based on the distance to identify the target imaging target, capture the image of the imaging target and display the captured image on the capture interface. For example, assuming that the imaging target is located far away from the electronic device, if the first camera does not recognize the imaging target in the distance based on the near-to-far focus strategy, and the second camera immediately recognizes the imaging target in the distance based on the far-to-near focus strategy, then the target position of the imaging target can be determined based on the focus parameters of the second camera, and the first camera can be controlled to focus far away according to the target position, so as to recognize the imaging target in the distance. Through the above method, at least two cameras can be used to recognize the imaging target, avoiding the limitations of a single camera in the focus strategy and improving the recognition efficiency.

[0066] According to some embodiments, after the electronic device detects the imaging target based on the first acquisition image acquired by the second camera, it can determine the distance from the imaging target to the electronic device based on the focus parameter of the second acquisition image, that is, the motor position when the second camera acquires the first acquisition image. Then the electronic device can determine the motor position of the first camera based on the distance, so that the first camera can move its own motor to the determined motor position to focus on the imaging target detected by the second camera, obtain clear target imaging, and display it on the acquisition interface.

[0067] According to some embodiments, the first camera may adopt an auto-focus method, and the focus strategy is from near to far; the second camera may adopt an auto-focus method, and the focus strategy is from far to near. It can be understood that the focus point of the first camera can traverse from macro to infinity, and output image data to the target detection model for detection every N (N is an integer greater than 0) frames; the focus point of the second camera can traverse from infinity to macro, and output image data to the target detection model for detection every N frames.

[0068] According to some embodiments, the focus strategy of the first camera is from near to far, and the second camera includes multiple cameras, wherein the focus strategy of each of the multiple second cameras may be different, for example, the focus strategy of the first second camera is from far to near, the focus strategy of the second second camera is from near to far, and the focus strategies of other second cameras are from the center of the image to near, from the center of the image to far, etc. The embodiment of the present application does not limit the focus strategy of each second camera.

[0069] According to some embodiments, the first camera may be a main camera, and the second camera may be a wide-angle camera. If the imaging target or other imaging targets have been identified in the image captured by the first camera before the imaging target is identified in the image captured by the second camera, the second camera does not need to perform any operation, that is, the detection process is completed based on the image captured by the first camera. In this embodiment, the imaging target is first detected in the image captured by the first camera, indicating that the detection efficiency based on the first camera is higher in this scenario, and the first camera can be prioritized to complete the target detection.

[0070] Combine the following Figure 2A-2B The interface of the electronic device 100 in the embodiment of the present application is introduced.

[0071] like Figure 2A As shown, after the user performs the detection operation, the electronic device 100 may display Figure 2A The interface of the code scanning application shown in FIG. Among them, the detection operation can be clicking a code scanning button or a code scanning control, and the detection operation is used to trigger the code scanning application of the electronic device 100, such as Figure 2A The interface of the target detection program is displayed on the interface of the electronic device 100, and the interface includes an imaging screen 20 and a detection frame 30, that is, the electronic device 100 can perform imaging target detection based on the image displayed in the imaging screen 20.

[0072] It can be understood that the imaging screen 20 displays the image acquired by the first camera of the surrounding environment of the electronic device 100, and the display screen of the imaging screen 20 corresponds to the acquisition range of the first camera. That is, if the user moves the electronic device 100 or changes the angle of the electronic device 100, the imaging screen 20 changes accordingly.

[0073] In an embodiment of the present application, after the user performs a detection operation, the second camera can also capture the surrounding environment of the electronic device 100 to obtain an image. However, the image captured by the second camera is only used for imaging target detection and is not displayed on the interface of the electronic device 100.

[0074] It can be understood that after the electronic device 100 detects the imaging target based on the image displayed in the imaging screen 20 , it can automatically control the image displayed in the imaging screen 20 to be enlarged and moved so that the detected image of the imaging target is located within the detection frame 30 .

[0075] It should be noted that the above embodiment is only an embodiment in which the image captured by the first camera contains only one imaging target. In other optional embodiments, the image captured by the first camera may include multiple imaging targets. Accordingly, multiple detection boxes 30 can be displayed on the interface of the electronic device 100, corresponding to the multiple imaging targets respectively.

[0076] like Figure 2B As shown, after the user performs the detection operation, the electronic device 100 may display Figure 2B The interface of the target detection application is shown. The detection operation may be clicking a target detection button or a target detection control, and the detection operation is used to trigger the target detection application of the electronic device 100.

[0077] like Figure 2B , a detection category button 40 is displayed on the interface of the electronic device 100, and its corresponding detection categories include object recognition, document scanning, person recognition, translation, code scanning, and shopping; Figure 2B The imaging picture 20 shown includes a person 50, an object 60, and text 70. For example, in response to the user clicking the person recognition button in the detection category button 40, Figure 2B The person 50 shown is the imaging target; corresponding to the user clicking the object recognition button in the detection category button 40, Figure 2B The object 60 shown is the imaging target, corresponding to the user clicking the translation button in the detection category button 40, then Figure 2B The text 70 shown is the imaging target.

[0078] It should be noted that the detection category in the above embodiment is only an example, and in other optional embodiments, the detection category button 40 may also include buttons of other detection categories.

[0079] The following is an example of an electronic device 100 including a first camera and a second camera to introduce the image acquisition method mentioned in the embodiment of the present application. It can be understood that the electronic device 100 may include a smart phone, a desktop computer, a tablet computer, a laptop computer, a smart speaker, a digital assistant, an augmented reality (AR) / virtual reality (VR) device, a smart wearable device, and other types of electronic devices 100. Optionally, the operating system running on the electronic device 100 may include but is not limited to Android system, IOS system, Linux, Windows, etc.

[0080] For example, Figure 3 According to some embodiments of the present application, a first flow chart of an image acquisition method is shown. The execution subject of the flow is the electronic device 100. Figure 3 , an exemplary process of an image acquisition method in an embodiment of the present application includes:

[0081] S301: Detecting a collection instruction, controlling the first camera and the second camera to collect data, and displaying the collection screen of the first camera.

[0082] It can be understood that the acquisition instruction indicates the user's intention to use the camera function of the electronic device 100 to acquire and detect imaging targets in the surrounding environment of the electronic device 100 .

[0083] In an optional embodiment, the electronic device 100 detects that the user starts the code scanning program and can detect the instruction to capture the imaging target (ie, the graphic code). Figure 2A shown.

[0084] In an optional embodiment, the electronic device 100 can detect a collection instruction when it detects that the user starts a target detection application (such as a code scanning program) and clicks a detection button (such as a person recognition, object recognition, code scanning, translation, etc. button).

[0085] For example, Figure 2B , a detection category button 40 is displayed on the interface of the electronic device 100, and its corresponding detection categories include object recognition, document scanning, person recognition, translation, code scanning, and shopping; Figure 2B The imaging picture 20 shown includes a person 50, an object 60, and text 70. For example, in response to the user clicking the person recognition button in the detection category button 40, Figure 2B The person 50 shown is the imaging target; corresponding to the user clicking the object recognition button in the detection category button 40, Figure 2B The object 60 shown is the imaging target, corresponding to the user clicking the translation button in the detection category button 40, then Figure 2B The text 70 shown is the imaging target.

[0086] In other optional embodiments, the user may also perform the detection operation through other applications, such as a chat application, a shopping application, a video application, etc.

[0087] According to some embodiments, the first camera adopts an auto-focus method, and the focus strategy is from near to far; the second camera adopts an auto-focus method, and the focus strategy is from far to near. It can be understood that the focus point of the first camera can traverse from macro to infinity; the focus point of the second camera can traverse from infinity to macro.

[0088] Optionally, the second camera may include multiple cameras, wherein the focus strategy of each of the multiple second cameras may be different, for example, the focus strategy of the first second camera is from far to near, the focus strategy of the second second camera is from near to far, and the focus strategies of other second cameras are from the center of the image to near, from the center of the image to far, etc. The embodiment of the present application does not limit the focus strategy of each second camera.

[0089] In an optional embodiment, the first camera is a main camera of the electronic device 100, that is, a main camera, and the second camera is a non-main camera of the electronic device 100, that is, a non-main camera.

[0090] In some embodiments, the main camera may be a wide-angle camera having the highest pixel among all cameras of the electronic device 100 .

[0091] Optionally, the non-main camera may be an ultra-wide-angle camera, which may have a larger depth of field than the main camera, that is, the range of clear images in the imaging is larger.

[0092] In other embodiments, the second camera may also be a macro camera, etc. The embodiments of the present application do not limit the types of the first camera and the second camera.

[0093] It is understood that the first camera can capture the first captured image at a fixed frequency and send it for display. Wherein, sending it for display means displaying it on the display interface of the electronic device 100, for example, displaying it on a display such as Figure 2A On the imaging screen 20 shown.

[0094] In an optional embodiment, when the electronic device detects the acquisition instruction, it can control the first camera to acquire the first acquisition image and control the second camera to acquire the second acquisition image. The acquisition ranges of the first camera and the second camera can be the same range or different ranges. The first acquisition image and the part of the second acquisition image corresponding to the acquisition range of the first camera, that is, the part where the second acquisition image overlaps with the first acquisition image, can be detected to detect whether there is an imaging target therein.

[0095] As an example, the first acquired image or the second acquired image of N frames may be detected every N frames.

[0096] S302: Corresponding to the situation where no imaging target is detected in the image captured by the first camera and the imaging target is detected in the first image captured by the second camera with the first capturing parameters, the first capturing parameters are determined.

[0097] It can be understood that the first image is the second acquired image in which the imaging target is detected.

[0098] It can be understood that, as an example, when the imaging target is located in the far view in the imaging screen, and the focus of the first camera traverses from near to far, and the focus of the second camera traverses from far to near, then the second camera will focus on the imaging target before the first camera, that is, the condition is met: the imaging target is not detected in the image captured by the first camera, and the imaging target is detected in the first image currently captured by the second camera. For another example, when the imaging target is located in the near view in the imaging screen, and the focus of the first camera traverses from far to near, and the focus of the second camera traverses from near to far, then the second camera will also focus on the imaging target before the first camera, that is, the above condition is met.

[0099] In an optional embodiment, the first camera may capture multiple frames of first captured images at a fixed frequency, and every N frames of first captured images may be input into the detection model for detection to detect whether there is an imaging target in the N frames of first captured images, where N is an integer greater than or equal to 1.

[0100] It can be understood that during the detection process, the first camera can adjust the focus area in real time, capture the first captured image based on the continuously adjusted focus area, and perform detection based on the first captured image.

[0101] Optionally, the first acquired image may be scaled to obtain the scaled first acquired image, and detection may be performed based on the scaled first acquired image. It is understandable that the first acquired image may be proportionally enlarged, and the imaging target may be detected based on the enlarged first acquired image until the imaging target is detected or the maximum magnification threshold is reached, otherwise the magnification is increased, and the steps of "proportionally enlarging the first acquired image and detecting the imaging target based on the enlarged first acquired image" are repeated. For example, 2x, 3x, and 10x magnification are performed in sequence, and the magnification is not limited in the embodiment of the present application.

[0102] In an optional embodiment, the imaging target can be detected in the overlapping image of the second acquired image acquired by the second camera. It can be understood that the overlapping image is a part of the second acquired image, and the acquisition range of the overlapping image belongs to the acquisition range of the first acquired image, that is, only the part of the second acquired image that overlaps with the first acquired image needs to be detected. Optionally, when the acquisition range of the second camera includes the acquisition range of the first camera, the acquisition range of the overlapping image can be consistent with the acquisition range of the first acquired image; when the acquisition range of the second camera does not completely include the acquisition range of the first camera, the overlapping image can also be a part of the acquisition range of the first acquired image.

[0103] by Figure 2AFor example, the image range of the imaging image 20 is the acquisition range of the first camera. When the acquisition range of the second camera includes the acquisition range of the first camera, the range of the overlapping images is the range of the imaging image 20.

[0104] As an example, if the field of view angle of the image captured by the first camera is a first angle, the second captured image captured by the second camera can be cropped, and the cropped image can be detected; wherein the cropped image is the above-mentioned overlapping image, and the corresponding field of view angle is the above-mentioned first angle.

[0105] Optionally, the second camera may capture multiple frames of second captured images at a fixed frequency, and every N frames of second captured images, N frames of overlapping images may be input into the detection model for detection to detect whether there is an imaging target in the N frames of overlapping images, where N is an integer greater than or equal to 1.

[0106] It can be understood that the first acquired image is the second acquired image in which the imaging target is detected.

[0107] S303: Control the first camera to perform acquisition according to the first acquisition parameter to obtain a second image including the imaging target, and display the second image.

[0108] It can be understood that the first camera can acquire the first target image based on the second acquisition parameter, wherein the imaging target is located within the focus area of ​​the first target image. In other words, the first camera can focus on the imaging target based on the second acquisition parameter to obtain the first target image in which the image of the imaging target is sufficiently clear.

[0109] In an optional embodiment, the first acquisition parameter and the second acquisition parameter may be focus parameters respectively. As an example, the distance from the imaging target to the electronic device may be determined according to the first acquisition parameter; based on the distance from the imaging target to the electronic device, the second acquisition parameter required for the first camera to acquire the second image may be determined; and the first camera may be controlled to acquire the second image with the second acquisition parameter to obtain the second image including the imaging target.

[0110] Optionally, the first acquisition parameter may be the motor position when the second camera acquires the first acquisition image, and the second acquisition parameter may be the motor position required for the first camera to acquire the imaging target. It can be understood that the motor position determines the image distance and object distance of the camera, that is, determines the focus area or focus point position of the camera.

[0111] Optionally, based on the motor position when the second camera captures the first captured image, the distance between the imaging target and the electronic device 100 in the real environment, that is, the object distance corresponding to the imaging target, can be calculated. Then, based on the object distance corresponding to the imaging target, the motor position required for the first camera to capture the imaging target can be calculated.

[0112] In an optional embodiment, the distance between the imaging target and the electronic device can be obtained according to the motor position of the second camera and the parameters of the second camera, and further, the second acquisition parameter can be obtained based on the distance and the parameters of the first camera. Optionally, the second acquisition parameter can be the motor position of the first camera. When the motor of the first camera is at this motor position, the imaging target can be located within the focus area of ​​the first camera, so that a clear image of the imaging target can be obtained through the first camera.

[0113] Optionally, the first target image and the identification of the imaging target in the first target image may be displayed on the screen of the electronic device 100, for example, a dot identification may be displayed at the center of the image of the imaging target.

[0114] In an optional implementation, multiple imaging targets may be detected based on the first captured image captured by the second camera. In this implementation, in the interface of the electronic device 100, for example Figure 2A In the imaging screen 20, a detection mark, such as a dot mark, a detection frame, etc., is displayed at the image of each imaging target.

[0115] It is understood that in response to the user clicking the logo of the imaging target, the electronic device 100 can parse the imaging target. For example, when the imaging target is a QR code, the electronic device 100 can parse the QR code and implement the corresponding functions of the QR code, such as accessing a web page, making a payment, etc.

[0116] In the above embodiment, it can be understood that if the imaging target is first detected in the image captured by the second camera, it indicates that in the current scene, the target detection efficiency based on the second camera is higher. In this case, the detection result based on the second camera can be presented preferentially.

[0117] In an optional embodiment, corresponding to the imaging target being detected in the second captured image captured by the first camera, and the imaging target not being detected in the image captured by the second camera, the electronic device may control the second camera to stop capturing images. It can be understood that if the imaging target is first detected in the image captured by the first camera, it indicates that in the current scene, the target detection efficiency based on the first camera is higher. In this case, the detection result based on the first camera may be presented first, that is, the first camera is controlled to perform focus traversal according to its own focus strategy, and the image captured by the first camera is displayed in real time, and the second camera does not intervene in this.

[0118] In an optional example, corresponding to the first number of first imaging targets detected in the second acquisition image captured by the first camera, the second number of imaging targets detected in the first acquisition image captured by the second camera, and the second number being greater than the first number, the electronic device may display a detection frame of the second number of imaging targets. Then, after the electronic device detects that the user selects the imaging target to be captured from the detection frame of the second number of imaging targets, if the imaging target selected by the user is the imaging target detected in the second acquisition image, the electronic device may control the first camera to capture the target image of the imaging target; if the imaging target selected by the user is the imaging target detected in the first acquisition image and the imaging target is not detected in the second acquisition image, the electronic device may obtain the acquisition parameters required for the first camera to capture the imaging target based on the acquisition parameters used by the second camera when capturing the second acquisition image, and capture the target image of the imaging target based on the determined acquisition parameters.

[0119] Through an image acquisition method of an embodiment of the present application, a second camera other than the first camera can be used for target recognition. Since the first camera and the second camera adopt different focusing strategies, when the first camera does not recognize the imaging target but the second camera recognizes the imaging target, the first camera is controlled according to the acquisition parameters of the second camera to acquire a sufficiently clear first target image of the imaging target, thereby speeding up the speed at which the first camera recognizes the imaging target and improving the target recognition efficiency of the first camera.

[0120] In some embodiments, the acquisition ranges of the first camera and the second camera of the electronic device 100 are different, for example, the acquisition range of the second camera partially overlaps with the acquisition range of the first camera (hereinafter, the acquisition range in which the acquisition range of the second camera partially overlaps with the acquisition range of the first camera is referred to as the overlapping acquisition range). In this case, when the electronic device 100 detects the imaging target based on the image captured by the second camera, it can only detect in the image corresponding to the overlapping range in the image captured by the second camera (hereinafter referred to as the overlapping image), without detecting the image of other parts in the image captured by the second camera, which is conducive to further improving the efficiency of capturing clear images of the imaging target.

[0121] The following is based on Figure 4 Another exemplary process of an image acquisition method provided in an embodiment of the present application is introduced.

[0122] For example, Figure 4 According to some embodiments of the present application, a second flow diagram of an image acquisition method is shown. The execution subject of the flow is the electronic device 100. Figure 4, an exemplary process of an image acquisition method in an embodiment of the present application includes:

[0123] S401: Detecting a collection instruction, controlling the first camera and the second camera to collect data, and displaying the collection image of the first camera.

[0124] The content of step S401 can refer to the above Figure 3 The description of step S301 will not be repeated here.

[0125] S402: Corresponding to the situation where no imaging target is detected in the image captured by the first camera and the imaging target is detected in the first image captured by the second camera with the first capturing parameters, the first capturing parameters are determined.

[0126] The content of step S402 can refer to the above Figure 3 The description of step S302 will not be repeated here.

[0127] S403: Switching the displayed acquisition picture of the first camera to the acquisition picture of the second camera.

[0128] In some other optional embodiments, the collection picture of the first camera can be switched to the collection picture of the second camera, wherein the collection picture of the second camera displays the imaging target.

[0129] Optionally, the captured image of the second camera is a picture obtained by adjusting the image captured by the second camera and corresponding to the captured range of the first camera. In other words, the range of the captured image of the second camera displayed is consistent with the captured range of the first camera.

[0130] As an example, the captured image of the second camera displayed and the captured image of the first camera displayed before the switch have the same range of corresponding real environment. For example, if the field of view of the image captured by the first camera is a first angle, the image captured by the second camera can be cropped and the cropped image can be displayed; wherein the field of view corresponding to the cropped image is the first angle mentioned above.

[0131] In an optional embodiment, the number of imaging targets detected in the first image captured by the second camera is multiple. In this embodiment, multiple imaging targets can be displayed in the capture screen of the second camera. Figure 5B The interface shown in FIG. 1 shows two-dimensional codes 002 and 003. Then, the first imaging target selected by the user from the plurality of imaging targets can be identified. Figure 5B Select QR code 002 or QR code 003 to identify in order to access web pages, make payments, and other functions.

[0132] Optionally, the number of the first camera is one, and the number of the second camera is multiple. In this embodiment, if it is detected that there is an imaging target in the third image captured by the target camera among the multiple second cameras, the capture screen of the target camera is switched.

[0133] Through the embodiments of the present application, the characteristics of different cameras can be fully utilized to display the captured images of the camera with higher detection efficiency in the current scene, for example, the second camera mentioned above, thereby improving the efficiency of detecting imaging targets.

[0134] Please refer to Figure 5A-Figure 5B , the method of the embodiment of the present application is introduced below by taking the actual environment in front of the first camera and the second camera of the electronic device 100 as the environment near the parking lot gate, and the imaging target is a QR code as an example.

[0135] by Figure 5A , Figure 5B The imaging screens of the electronic device 100 are illustrated respectively, including a steering wheel 001 in the vehicle, a QR code 002 on a sign outside the windshield, and a QR code 003 on the wall behind the sign.

[0136] It can be understood that the first camera focuses based on a strategy from near to far, and the second camera focuses based on a strategy from far to near.

[0137] First, if Figure 5A The focus of the first camera is located nearby, such as the steering wheel 001 in the car. At this time, the image of the steering wheel 001 is clear, and the images of the QR code 002 and the QR code 003 are blurred.

[0138] At this time, the focus of the second camera is located far away, that is, the QR code 003 can be detected in the first captured image acquired by the second camera. In addition, since the second camera is an ultra-wide-angle camera with a large depth of field, the image of the QR code 002 in the first captured image is also clear. Therefore, the second camera can detect QR codes 002 and 003.

[0139] Then, based on the acquisition parameters of the second camera when acquiring the first acquisition image, the acquisition parameters of the first camera for acquiring the two-dimensional code 002 and the two-dimensional code 003 can be calculated, and the first camera can be controlled to acquire based on the calculated acquisition parameters, so as to obtain Figure 5B The first target image is shown.

[0140] like Figure 5BAs shown, the images of QR code 002 and QR code 003 are clear, and detection frames are displayed around the images of QR code 002 and QR code 003. The user can click the area in the detection frame to select the target QR code from QR code 002 and QR code 003 for recognition. Optionally, the detection frame can also be replaced by other recognition marks, such as a dot mark, an arrow mark, etc.

[0141] It can be understood that when the focus point of the second camera is located at a relatively far distance, such as near QR code 003, QR code 002 and QR code 003 can be identified from the first captured image, and then the first camera can adjust the focus and recognize the QR code according to its camera parameters, which can greatly improve the recognition efficiency of the QR code. In addition, when the first camera captures the first target image, the focus point is also located at a relatively far distance, that is, at or near QR code 003. At this time, since the focus area is far away, the depth of field of the first camera is also large, so the image of QR code 002 is also clear, that is, multiple QR codes in the distance can be recognized at the same time.

[0142] Please refer to Figure 6A-6B , the method of the embodiment of the present application is introduced below by taking the actual environment in front of the first camera and the second camera of the electronic device as a road and the imaging target as a person as an example.

[0143] Fig. 6A , Figure 6B The camera application program interface of the electronic device 100 is illustrated respectively, including pedestrians 04 and 05. The user can set the acquisition mode to the person recognition mode based on the camera application program interface to recognize the person in the acquisition picture.

[0144] It can be understood that the first camera focuses based on a strategy from near to far, and the second camera focuses based on a strategy from far to near.

[0145] First, if Fig. 6A , the focus of the first camera is located nearby, that is, at the pedestrian 04. At this time, the image of pedestrian 04 is clear, that is, pedestrian 04 can be immediately detected in the first captured image captured by the first camera.

[0146] Optionally, before the first camera recognizes the pedestrian 04, the second camera does not recognize the pedestrian 05. At this time, since the first camera has recognized the person, the second camera does not need to capture the second captured image, nor does it need to perform imaging target recognition on the second captured image.

[0147] In an optional embodiment, if the user wants to identify pedestrian 05, the user can Figure 6BThe camera application interface shown manually clicks on pedestrian 05 to make the first camera focus on pedestrian 05 in the distance, so that the electronic device 100 recognizes pedestrian 05 based on the first captured image.

[0148] refer to Figure 7 , the following combination Figure 7 An exemplary process of an embodiment of the present application is further introduced.

[0149] First, the code scanning program is started 701, and the electronic device 100 starts to collect images through the main camera and the ultra-wide-angle camera, that is, the bottom layer is notified to start the main camera and the ultra-wide-angle dual-channel output stream 702, and the main channel is sent to display and enters the code scanning process 703. It can be understood that the sending and display means displaying on the screen of the electronic device 100. The ultra-wide-angle output stream is not sent to display, and the image is detected by the QR code within the field of view (FOV) shared with the main camera 704.

[0150] If the ultra-wide-angle camera is auto-focusing, the focus point is traversed from infinity to macro; if the ultra-wide-angle camera is fixed focus, the focus point does not change, and then the data of every N frames is sent to the QR code detection algorithm for detection 705. For example, the focus point is traversed from infinity to macro, an image is obtained, and an image magnified X times, and the above image is detected. After the image is magnified to X times 706, it is determined whether the QR code information is detected in the ultra-wide-angle image 707. If not, continue to complete the main road scanning process 708. If so, the motor position corresponding to the image where the QR code is detected is recorded 709.

[0151] At this time, it can be determined whether the main camera has detected the QR code at that time 710. If so, the QR code detection process 718 is completed. If not, the motor position is converted into the object distance and transmitted to the main camera 712. The main camera converts the object distance into the target position of the main camera motor and controls the motor to move from the current focus position to the target position 713. Then, it is determined whether the number of QR codes detected by the ultra-wide angle is greater than 1 714. If so, N optional QR codes are displayed 715, and the user clicks to select a QR code 716, that is, the QR code to be scanned is determined according to the user's selection, and then the QR code detection process 718 is completed. If not, 1 QR code is displayed 717, and then the QR code detection process 718 is completed.

[0152] Figure 8 A schematic diagram of the hardware structure of the electronic device 100 is shown.

[0153] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0154] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0155] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0156] A memory may also be provided in the processor 110 for storing instructions and data corresponding to an image acquisition method provided in an embodiment of the present application. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.

[0157] In some embodiments, the processor 110 of the electronic device 100 is used to execute the image acquisition method mentioned in the present application according to the obtained program instructions by calling the program instructions stored in the memory. For example: when an acquisition instruction is detected, the first camera and the second camera are controlled to acquire, and the acquisition screen of the first camera is displayed; corresponding to the imaging target not being detected in the image acquired by the first camera, and the imaging target being detected in the first image acquired by the second camera with the first acquisition parameter; the first camera is controlled to acquire according to the first acquisition parameter to obtain a second image including the imaging target, and the second image is displayed. For another example: when an acquisition instruction is detected, the first camera and the second camera are controlled to acquire, and the acquisition screen of the first camera is displayed; corresponding to the imaging target not being detected in the image acquired by the first camera, and the imaging target being detected in the third image acquired by the second camera; the acquisition screen of the displayed first camera is switched to the acquisition screen of the second camera, wherein the imaging target is displayed in the acquisition screen of the second camera.

[0158] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0159] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0160] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0161] The electronic device 100 can implement the acquisition function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0162] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the captured scene. In some embodiments, ISP can be set in camera 193.

[0163] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0164] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0165] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key. It may also be a touch key, such as a capture key of a camera application. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0166] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.

[0167] Fig. 9 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0168] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0169] The application layer can include a series of application packages. Figure 8 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, dual SIM and mobile network. Among them, the user can capture images and record videos in real time by waking up the camera application or scanning the code application.

[0170] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0171] like Fig. 9 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0172] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0173] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0174] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0175] Accordingly, an embodiment of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device, and a processor for executing instructions of the above-mentioned image acquisition method.

[0176] Accordingly, an embodiment of the present application provides a storage medium on which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the above-mentioned image acquisition method.

[0177] Accordingly, an embodiment of the present application provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip is running, the above-mentioned image acquisition method is implemented.

[0178] This specification provides method or process operation steps as shown in the embodiments or flow charts, but more or fewer operation steps may be included based on routine or non-creative work. The order of steps listed in the embodiments is only one of many execution orders and does not represent the only execution order. In actual execution, the method or process shown in the embodiments or drawings may be executed in sequence or in parallel (for example, in a parallel controller or multi-threaded processing environment).

[0179] The embodiments disclosed in the present application may be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application may be implemented as a computer program or program code executed on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.

[0180] Program code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0181] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0182] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including, but not limited to, floppy disks, optical disks, optical discs, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Therefore, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).

[0183] As used herein, the term "module" may refer to, be a part of, or include: a memory (shared, dedicated, or group) for running one or more software or firmware programs, an application-specific integrated circuit (ASIC), an electronic circuit and / or processor (shared, dedicated, or group), a combinational logic circuit, and / or other suitable components that provide the functionality.

[0184] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order is not required. Instead, in some embodiments, these features may be described in a manner and / or order different from that shown in the illustrative drawings. In addition, the structural or method features included in a specific figure do not mean that all embodiments need to include such features. In some embodiments, these features may not be included, or these features may be combined with other features.

[0185] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the use of the technical solution of the present application is not limited to the various applications mentioned in the embodiments of the present patent. Various structures and variations can be easily implemented with reference to the technical solution of the present application to achieve the various beneficial effects mentioned herein. Various changes made within the knowledge of ordinary technicians in the field without departing from the purpose of the present application should all fall within the scope of the patent application.

Claims

1. An image acquisition method, applied to an electronic device, characterized in that: The electronic device includes a first camera and a second camera, the first camera is a main camera, the first camera and the second camera have different depth of field ranges for capturing images, the first camera captures images based on a first focus strategy, the second camera captures images based on a second focus strategy, and the first focus strategy and the second focus strategy are different; and The method comprises: Detecting a collection instruction, controlling the first camera and the second camera to collect data, and displaying the collection image of the first camera; Corresponding to that no imaging target is detected in the image captured by the first camera, and an imaging target is detected in the first image captured by the second camera with the first acquisition parameter, wherein the imaging target includes a graphic code; Controlling the first camera to perform acquisition according to the first acquisition parameter to obtain a second image including the imaging target, and displaying the second image; The imaging target in the second image is analyzed.

2. The method according to claim 1, characterized in that: The first focusing strategy is to collect multiple images from the focus point near to far, and the second focusing strategy is to collect multiple images from the focus point far to near; The distance between the imaging target and the electronic device is greater than a preset distance.

3. The method according to claim 1, characterized in that: The detecting that an imaging target exists in a first image acquired by the second camera with a first acquisition parameter includes: A plurality of images captured by the second camera and having a capture range corresponding to the capture range of the first camera are detected to detect a first image containing the imaging target.

4. The method according to claim 1, characterized in that: The controlling the first camera to perform acquisition according to the first acquisition parameter to obtain a second image including the imaging target, and displaying the second image includes: Determining the distance from the imaging target to the electronic device according to the first acquisition parameter; Determining, based on the distance from the imaging target to the electronic device, a second acquisition parameter required for the first camera to acquire the second image; The first camera is controlled to perform acquisition with the second acquisition parameter to obtain a second image including the imaging target.

5. The method according to claim 4, characterized in that The first acquisition parameter and the second acquisition parameter are focus parameters respectively.

6. The method according to claim 1, characterized in that The method further comprises: In response to detecting the imaging target in the image captured by the first camera, the second camera is controlled to stop capturing images.

7. The method according to claim 1, characterized in that A plurality of imaging targets are displayed in the second image, and the method further comprises: A first imaging target selected by a user from among the plurality of imaging targets is identified.

8. The method according to any one of claims 1 to 7, characterized in that: The number of the first camera is one, and the number of the second camera is multiple, The detecting that an imaging target exists in a first image acquired by the second camera with a first acquisition parameter includes: It is detected that an imaging target exists in a first image captured by a second camera among the plurality of second cameras using a first capture parameter.

9. The method according to any one of claims 1 to 7, characterized in that: The first camera is a wide-angle camera, and the second camera is an ultra-wide-angle camera.

10. An image acquisition method, applied to an electronic device, characterized in that: The electronic device includes a first camera and a second camera, the first camera is a main camera, the first camera and the second camera have different depth of field ranges for capturing images, the first camera captures images based on a first focus strategy, the second camera captures images based on a second focus strategy, and the first focus strategy and the second focus strategy are different; and The method comprises: Detecting a collection instruction, controlling the first camera and the second camera to collect data, and displaying the collection image of the first camera; Corresponding to the imaging target not being detected in the image captured by the first camera, and the imaging target being detected in the third image captured by the second camera, wherein the imaging target includes a graphic code; Switching the displayed acquisition picture of the first camera to the acquisition picture of the second camera, wherein the acquisition picture of the second camera displays the imaging target; The imaging target in the third image is analyzed.

11. The method according to claim 10, characterized in that The collection screen of the second camera is: A picture corresponding to the acquisition range of the first camera is obtained by adjusting the image acquired by the second camera.

12. The method according to claim 10, characterized in that The first focusing strategy is to capture multiple images with the focus point from near to far, and the second focusing strategy is to capture multiple images with the focus point from far to near.

13. The method according to claim 10, characterized in that The detecting that an imaging target exists in the third image captured by the second camera includes: A plurality of images captured by the second camera and having a capture range corresponding to the capture range of the first camera are detected to detect a third image containing the imaging target.

14. The method according to claim 10, characterized in that There are multiple imaging targets, and the capture image of the second camera displays multiple imaging targets; The performing analysis processing on the imaging target in the third image includes: A parsing process is performed on a first imaging target selected by a user from the plurality of imaging targets.

15. The method according to any one of claims 10 to 14, characterized in that: The number of the first camera is one, and the number of the second camera is multiple, The detecting that an imaging target exists in a third image captured by the second camera includes: Detecting that an imaging target exists in a third image captured by a target camera among the plurality of second cameras; The switching to the collection picture of the second camera includes: Switch to the acquisition screen of the target camera.

16. The method according to any one of claims 10 to 14, characterized in that: The first camera is a wide-angle camera, and the second camera is an ultra-wide-angle camera.

17. An electronic device, characterized in that: include: a memory for storing instructions to be executed by one or more processors of the electronic device, and A processor, when the processor executes the instructions in the memory, can enable the electronic device to execute the method described in any one of claims 1-9 or 10-16.

18. A storage medium, characterized in that: The storage medium stores instructions, which, when executed on an electronic device, enable the electronic device to execute the method according to any one of claims 1 to 9 or 10 to 16.

Citation Information

Patent Citations

  • Focusing method and terminal

    CN104410783A

  • Terminal, focusing method and device based on double cameras

    CN105530421A

  • Focusing method and mobile terminal

    CN106331484A

  • Dual-camera focusing method and device, and electronic device

    CN107483822A

  • Scanning image acquisition method and mobile terminal

    CN110519503A