Focusing method and device and electronic equipment
By displaying multiple preview interfaces on electronic devices and controlling the camera focus using different focal lengths, the focusing problem when shooting distant objects with telephoto cameras is solved, achieving fast and accurate shooting results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- VIVO MOBILE COMM CO LTD
- Filing Date
- 2026-03-18
- Publication Date
- 2026-04-28
AI Technical Summary
When electronic devices use telephoto lenses to shoot distant objects, they require a longer focusing time, which affects shooting performance.
By displaying a first preview interface and a second preview interface, the third camera is controlled to perform pre-focusing using the first focal length and the second focal length, including determining the object distance and image distance, and adjusting the lens position to focus.
It reduces waiting time, improves the efficiency and accuracy of shooting distant objects, and optimizes shooting performance.
Smart Images

Figure CN121940639A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of camera technology, specifically relating to a focusing method, device, and electronic device. Background Technology
[0002] Currently, users can install an external lens on the telephoto camera of an electronic device and point the telephoto camera and external lens at a distant subject. This allows the electronic device to capture and display a telephoto preview image. When the subject appears in the telephoto preview image, the electronic device can focus on the subject based on the image information in the telephoto preview image and capture an image containing the subject.
[0003] However, since it is difficult for electronic devices to focus on the subject based on the image information in the telephoto preview image, it may take a long time to complete the focusing process on the distant subject. As a result, the waiting time before capturing an image that includes the subject is long, which affects the shooting performance of electronic devices when shooting distant subjects. Summary of the Invention
[0004] The purpose of this application is to provide a focusing method, apparatus, and electronic device that enables the electronic device to directly capture an image when the subject appears in a telephoto preview image, without waiting for the electronic device to perform focusing processing based on the image information in the telephoto preview image. In other words, it does not require a long waiting time. Therefore, it can reduce the waiting time required before capturing an image that includes a distant subject, thereby optimizing the shooting performance of the electronic device when shooting distant subjects.
[0005] In a first aspect, embodiments of this application provide a focusing method, the method comprising: an electronic device displaying a first preview interface and a second preview interface; the first preview interface including a preview image captured by a first camera based on a first focal length; the first preview interface including an object to be photographed; the second preview interface including preview images captured by a second camera and a third camera based on a second focal length; the second preview interface not including the object to be photographed; and controlling the third camera to perform focusing processing on the object to be photographed based on the first focal length and the second focal length.
[0006] In some embodiments of this application, the above-mentioned control of the third camera to focus on the object to be photographed based on the first focal length and the second focal length includes: the electronic device determining the object distance between the object to be photographed and the electronic device based on the first focal length and the image distance of the first camera; determining the image distance of the third camera based on the object distance and the second focal length; and controlling the lens movement of the third camera based on the image distance of the third camera to focus on the object to be photographed.
[0007] In some embodiments of this application, the above-mentioned display of the first preview interface and the second preview interface includes: the electronic device displays the first preview interface; and when the third camera is connected to the electronic device, the second preview interface is displayed on a first area of the first preview interface; wherein the image content in the first area is the same as the image content in the second preview interface.
[0008] In some embodiments of this application, the first preview interface includes at least two candidate objects; before the third camera is controlled to focus on the object to be photographed based on the first focal length and the second focal length, the method further includes: the electronic device determines the probability score of each candidate object based on the motion parameters of each candidate object in the first preview interface, the area where each candidate object is located in the first preview interface, and the first area; the probability score represents the probability that a candidate object is the object to be photographed that satisfies the user's shooting intention; and the candidate object with the highest probability score among the at least two candidate objects is determined as the object to be photographed; wherein the image content in the first area is the same as the image content in the second preview interface.
[0009] In some embodiments of this application, the aforementioned motion parameters include motion direction and motion speed; the determination of the probability score for each candidate object based on its motion parameters in the first preview interface, the area it occupies in the first preview interface, and the first area includes: the electronic device determining the on-screen probability based on the candidate object's motion direction in the first preview interface, the area it occupies in the first preview interface, and the first area; the on-screen probability is the probability that the candidate object enters the second preview interface; and determining the on-screen time based on the candidate object's motion speed in the first preview interface, the area it occupies in the first preview interface, and the first area; the on-screen time is the time the candidate object enters the second preview interface; and calculating the probability score based on the on-screen probability, the on-screen time, and the area size; the area size is the size of the area where the candidate object occupies in the first preview interface.
[0010] In some embodiments of this application, determining the on-screen probability based on the movement direction of the candidate object in the first preview interface, the area it occupies in the first preview interface, and the first area includes: the electronic device predicting the maximum overlap size between the candidate object and the first area based on the movement direction of the candidate object in the first preview interface, the area coordinate information of the area it occupies in the first preview interface, and the area coordinate information of the first area; the area coordinate information includes the coordinate information of at least one reference point in the area; and the ratio of the maximum overlap size to the area size is determined as the on-screen probability.
[0011] In some embodiments of this application, determining the entry time based on the movement speed of the candidate object in the first preview interface, the area it occupies in the first preview interface, and the first area includes: the electronic device predicting the time when the candidate object enters the first area based on the movement speed of the candidate object in the first preview interface, the area coordinate information of the area it occupies in the first preview interface, and the area coordinate information of the first area; the area coordinate information includes the coordinate information of at least one reference point in the area; and determining the time when the candidate object enters the first area as the entry time.
[0012] In some embodiments of this application, the first preview interface includes at least two candidate objects; before controlling the third camera to focus on the object to be photographed based on the first focal length and the second focal length, the method further includes: the electronic device receiving the user's selection input of the target candidate object among the at least two candidate objects; and in response to the selection input, determining the target candidate object as the object to be photographed.
[0013] In some embodiments of this application, after controlling the third camera to focus on the object to be photographed based on the first focal length and the second focal length, the method further includes: the electronic device determining the shooting time; the shooting time being the time when the object to be photographed enters the second preview interface; and controlling the second camera and the third camera to capture images when the system time of the electronic device matches the shooting time.
[0014] In some embodiments of this application, before controlling the second and third cameras to capture images, the method further includes: the electronic device outputting shooting prompt information; the shooting prompt information is used to prompt the object to be photographed to enter the second preview interface; and receiving the user's shooting input; the control of the second and third cameras to capture images includes: the electronic device responding to the shooting input to control the second and third cameras to capture images.
[0015] In some embodiments of this application, the third camera described above is detachably connected to the electronic device.
[0016] Secondly, embodiments of this application provide a focusing device, comprising: a display module for displaying a first preview interface and a second preview interface; the first preview interface includes a preview image captured by a first camera based on a first focal length; the first preview interface includes an object to be photographed; the second preview interface includes preview images captured by a second camera and a third camera based on a second focal length; the second preview interface does not include the object to be photographed. A control module is used to control the third camera to perform focusing processing on the object to be photographed based on the first focal length and the second focal length.
[0017] In some embodiments of this application, the focusing device provided in this application further includes: a determining module, configured to determine the object distance between the object to be photographed and the focusing device based on a first focal length and the image distance of the first camera; and to determine the image distance of the third camera based on the object distance and a second focal length. Specifically, the control module is configured to control the lens movement of the third camera based on the image distance of the third camera determined by the determining module, so as to perform focusing processing on the object to be photographed.
[0018] In some embodiments of this application, the above-mentioned display module is specifically used to display a first preview interface; and when the third camera is connected to the focusing device, a second preview interface is displayed on a first area of the first preview interface; wherein the image content in the first area is the same as the image content in the second preview interface.
[0019] In some embodiments of this application, the first preview interface includes at least two candidate objects; the focusing device provided in this application further includes: a determining module, configured to determine the probability score of each candidate object based on the motion parameters of each candidate object in the first preview interface, the area where each candidate object is located in the first preview interface, and the first area before the control module controls the third camera to perform focusing processing on the object to be photographed based on the first focal length and the second focal length; the probability score represents the probability that a candidate object is the object to be photographed that satisfies the user's shooting intention; and determine the candidate object with the highest probability score among the at least two candidate objects as the object to be photographed; wherein the image content in the first area is the same as the image content in the second preview interface.
[0020] In some embodiments of this application, the aforementioned motion parameters include motion direction and motion speed; the aforementioned determining module is specifically used to determine the probability of being on camera based on the motion direction of the candidate object in the first preview interface, the area it occupies in the first preview interface, and the first area; the probability of being on camera is the probability of the candidate object entering the second preview interface; and to determine the time of being on camera based on the motion speed of the candidate object in the first preview interface, the area it occupies in the first preview interface, and the first area; the time of being on camera is the time when the candidate object enters the second preview interface; and to calculate a probability score based on the probability of being on camera, the time of being on camera, and the area size; the area size is the size of the area where the candidate object occupies in the first preview interface.
[0021] In some embodiments of this application, the aforementioned determining module is specifically used to predict the maximum overlap size between the candidate object and the first region based on the movement direction of the candidate object in the first preview interface, the region coordinate information of the area where the candidate object is located in the first preview interface, and the region coordinate information of the first region; the region coordinate information includes the coordinate information of at least one reference point in the region; and the ratio of the maximum overlap size to the region size is determined as the probability of being in the shot.
[0022] In some embodiments of this application, the aforementioned determining module is specifically used to predict the time when the candidate object enters the first area based on the candidate object's movement speed in the first preview interface, the area coordinate information of the area in the first preview interface, and the area coordinate information of the first area; the area coordinate information includes the coordinate information of at least one reference point in the area; and the time when the candidate object enters the first area is determined as the entry time.
[0023] In some embodiments of this application, the first preview interface includes at least two candidate objects; the focusing device provided in this application further includes: a receiving module, used to receive a user's selection input of a target candidate object from at least two candidate objects before the control module controls the third camera to perform focusing processing on the object to be photographed based on a first focal length and a second focal length; and a determining module, used to determine the target candidate object as the object to be photographed in response to the selection input received by the receiving module.
[0024] In some embodiments of this application, the focusing device provided in this application further includes: a determining module, used to determine the shooting time after the control module controls the third camera to focus on the object to be photographed based on the first focal length and the second focal length; the shooting time is the time when the object to be photographed enters the second preview interface; the control module is also used to control the second camera and the third camera to capture images when the system time of the focusing device matches the shooting time determined by the determining module.
[0025] In some embodiments of this application, the focusing device provided in this application further includes: an output module, used to output shooting prompt information before the control module controls the second camera and the third camera to capture images; the shooting prompt information is used to prompt the object to be photographed to enter the second preview interface; a receiving module, used to receive the user's shooting input; the aforementioned control module is specifically used to control the second camera and the third camera to capture images in response to the shooting input received by the receiving module.
[0026] In some embodiments of this application, the third camera is detachably connected to the focusing device.
[0027] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions implementing the steps of the method as described in the first aspect when executed by the processor.
[0028] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method as described in the first aspect.
[0029] Fifthly, embodiments of this application provide a chip including a processor and a communication interface coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0030] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method as described in the first aspect.
[0031] In this embodiment of the application, the electronic device can display a first preview interface and a second preview interface. The first preview interface includes a preview image captured by a first camera based on a first focal length, and the first preview interface includes the object to be photographed. The second preview interface includes preview images captured by a second camera and a third camera based on a second focal length, and the second preview interface does not include the object to be photographed. Based on the first focal length and the second focal length, the third camera is controlled to focus on the object to be photographed. Since the electronic device can control the third camera to focus on the subject in advance based on the first and second focal lengths when the subject is displayed in the first preview interface but not in the second preview interface (i.e., when the user needs to use the second and third cameras to shoot the subject, but the user has not yet pointed the second and third cameras at the subject), the electronic device can directly control the second and third cameras to capture images when the subject appears in the second preview interface, without waiting for the electronic device to focus based on the image information in the second preview interface. This reduces the waiting time required before capturing images of distant subjects, thus optimizing the shooting performance of the electronic device when shooting distant subjects. Attached Figure Description
[0032] Figure 1 This is a flowchart illustrating a focusing method provided in some embodiments of this application;
[0033] Figure 2A These are schematic diagrams of the structure of an electronic device provided in some embodiments of this application;
[0034] Figure 2B These are schematic diagrams of the structure of an electronic device provided in some embodiments of this application;
[0035] Figure 3 This is a flowchart illustrating a focusing method provided in some embodiments of this application;
[0036] Figure 4A These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0037] Figure 4B These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0038] Figure 5A These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0039] Figure 5B These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0040] Figure 6 This is a flowchart illustrating a focusing method provided in some embodiments of this application;
[0041] Figure 7 This is a flowchart illustrating a focusing method provided in some embodiments of this application;
[0042] Figure 8A These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0043] Figure 8B These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0044] Figure 9 This is a flowchart illustrating a focusing method provided in some embodiments of this application;
[0045] Figure 10A These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0046] Figure 10B These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0047] Figure 11 This is a flowchart illustrating a focusing method provided in some embodiments of this application;
[0048] Figure 12A These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0049] Figure 12B These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0050] Figure 13A These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0051] Figure 13B These are schematic diagrams of mobile phone interfaces provided in some embodiments of this application;
[0052] Figure 14 These are schematic diagrams of the focusing device provided in some embodiments of this application;
[0053] Figure 15 These are schematic diagrams of the hardware structure of electronic devices provided in some embodiments of this application;
[0054] Figure 16 These are schematic diagrams of the hardware structure of electronic devices provided in some embodiments of this application. Detailed Implementation
[0055] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0056] The following will explain the technical terms used in this application.
[0057] Field of View (FOV): refers to the maximum area of an image that a camera can see. FOV is usually measured in angles.
[0058] Region of Interest (ROI): This refers to the area that the user wants to focus on.
[0059] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0060] The terms "at least one," "at least one of," etc., used in the specification and claims of this application refer to any one, any two, or a combination of two or more of the included items. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more items, and its meaning is similar to that of "at least one."
[0061] The focusing method, apparatus, and electronic device provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0062] It should be noted that the focusing method provided in this application can be executed by electronic devices such as mobile phones, tablets, laptops, PDAs, and in-vehicle electronic devices. Some embodiments of this application use electronic devices as the executing entity to illustrate the focusing method provided in this application.
[0063] The focusing method provided in this application can be applied to scenarios where users use electronic devices to photograph objects at a distance.
[0064] One specific application scenario is when a user uses an electronic device to photograph a bird at a distance, and another specific application scenario is when a user uses an electronic device to photograph a person at a distance.
[0065] Figure 1 A schematic flowchart of the focusing method provided in an embodiment of this application is shown. Figure 1 As shown, the focusing method provided in this application embodiment may include the following steps 101 and 102.
[0066] Step 101: The electronic device displays the first preview interface and the second preview interface.
[0067] In this embodiment of the application, the first preview interface includes a preview image captured by the first camera based on a first focal length; the first preview interface includes the object to be photographed; the second preview interface includes preview images captured by the second camera and the third camera based on a second focal length; the second preview interface does not include the object to be photographed.
[0068] In some embodiments of this application, the field of view (FOV) of the first camera is greater than that of the second camera. The first camera may include, but is not limited to, the main camera of the electronic device, and the second camera may include, but is not limited to, a telephoto camera of the electronic device.
[0069] In some embodiments of this application, the third camera described above can be used to improve the clarity of the preview image of the second camera at high magnification and / or the clarity of the captured image of the second camera at high magnification. The third camera may include, but is not limited to, an external lens or a teleconverter.
[0070] It should be noted that the aforementioned "high magnification" can be understood as a magnification greater than or equal to a preset magnification. For example, assuming the preset magnification is 20x, then "high magnification" can be understood as any magnification greater than 20x.
[0071] In some embodiments of this application, the third camera described above is detachably connected to the electronic device.
[0072] In some examples, the aforementioned third camera can be snapped onto an electronic device, or detachably connected to an electronic device via screws, or detachably connected to an electronic device via magnets.
[0073] In some examples, the aforementioned third camera can also communicate with electronic devices. This communication connection may include, but is not limited to, a wireless network connection or a data cable connection.
[0074] For example, let's assume the electronic device is a mobile phone. Figure 2A and Figure 2B A schematic diagram of the electronic device is shown. (For example...) Figure 2A As shown, the mobile phone includes a first camera 10 and a second camera 11. Therefore, in scenarios where a user is using the mobile phone to photograph a distant object, a third camera can be installed on the phone, allowing the third camera to be detachably connected to the phone. Figure 2B As shown, a user can install a third camera 12 on the phone, allowing the third camera 12 to be detachably connected to the phone. The optical axis of the lens of the third camera 12 can be aligned with the optical axis of the lens of the second camera. This means the phone can capture preview images using both the second and third cameras 12. Similarly, the phone can capture preview images using the first camera 10 and display them in a first preview interface, and capture preview images using both the second and third cameras 12 and display them in a second preview interface. It should be noted that... Figure 2B The second camera is obscured by the third camera 12 and is not shown. The exact location of the second camera can be found in [reference needed]. Figure 2A As shown in the image.
[0075] Thus, since the third camera is detachably connected to the electronic device, when a user wants to shoot a distant subject, the third camera can be installed on the electronic device so that the electronic device can shoot the distant subject through both the second and third cameras. Alternatively, when a user wants to shoot a medium-distance subject, the third camera can be removed from the electronic device so that the electronic device can shoot the medium-distance subject through the second camera. Therefore, the electronic device can be adapted to different shooting scenarios, thus optimizing the shooting performance of the electronic device.
[0076] In some embodiments of this application, the user can first trigger the electronic device to display a settings application interface, which includes a "predictive capture function" control. The user can then select and input the "predictive capture function" control to enable the predictive capture function on the electronic device. The user can then trigger the electronic device to display a first preview interface, so that when the third camera is connected to the electronic device, the electronic device can capture a preview image using the first camera based on a first focal length and display the preview image captured by the first camera in the first preview interface. The user can also capture preview images using the second and third cameras based on a second focal length and display a second preview interface, which includes the preview images captured by the second and third cameras.
[0077] In some embodiments of this application, the first focal length is the focal length of the first camera. The second focal length can be the focal length of the third camera, or an equivalent focal length of the third camera and the second camera.
[0078] It should be noted that the method for determining the equivalent focal length can be found in the specific descriptions in related technologies, and will not be repeated here in the embodiments of this application.
[0079] In some embodiments of this application, the objects to be photographed may include, but are not limited to, people, scenery, and animals.
[0080] In some embodiments of this application, the inclusion of the subject to be photographed in the first preview interface can be understood as the subject being photographed being located within the field of view (FOV) of the first camera, and the exclusion of the subject to be photographed in the second preview interface can be understood as the subject being photographed not being located within the combined FOV of the second and third cameras, i.e., the user has not yet pointed the second and third cameras at the subject to be photographed.
[0081] It is understandable that the subject to be photographed has not yet moved into the combined FOV of the second and third cameras, meaning that the subject has not yet moved into the second preview interface.
[0082] In some embodiments of this application, the electronic device may display a first preview interface and a second preview interface in different areas of the electronic device, or the electronic device may display a second preview interface on the first preview interface.
[0083] In some embodiments of this application, combined with Figure 1 ,like Figure 3 As shown, step 101 can be implemented through steps 101a and 101b below.
[0084] Step 101a: The electronic device displays the first preview interface.
[0085] In some examples, the electronic device can display a first preview interface even when the third camera is not connected to the electronic device. This connection may include at least one of the following: a detachable connection, or a communication connection.
[0086] For example, a user uses their phone to photograph a bird at a distance. Figure 4A A schematic diagram of the phone's interface is shown. This is illustrated when the third camera is not connected to the phone, such as... Figure 4A As shown, the mobile phone can display a first preview interface 13, which includes a preview image 14 captured by the first camera based on a first focal length. The first preview interface 13 includes the object to be photographed, such as a bird 15. In other words, the preview image 14 includes the bird 15.
[0087] For example, a user takes a picture of a person at a distance using their mobile phone. Figure 4B A schematic diagram of the phone's interface is shown. This is illustrated when the third camera is not connected to the phone, such as... Figure 4B As shown, the mobile phone can display a first preview interface 16, which includes a preview image 17 captured by the first camera based on a first focal length. The first preview interface 16 includes the subject to be photographed, such as a little boy 18. In other words, the preview image 17 includes the little boy 18.
[0088] Step 101b: When the electronic device is connected to the third camera, the second preview interface is displayed in the first area of the first preview interface.
[0089] In this embodiment of the application, the image content in the first area is the same as the image content in the second preview interface.
[0090] In some examples, the electronic device may first determine the first area from the first preview interface, and then display the second preview interface on the first area.
[0091] Optionally, in one example, the electronic device can search for image content that is the same as the image content in the preview image in the first preview interface based on the image content in the second preview interface, and determine the area where the same image content is located as the first area.
[0092] Alternatively, in another example, the electronic device can first determine the coordinate information of the first center point in the first preview interface based on the relative positional relationship between the first camera and the second camera on the electronic device. Then, based on the ratio of the FOV of the first camera to the combined FOV, it can determine the ratio of the interface size of the first preview interface to the interface size of the second preview interface. Thus, the electronic device can calculate the interface size of the second preview interface based on the ratio and the interface size of the first preview interface, and determine the first region with the coordinate information of the first center point as the center and the interface size of the second preview interface as the region size.
[0093] It can be understood that when the subject to be photographed in the first preview interface moves to the first area, the subject to be photographed appears in the second preview interface, that is, the subject to be photographed appears in the above combined FOV.
[0094] In some examples, the electronic device can overlay a second preview interface on the first area mentioned above.
[0095] For example, combined with Figure 4A ,like Figure 5AAs shown, when the third camera is connected to the phone, the phone can display a "predictive capture" control 19 in the first preview interface 13. This "predictive capture" control 19 instructs the phone to enable the predictive capture function, and displays a second preview interface 21 in the first area 20. This second preview interface 21 does not include... Figure 4A The bird 15 in the first preview interface 13.
[0096] Further examples illustrate this, combined with Figure 4B ,like Figure 5B As shown, when the third camera is connected to the phone, the phone can display a "predictive capture" control 22 in the first preview interface 16. This "predictive capture" control 22 instructs the phone to enable the predictive capture function, and displays a second preview interface 24 in the first area 23. The second preview interface 24 does not include... Figure 4B The little boy 18 in the first preview screen 16.
[0097] Thus, since the electronic device can first display a first preview interface, and when the third camera is connected to the electronic device (i.e., when the user may need to use the second and third cameras to photograph the subject), a second preview interface is displayed in the first area. The image content in the first area is the same as the image content in the second preview interface. In other words, when the subject moves to the first area, the subject will also appear in the second preview interface. Therefore, the user can accurately adjust the orientation of the second and third cameras based on the relative position of the subject in the first area and the first preview interface, so that the subject appears quickly and accurately in the second preview interface. This avoids the user having to adjust the orientation of the second and third cameras multiple times, thereby simplifying the user's operation during the shooting process and improving shooting efficiency.
[0098] Step 102: The electronic device controls the third camera to focus on the subject based on the first focal length and the second focal length.
[0099] In some embodiments of this application, the above-mentioned control of the third camera to focus on the object to be photographed can be understood as: when the object to be photographed does not appear in the second preview interface, the electronic device controls the third camera to focus on the object to be photographed in advance.
[0100] In some embodiments of this application, the electronic device can determine the image distance of the third camera based on the first focal length and the second focal length, and adjust the position of the lens of the third camera according to the image distance of the third camera to adjust the position of the focus in the second preview interface, so as to control the third camera to perform focusing processing on the object to be photographed.
[0101] In some embodiments of this application, combined with Figure 1 ,like Figure 6 As shown, step 102 can be implemented through steps 102a to 102c as described below.
[0102] Step 102a: The electronic device determines the object distance between the object to be photographed and the electronic device based on the first focal length and the image distance of the first camera.
[0103] In some examples, the electronic device first calculates the image distance of the first camera based on the autofocus algorithm, and then determines the object distance between the object to be photographed and the electronic device based on the first focal length and the image distance of the first camera.
[0104] It should be noted that for the explanation of the autofocus algorithm, please refer to the specific description in the relevant technology, and the embodiments of this application will not be repeated here.
[0105] In some examples, the electronic device can use a first algorithm to calculate the object distance between the object to be photographed and the first camera based on a first focal length and the image distance of the first camera, and determine the object distance between the object to be photographed and the first camera as the object distance between the object to be photographed and the electronic device. The first algorithm is as follows:
[0106] (1)
[0107] in, The first focal length, The distance between the object to be photographed and the first camera. The image distance is the distance at which the first camera captures the image.
[0108] For example, let's assume the first focal length The image distance of the first camera is 6.0 mm. If the value is 6.01mm, then substituting it into the first algorithm (1) above: Solving this problem yields the object distance between the object to be photographed and the first camera. The distance is 3606mm, and the object distance between the subject being photographed and the first camera is... It can be equal to the object distance between the subject and the electronic device. Therefore, the object distance between the subject and the electronic device is 3606mm.
[0109] Step 102b: The electronic device determines the image distance of the third camera image based on the object distance and the second focal length.
[0110] In some examples, the electronic device can use a second algorithm to calculate the image distance of the third camera based on the object distance and the second focal length. The second algorithm is as follows:
[0111] (2)
[0112] in, For the second focal length, The distance between the object to be photographed and the first camera. The image distance for the third camera.
[0113] For example, suppose the second focal length The distance between the object to be photographed and the first camera is 12.0mm. The distance is 3606mm, meaning the distance between the object to be photographed and the electronic device is 3606mm. Substituting this into the second algorithm (2) above: Solving this problem yields the image distance of the third camera. It is 12.04mm.
[0114] Step 102c: The electronic device controls the movement of the lens of the third camera according to the image distance of the third camera to focus on the subject to be photographed.
[0115] In some examples, the electronic device can first determine the focus position of the third camera lens based on the image distance of the third camera, and control the lens to move to the focus position to adjust the focus position of the third camera in order to focus the subject to be photographed.
[0116] It is understandable that after focusing on the subject, if the subject moves to the second preview interface, the subject in the second preview interface will be in focus, meaning the subject will be relatively clear in the second preview interface.
[0117] In some examples, the electronic device may repeat steps 102a to 102c above until the subject to be photographed appears in the second preview interface.
[0118] Thus, it can be seen that since the electronic device can accurately determine the object distance between the object to be photographed and the electronic device based on the first focal length and the image distance of the first camera, and accurately determine the image distance of the third camera based on the object distance and the second focal length, the electronic device can accurately control the lens movement of the third camera based on the image distance of the third camera. Therefore, the accuracy of the electronic device in focusing on the object to be photographed can be improved.
[0119] As can be seen from the above, the embodiments of this application aim to solve the problem of poor shooting performance of electronic devices when shooting distant objects in related technologies. The embodiments of this application can control the third camera to focus on the object before it appears in the second preview interface, based on the first and second focal lengths. This allows the focusing process to be completed before the object appears in the second preview interface. Therefore, when the object appears in the second preview interface, the electronic device does not need to perform further focusing. In other words, the embodiments of this application can avoid the difficulty of focusing based on the image information of the preview image in the second preview interface. Thus, the electronic device can directly capture images, including clear images of distant objects, when the object appears in the second preview interface.
[0120] This application provides a focusing method in which an electronic device can display a first preview interface and a second preview interface. The first preview interface includes a preview image captured by a first camera based on a first focal length and includes the object to be photographed. The second preview interface includes preview images captured by a second camera and a third camera based on a second focal length and does not include the object to be photographed. Based on the first focal length and the second focal length, the third camera is controlled to perform focusing processing on the object to be photographed. Since the electronic device can control the third camera to focus on the subject in advance based on the first and second focal lengths when the subject is displayed in the first preview interface but not in the second preview interface (i.e., when the user needs to use the second and third cameras to shoot the subject, but the user has not yet pointed the second and third cameras at the subject), the electronic device can directly control the second and third cameras to capture images when the subject appears in the second preview interface, without waiting for the electronic device to focus based on the image information in the second preview interface. This reduces the waiting time required before capturing images of distant subjects, thus optimizing the shooting performance of the electronic device when shooting distant subjects.
[0121] Furthermore, since the electronic device controls the third camera to focus on the subject based on the first and second focal lengths, without needing to focus on the subject based on the image information of the preview image in the second preview interface, it can avoid inaccurate image information caused by the shallow depth of field of the third camera, thus avoiding inaccurate focusing. In this way, the focusing accuracy of the electronic device when shooting distant subjects can be improved.
[0122] Furthermore, since the electronic device can control the third camera to focus on the subject in advance, it can directly capture the image when the subject appears in the second preview interface without needing to focus on the subject again. Therefore, it can improve the success rate of capturing distant subjects.
[0123] Of course, during the use of this application embodiment, there may be a situation where the first preview interface includes at least two candidate objects. In this case, the electronic device can first determine the object to be photographed from the at least two candidate objects, and then control the third camera to focus on the object to be photographed based on the first focal length and the second focal length.
[0124] In some embodiments of this application, the aforementioned candidate objects can be understood as objects appearing in the first preview interface, which may include, but are not limited to, people, scenery, and objects. It is understood that when a user takes a picture using an electronic device, they will point the device towards the object they want to photograph. At this time, the FOV of the first camera may include multiple objects, among which is the object the user wants to photograph. The electronic device may not know the specific object the user wants to photograph; that is, each of these multiple objects could be the object the user wants to photograph. Therefore, the objects in the FOV of the first camera, i.e., the objects in the first preview interface, are referred to as candidate objects.
[0125] In some embodiments of this application, the electronic device can determine the subject to be photographed from at least two candidate subjects in an automatic or manual manner.
[0126] The aforementioned automatic method can be understood as the way in which the electronic device determines the subject to be photographed from at least two candidate subjects. Here, the electronic device can determine the subject to be photographed from at least two candidate subjects based on the motion parameters of each candidate subject in the first preview interface, and / or the area where each candidate subject is located in the first preview interface, and / or the area in the first preview interface that is the same as the image content in the second preview interface.
[0127] The manual method mentioned above can be understood as the way in which the electronic device determines the subject to be photographed from at least two candidate subjects based on the user's input.
[0128] The following will provide examples illustrating specific solutions for automatic and manual modes.
[0129] In some embodiments of this application, the first preview interface described above includes at least two candidate objects. Optionally, in combination with... Figure 1 ,like Figure 7As shown, prior to step 102 above, the focusing method provided in this application embodiment may further include steps 201 and 202 as described below.
[0130] Step 201: The electronic device determines the probability score of each candidate object based on the motion parameters of each candidate object in the first preview interface, the area where each candidate object is located in the first preview interface, and the first area.
[0131] In some examples, the above motion parameters may include, but are not limited to, at least one of the following: motion speed and motion direction.
[0132] The electronic device can determine the coordinate information of the candidate object's position in the first preview interface at each of at least two time points, obtain at least two coordinate information, and determine the moving distance of the candidate object between two adjacent time points based on the coordinate information of the candidate object's position at two adjacent time points. It can also determine a duration based on each pair of adjacent time points, so that the electronic device can calculate the aforementioned movement speed based on at least one determined moving distance and at least one duration.
[0133] For example, assuming that the above at least two time points include time point 1 and time point 2, time point 1 is 12:00:11, that is, 12:00:11, and time point 2 is 12:00:13, that is, 12:00:13. The coordinate information of the position of candidate object 1 at time point 1 is (720, 110), and the coordinate information of the position of candidate object 1 at time point 2 is (720, 150). Then the moving distance of candidate object 1 between time point 1 and time point 2 is 40 pixels (px). Thus, the movement speed of candidate object 1 is 40px / 2 seconds (s) = 20px / s.
[0134] The electronic device can determine the coordinate information of the candidate object's position in the first preview interface at each of at least two time points, obtain at least two coordinate information, and determine the direction of movement of the candidate object between two adjacent time points based on the coordinate information of the candidate object's position at two adjacent time points.
[0135] For example, assuming that the above at least two time points include time point 1 and time point 2, time point 1 is 12:00:11, that is, 12:00:11, and time point 2 is 12:00:13, that is, 12:00:13. The coordinate information of the position of candidate object 1 at time point 1 is (720, 110), and the coordinate information of the position of candidate object 1 at time point 2 is (720, 150). Then the direction of movement of candidate object 1 between time point 1 and time point 2 is from the coordinate information (720, 110) to the coordinate information (720, 150).
[0136] In some examples, the electronic device can perform object detection on the first preview interface to identify at least two candidate objects from the first preview interface and mark the at least two candidate objects with at least two rectangles, so that the electronic device can determine the area enclosed by each rectangle marking each candidate object as the area where a candidate object is located in the first preview interface.
[0137] In this embodiment of the application, the probability score represents the probability that a candidate object is a shooting object that satisfies the user's shooting intention.
[0138] In some examples, the probability score mentioned above is positively correlated with the probability that a candidate object is a shooting object that satisfies the user's shooting intention.
[0139] It is understandable that the higher the probability score of a candidate object, the higher the probability that the candidate object is the object that satisfies the user's shooting intention.
[0140] In this embodiment of the application, the image content in the first area is the same as the image content in the second preview interface.
[0141] In some examples, the electronic device can determine the probability of each candidate object entering the second preview interface, the time of each candidate object entering the second preview interface, and the area size of the area where each candidate object is located in the first preview interface, respectively, based on the motion parameters of each candidate object in the first preview interface, the area where each candidate object is located in the first preview interface, and the first area. Based on the probability of each candidate object entering the second preview interface, the time of each candidate object entering the second preview interface, and the area size of the area where each candidate object is located in the first preview interface, the electronic device can calculate the probability score of each candidate object.
[0142] In some examples, the above motion parameters include the direction of motion and the speed of motion, and step 201 can be specifically implemented through steps 201a to 201c below.
[0143] Step 201a: The electronic device determines the probability of being on camera based on the movement direction of the candidate object in the first preview interface, the area it occupies in the first preview interface, and the first area.
[0144] In this embodiment of the application, the above-mentioned probability of being on camera is the probability of the candidate object entering the second preview interface.
[0145] It is understandable that, for each of at least two candidate objects, the electronic device can determine the probability of a candidate object entering the second preview interface based on the direction of movement of a candidate object in the first preview interface, the area where a candidate object is located in the first preview interface, and the first area.
[0146] In some examples, the electronic device can calculate the overlap size between the area where each candidate object is located in the first preview interface and the first area during the movement along the aforementioned direction of motion, and determine the probability of each candidate object entering the second preview interface based on the overlap size.
[0147] Optionally, step 201a can be implemented through steps 201a1 and 201a2 as described below.
[0148] Step 201a1: The electronic device predicts the maximum overlap size between the candidate object and the first region based on the movement direction of the candidate object in the first preview interface, the region coordinate information of the area where the candidate object is located in the first preview interface, and the region coordinate information of the first region.
[0149] In this embodiment of the application, the aforementioned regional coordinate information includes the coordinate information of at least one reference point in the region.
[0150] Here, the above-mentioned at least one reference point may include, but is not limited to, at least one of the following: the center point of the region, the vertex of the region, a point on the edge line of the region, or a point selected by the user in the region.
[0151] The electronic device can calculate at least one overlap size between the candidate object's location in the first preview interface and the first region during the movement of the candidate object along the aforementioned direction of movement, and determine the largest overlap size among these at least one overlap sizes as the maximum overlap size. Alternatively, the electronic device can calculate the shortest distance between the candidate object's location in the first preview interface and the first region's coordinates based on the candidate object's movement direction in the first preview interface, the region coordinates of the candidate object's location in the first preview interface, and the region coordinates of the first region, and determine the overlap size between the candidate object's location in the first preview interface and the first region at the shortest distance as the maximum overlap size.
[0152] Step 201a2: The electronic device determines the ratio of the maximum overlap size to the region size as the probability of being in the shot.
[0153] It is understandable that if the ratio of the maximum overlap size to the area size of the candidate object in the first preview interface is larger, then the candidate object is more likely to move to the first area, that is, the candidate object is more likely to move to the second preview interface.
[0154] For example, combined with Figure 5A ,like Figure 8AAs shown, there are three birds in the first preview interface 13, such as bird 151, bird 152, and bird 153. The mobile phone can first perform object detection on the first preview interface 13 to determine the bird 151, bird 152, and bird 153 from the first preview interface 13. Bird 151 is marked with a rectangle 251, bird 152 is marked with a rectangle 252, and bird 153 is marked with a rectangle 253. The movement direction 261 of bird 151 is displayed in rectangle 251, the movement direction 262 of bird 152 is displayed in rectangle 252, the movement direction 263 of bird 153 is displayed in rectangle 253, and the movement speed of bird 151 is displayed in rectangle 251 as 120px / s, the movement speed of bird 152 is displayed in rectangle 252 as 100px / s, and the movement speed of bird 153 is displayed in rectangle 253 as 50px / s.
[0155] Thus, assuming that the dimensions of rectangles 251, 252, and 253 are all 10000 pixels. 2 That is, the area where birds 151, 152, and 153 are located is 10000px in size. 2 The size of the first region 20 is 160×90=14,400px. 2 The phone determined that the maximum overlap between bird 151 and the first region 20 was 10000 pixels. 2 Therefore, the probability of bird 151 appearing in the frame is 10000 / 10000=1, and the phone determines that the maximum overlap size between bird 152 and the first region 20 is 5000px. 2 Therefore, the probability of bird 152 appearing in the frame is 5000 / 10000 = 0.5, and the phone determines that the maximum overlap size between bird 153 and the first region 20 is 0 pixels. 2 Therefore, the probability of bird 153 appearing in the frame is 0 / 10000=0.
[0156] For example, combined with Figure 5B ,like Figure 8B As shown, the number of characters in the first preview interface 16 is two, such as a little boy 181 and an old lady 182. The mobile phone can first perform object detection on the first preview interface 16 to determine the little boy 181 and the old lady 182 from the first preview interface 16. The little boy 181 is marked with a rectangle 271, and the old lady 182 is marked with a rectangle 272. The movement direction 281 of the little boy 181 is displayed in the rectangle 271, the movement direction 282 of the old lady 182 is displayed in the rectangle 272, and the movement speed of the little boy 181 is displayed as 80px / s in the rectangle 271, and the movement speed of the old lady 182 is displayed as 60px / s in the rectangle 272.
[0157] Thus, assuming that the dimensions of rectangles 271 and 272 are both 10000 pixels. 2 That is, the area where the little boy 181 and the old lady 182 are located is 10000px in size. 2 The size of the first region 23 is 160×90=14,400px. 2 The phone determined that the maximum overlap between the boy (181) and the first region (23) was 90000 pixels. 2 Therefore, the probability of the little boy 181 appearing in the frame is 9000 / 10000 = 0.9, and the phone determines that the maximum overlap size between the old lady 182 and the first area 23 is 4000px. 2 Therefore, the probability of the 182-year-old grandmother appearing in the scene is 4000 / 10000=0.4.
[0158] Thus, it can be seen that since the electronic device can predict the maximum overlap size between the candidate object and the first region based on the candidate object's movement direction in the first preview interface, the region coordinates in the first preview interface, and the region coordinates of the first region, and this maximum overlap size is positively correlated with the candidate object's probability of entering the second preview interface, the ratio of this maximum overlap size to the region size of the area where the candidate object is located in the first preview interface is also positively correlated. Therefore, the electronic device can accurately determine the candidate object's probability of entering the screen, which facilitates the accurate determination of the candidate object's probability score in subsequent steps.
[0159] Step 201b: The electronic device determines the entry time based on the movement speed of the candidate object in the first preview interface, the area it is located in in the first preview interface, and the first area.
[0160] In this embodiment of the application, the above-mentioned entry time is the time when the candidate object enters the second preview interface.
[0161] It is understandable that, for each of at least two candidate objects, the electronic device can determine the entry time of a candidate object into the second preview interface based on the movement speed of a candidate object in the first preview interface, the area where the candidate object is located in the first preview interface, and the first area.
[0162] Optionally, the electronic device can first determine the distance between the area where the candidate object is located in the first preview interface and the first area, and then determine the entry time of the candidate object into the second preview interface based on the distance and the movement speed.
[0163] Optionally, step 201b can be implemented through steps 201b1 and 201b2 as described below.
[0164] Step 201b1: The electronic device predicts the time when the candidate object enters the first area based on the candidate object's movement speed in the first preview interface, the area coordinates of the area it is in in the first preview interface, and the area coordinates of the first area.
[0165] In this embodiment of the application, the aforementioned regional coordinate information includes the coordinate information of at least one reference point in the region.
[0166] It should be noted that the description of at least one reference point can be found in the specific description in the above embodiments, and will not be repeated here in the embodiments of this application.
[0167] For example, if a user is interested in a certain area in the second preview interface, that is, the area is the ROI, and the user wants the electronic device to focus on that area, the user can click on that area to input data, so that the electronic device can determine the point entered by the user as the aforementioned reference point.
[0168] Optionally, the electronic device can first calculate the distance between the area where the candidate object is located in the first preview interface and the first area based on the area coordinate information of the area where the candidate object is located in the first preview interface and the area coordinate information of the first area, and then calculate the time when the candidate object enters the first area based on the distance and the aforementioned movement speed.
[0169] For example, combined with Figure 8A The movement speed of bird 151 is 120px / s, the movement speed of bird 152 is 100px / s, and the movement speed of bird 153 is 50px / s. The coordinates of the area where bird 151 is located are the coordinates of the center point of the area enclosed by rectangle 251 (720, 540), the coordinates of the area where bird 152 is located are the coordinates of the center point of the area enclosed by rectangle 252 (580, 320), and the coordinates of the area where bird 153 is located are the coordinates of the center point of the area enclosed by rectangle 253 (390, 140). The coordinates of the first area 20 are the coordinates of its center point (960, 540). Therefore, the phone can first calculate the distance between the coordinates of the area where bird 151 is located (720, 540) and the coordinates of the first area 20 (960, 540), i.e. Therefore, the time it takes for bird 151 to enter the first region 20 is 240 / 120 = 2 frames. That is, bird 151 enters the first region 20 after capturing 2 preview images. Then, the distance between the region coordinates (580, 320) of the area where bird 152 is located and the region coordinates (960, 540) of the first region 20 is calculated. Therefore, the time it takes for bird 152 to enter the first region 20 is 439 / 100 = 4.39 frames. That is, bird 152 enters the first region 20 after capturing 4.39 frames of preview images. The distance between the region coordinates (390, 140) of bird 153 and the region coordinates (960, 540) of the first region 20 is calculated. Therefore, the time for bird 153 to enter the first region 20 is 696 / 50=34.8 frames, that is, bird 153 enters the first region 20 after capturing 34.8 frames of preview images.
[0170] Further examples illustrate this, combined with Figure 8B The boy (181) moves at a speed of 80px / s, and the grandmother (182) moves at a speed of 60px / s. The coordinates of the area where the boy (181) is located are the coordinates of the center point of the area enclosed by rectangle 271 (520, 740). The coordinates of the area where the grandmother (182) is located are the coordinates of the center point of the area enclosed by rectangle 272 (420, 680). The coordinates of the first area 23 are the coordinates of its center point (960, 540). Therefore, the phone can first calculate the distance between the coordinates of the area where the boy (181) is located (520, 740) and the coordinates of the first area 23 (960, 540). Therefore, the time it takes for the boy 181 to enter the first region 23 is 483 / 80 = 6.03 frames. That is, the boy 181 enters the first region 23 after 6.03 frames of preview image are captured. Then, the distance between the region coordinates (420, 680) where the old lady 182 is located and the region coordinates (960, 540) of the first region 23 is calculated. Therefore, the time it takes for Grandma 182 to enter the first region 23 is 558 / 60=9.3 frames, that is, Grandma 182 enters the first region 23 after capturing 6.03 frames of preview images.
[0171] Step 201b2: The electronic device determines the time when the candidate object enters the first area as the entry time.
[0172] Thus, it can be seen that since the electronic device can accurately predict the time when the candidate object enters the first area based on the candidate object's movement speed in the first preview interface, the area coordinates of the area in the first preview interface, and the area coordinates of the first area, it can determine the candidate object's accurate entry time. Therefore, it is convenient for the electronic device to accurately determine the candidate object's probability score in subsequent steps.
[0173] Step 201c: The electronic device calculates a probability score based on the probability of being on camera, the time of being on camera, and the size of the area.
[0174] In this embodiment of the application, the aforementioned area size is the size of the area where the candidate object is located in the first preview interface.
[0175] It is understandable that, for each of at least two candidate objects, the electronic device can calculate the probability score of a candidate object based on the candidate object's appearance probability, the appearance time of the candidate object, and the area size of the area where the candidate object is located in the first preview interface.
[0176] Optionally, the probability score of a candidate object is positively correlated with the probability of the candidate object appearing on screen, the probability score of a candidate object is positively correlated with the area size of the area where the candidate object is located in the first preview interface, and the probability score of a candidate object is negatively correlated with the time of the candidate object appearing on screen.
[0177] It is understandable that the higher the probability of a candidate object appearing in the frame, the higher the probability that the candidate object is the subject that satisfies the user's shooting intention, that is, the higher the probability that the candidate object is the subject to be shot, and the higher the probability score of the candidate object; the larger the area size of the candidate object in the first preview interface, the higher the probability that the candidate object is the subject that satisfies the user's shooting intention, that is, the higher the probability that the candidate object is the subject to be shot, and the higher the probability score of the candidate object; the shorter the time the candidate object appears in the frame, the earlier the candidate object enters the second preview interface, that is, the higher the probability that the candidate object is the subject that satisfies the user's shooting intention, that is, the higher the probability that the candidate object is the subject to be shot, and the higher the probability score of the candidate object.
[0178] Optionally, the electronic device may employ a third algorithm to calculate the probability score of the candidate object based on the probability of being on camera, the time of being on camera, and the size of the region. This third algorithm is as follows:
[0179] (3)
[0180] in, The probability score for the candidate object. The size of the area where the candidate object is located in the first preview interface. The probability of a candidate appearing on screen. The time when the candidate appears on screen.
[0181] For example, combined with Figure 8A Bird 151 enters the first region 20 at 2 frames, bird 152 enters at 4.39 frames, and bird 153 enters at 34.8 frames. The region size of each of the three birds (bird 151, bird 152, and bird 153) is 10000 pixels. 2The probability of bird 151 appearing in the frame is 1, the probability of bird 152 appearing in the frame is 0.5, and the probability of bird 153 appearing in the frame is 0. Substituting these values into the third algorithm (3) above, we can obtain that the probability score of bird 151 is 5000, the probability score of bird 152 is 1139, and the probability score of bird 153 is 0.
[0182] Further examples illustrate this, combined with Figure 8B The boy 181 enters the first region 23 at 6.03 frames, and the grandmother 182 enters the first region 23 at 9.3 frames. The region size of both the boy 181 and the grandmother 182 is 10000 pixels. 2 The probability of the boy 181 appearing in the frame is 0.9, and the probability of the grandmother 182 appearing in the frame is 0.4. Substituting these values into the third algorithm (3) above, we can obtain that the probability score of the boy 181 is 1493, and the probability score of the grandmother 182 is 430.
[0183] Thus, it can be seen that since the electronic device can determine the probability of the candidate object entering the second preview interface based on the candidate object's movement direction in the first preview interface, its location in the first preview interface, and the first area, and can determine the time of the candidate object entering the second preview interface based on its movement speed in the first preview interface, its location in the first preview interface, and the first area, the electronic device can obtain multiple pieces of information related to the probability score of the candidate object being the subject that satisfies the user's shooting intention. Therefore, the electronic device can accurately calculate the probability score of the candidate object based on this multiple pieces of information. In other words, the probability score can accurately reflect the probability that the candidate object is the subject that satisfies the user's shooting intention, so that the electronic device can accurately determine the subject to be shot in subsequent steps.
[0184] Step 202: The electronic device identifies the candidate with the highest probability score among at least two candidate objects as the object to be photographed.
[0185] For example, based on the above example, if bird 151 scores 5000, bird 152 scores 1139, and bird 153 scores 0, then the phone can identify bird 151 as the subject to be photographed.
[0186] To illustrate further, combining the above examples, the score of the little boy 181 is 1493, and the score of the old lady 182 is 430. Therefore, the mobile phone can identify the little boy 181 as the subject to be photographed.
[0187] Thus, it can be seen that since the electronic device can determine the probability score of each candidate object based on the motion parameters of each candidate object in the first preview interface, the area where each candidate object is located in the first preview interface, and the first area, the probability score of each candidate object can be used to determine the probability that each candidate object is the object that satisfies the user's shooting intention. In this way, the electronic device can determine the candidate object with the highest probability score, that is, the candidate object with the highest probability of satisfying the user's shooting intention, as the object to be shot. Therefore, the accuracy of the electronic device in determining the object to be shot can be improved.
[0188] In other embodiments of this application, the first preview interface described above includes at least two candidate objects. Optionally, in combination with... Figure 1 ,like Figure 9 As shown, prior to step 102 above, the focusing method provided in this application embodiment may further include steps 203 and 204 as described below.
[0189] Step 203: The electronic device receives the user's selection input for a target candidate from at least two candidate objects.
[0190] In this embodiment of the application, the above-mentioned selection input is used to select the object that the user needs to photograph.
[0191] In some examples, the aforementioned selection input includes, but is not limited to: touch input from the user's finger or stylus to the display screen of an electronic device, or voice commands input by the user, or specific gestures input by the user, or other feasible inputs. The specific input can be determined according to actual usage needs, and this embodiment of the invention does not impose limitations. The specific gestures in this application embodiment can be any one of a single-click gesture, a swipe gesture, a drag gesture, a pressure-recognition gesture, a long-press gesture, an area-change gesture, a double-press gesture, or a double-tap gesture; the click input in this application embodiment can be a single-click input, a double-tap input, or any number of clicks, and can also be a long-press input or a short-press input. For example, the aforementioned selection input can be: the user's click input on a target candidate object.
[0192] Step 204: In response to the selection input, the electronic device identifies the target candidate object as the object to be photographed.
[0193] For example, combined with Figure 8A ,like Figure 10A As shown, users can select and input the bird 152, for example, by clicking to input, so that the phone can identify the bird 152 as the subject to be photographed.
[0194] Further examples illustrate this, combined with Figure 8B ,like Figure 10BAs shown, users can select and input "Grandma 182" by clicking on it, and the phone can then identify Grandma 182 as the subject to be photographed.
[0195] Thus, since the electronic device can accurately determine the subject to be photographed based on the user's input of the target candidate, without the electronic device having to determine it itself, it can ensure the accuracy of the subject determination on the one hand, and save the computational load of the electronic device on the other hand. In this way, the electronic device can save power consumption while ensuring the accuracy of the subject determination.
[0196] In some embodiments of this application, combined with Figure 1 ,like Figure 11 As shown, after step 102 above, the focusing method provided in this application embodiment may further include steps 103 and 104 as described below.
[0197] Step 103: The electronic device determines the shooting time.
[0198] In this embodiment of the application, the shooting time is the time when the object to be photographed enters the second preview interface.
[0199] It should be noted that the explanation of how the electronic device determines the shooting time can be found in the specific description of how the electronic device determines the time of entering the frame in the above embodiments, and will not be repeated here in the embodiments of this application.
[0200] Step 104: When the system time of the electronic device matches the shooting time, the electronic device controls the second and third cameras to capture images.
[0201] In this embodiment of the application, if the system time of the electronic device matches the shooting time, for example, if they are the same or the difference between them is less than or equal to a threshold, it can be considered that the object to be shot has entered the second preview interface. Therefore, the electronic device can control the second camera and the third camera to capture images.
[0202] In some examples, electronic devices can automatically control the second and third cameras to capture images.
[0203] For example, such as Figure 12A As shown, the subject to be photographed is a bird 151. When the system time of the phone matches the shooting time, the bird 151 enters the second preview interface 21. The phone can automatically control the second and third cameras to capture images, thereby capturing a clear image containing the bird 151.
[0204] For example, Figure 12BAs shown, the subject to be photographed is a little boy 181. When the system time of the phone matches the shooting time, the little boy 181 enters the second preview interface 24. The phone can automatically control the second and third cameras to capture images, thereby capturing a clear image containing the little boy 181.
[0205] In other examples, the electronic device may first output a shooting prompt message to inform the user that the subject to be photographed has entered the second preview interface, and then control the second and third cameras to capture images based on the user's input.
[0206] In this scenario, when the electronic device displays a "Predictive Capture" control in the first preview interface, the user can click and input information to this control. This allows the electronic device to display both automatic and manual capture controls in the first preview interface. If the user clicks and inputs information to the automatic capture control, and the system time of the electronic device matches the capture time, the electronic device can automatically control the second and third cameras to capture images. Alternatively, if the user clicks and inputs information to the manual capture control, and the system time matches the capture time, the electronic device can first output a capture prompt message to indicate that the subject has entered the second preview interface, and then control the second and third cameras to capture images based on the user's input.
[0207] For example, combined with Figure 5A ,like Figure 13A As shown, users can click and input data into the "Predictive Snapshot" control 19; for example... Figure 13B As shown, the mobile phone can display an "Auto Shoot" control 29 and a "Manual Shoot" control 30 in the first preview interface 13. Therefore, when the user clicks the "Auto Shoot" control 29, if the phone's system time matches the shooting time, the phone can automatically control the second and third cameras to capture images. Alternatively, when the user clicks the "Manual Shoot" control 30, if the phone's system time matches the shooting time, the phone can output a shooting prompt message and control the second and third cameras to capture images based on the user's input.
[0208] Thus, since the electronic device can determine the shooting time when the subject enters the second preview interface, when the system time of the electronic device matches the shooting time, that is, when the subject enters the second preview interface, the electronic device can promptly control the second and third cameras to capture images without needing to perform focusing processing. Therefore, the success rate of the electronic device in capturing images can be improved.
[0209] In some examples, before “controlling the second and third cameras to capture images” in step 104, the focusing method provided in this application embodiment may also include the following steps 301 and 302, and the above step 104 may be implemented by the following step 104a.
[0210] Step 301: When the system time of the electronic device matches the shooting time, the electronic device outputs a shooting prompt message.
[0211] In this embodiment of the application, the above-mentioned shooting prompt information is used to prompt the subject to be photographed to enter the second preview interface.
[0212] Optionally, the aforementioned shooting prompts may include, but are not limited to, vibration prompts, sound prompts, and display prompts.
[0213] It is understandable that electronic devices can output shooting prompts to remind users to trigger the electronic device to take pictures in a timely manner.
[0214] Step 302: The electronic device receives the user's input for taking a picture.
[0215] In this embodiment of the application, the above-mentioned shooting input is used to trigger the electronic device to capture an image of the object to be photographed.
[0216] Optionally, the above-mentioned shooting input includes, but is not limited to: touch input by the user through a touch device such as a finger or stylus on the display screen of the electronic device, or voice commands input by the user, or specific gestures input by the user, or other feasible inputs. The specific input can be determined according to actual usage needs, and this embodiment of the invention does not impose limitations. The specific gestures in this application embodiment can be any one of a single-click gesture, a swipe gesture, a drag gesture, a pressure-recognition gesture, a long-press gesture, an area-change gesture, a double-press gesture, or a double-tap gesture; the click input in this application embodiment can be a single-click input, a double-tap input, or any number of clicks, and can also be a long-press input or a short-press input. For example, the above-mentioned shooting input can be: the user's click input on the shooting control in the first preview interface.
[0217] Step 104a: The electronic device responds to the shooting input and controls the second and third cameras to capture images.
[0218] Therefore, since the electronic device can output a shooting prompt message when its system time matches the shooting time, that is, when the subject to be shot enters the second preview interface, the user can be prompted to trigger the electronic device to capture the image in a timely manner. Thus, the user can promptly trigger the electronic device to control the second and third cameras to capture images, thereby improving the success rate of the electronic device's snapshot.
[0219] In some embodiments of this application, before “controlling the second camera and the third camera to capture images” in step 104, the focusing method provided in this application may further include the following step 303, and the above step 104 may be implemented by the following step 104b.
[0220] Step 303: When the system time of the electronic device matches the shooting time, the electronic device performs focusing processing on the subject to be photographed based on the image information of the preview image in the second preview interface.
[0221] It should be noted that, for the explanation of how the electronic device performs focusing processing on the object to be photographed based on the image information of the preview image in the second preview interface, please refer to the specific description in the relevant technology, and the embodiments of this application will not be repeated here.
[0222] It is understandable that before the subject enters the second preview interface, the electronic device can first perform coarse focusing on the subject based on the first and second focal lengths. Then, after the subject enters the second preview interface, it can perform fine focusing on the subject based on the image information of the preview image in the second preview interface. In this way, since coarse focusing has already been performed, the lens position of the third lens is relatively close to the focus position. Therefore, the electronic device can still control the third camera to perform fine focusing on the subject.
[0223] Step 104b: The electronic device responds to the shooting input and controls the second and third cameras to capture images.
[0224] Therefore, since the electronic device has already focused on the subject based on the first and second focal lengths before the subject enters the second preview interface, meaning the third camera lens has already moved to a position close to the focus point, when the electronic device focuses on the subject based on the image information in the preview image of the second preview interface, it only needs to move the third camera lens a short distance to accurately place the lens in focus, without having to move it a long distance. Thus, the focusing efficiency and accuracy of the electronic device can be improved when shooting distant subjects.
[0225] The following two complete examples illustrate the specific solutions of the focusing method provided in the embodiments of this application.
[0226] Example 1: A user uses an electronic device to photograph a bird at a distance.
[0227] The focusing method provided in this application embodiment may include the following steps:
[0228] Step 1: The electronic device displays a first preview interface, which includes a preview image captured by the first camera.
[0229] Step 2: The user installs a third camera on the second camera and connects the third camera to the electronic device so that the electronic device displays a second preview interface in the first area. The second preview interface includes preview images captured by the second and third cameras.
[0230] After the third camera establishes a communication connection with the electronic device, the electronic device can display a "predictive capture" control in the first preview interface. Users can then click on the "predictive capture" control to input information, causing the electronic device to display both automatic and manual capture controls in the first preview interface. Users can then click on one of these controls as needed.
[0231] If the first preview interface includes a bird, the electronic device performs step 3; if the first preview interface includes at least two birds, the electronic device performs step 4.
[0232] Step 3: The electronic device identifies a small bird in the first preview interface as the subject to be photographed.
[0233] Step 4: The electronic device identifies the subject to be photographed from at least two birds included in the first preview interface.
[0234] Step 5: The electronic device can control the third camera to focus on the subject in real time based on the first focal length and the second focal length.
[0235] In the above steps, if the user selects the automatic capture control, the electronic device executes step 6; if the user selects the manual capture control, the electronic device executes step 7.
[0236] Step 6: When the subject to be photographed enters the second preview interface, the electronic device automatically controls the second and third cameras to capture images.
[0237] Step 7: When the subject to be photographed enters the second preview interface, the electronic device outputs a shooting prompt message and controls the second and third cameras to capture images based on the user's input.
[0238] As can be seen from the above, this application can also solve the problem of focusing difficulty when the subject stays in the second preview interface for too short a time: for example, when a user is capturing a bird in the wild, a third camera is needed to get a clear image because the distance is relatively far. By combining the previews obtained by the second and third cameras with those obtained by the first camera, the position of the bird can be quickly located. At the same time, the focus is processed in advance before the bird enters the second preview interface, so that the bird can be accurately captured when it enters the second preview interface.
[0239] Example 2: A user uses an electronic device to take a picture of a person at a distance.
[0240] The focusing method provided in this application embodiment may include the following steps:
[0241] Step 8: The electronic device displays a first preview interface, which includes a preview image captured by the first camera.
[0242] Step 9: The user installs a third camera on the second camera and connects the third camera to the electronic device so that the electronic device displays a second preview interface in the first area, which includes preview images captured by the second and third cameras.
[0243] After the third camera establishes a communication connection with the electronic device, the electronic device can display a "predictive capture" control in the first preview interface. Users can then click on the "predictive capture" control to input information, causing the electronic device to display both automatic and manual capture controls in the first preview interface. Users can then click on one of these controls as needed.
[0244] If the first preview interface includes one character, the electronic device executes step 10; if the first preview interface includes at least two characters, the electronic device executes step 11.
[0245] Step 10: The electronic device identifies a person in the first preview interface as the subject to be photographed.
[0246] Step 11: The electronic device identifies the subject to be photographed from at least two people included in the first preview interface.
[0247] Step 12: The electronic device can control the third camera to focus on the subject in real time based on the first focal length and the second focal length.
[0248] In the above steps, if the user selects the automatic capture control, the electronic device executes step 13; if the user selects the manual capture control, the electronic device executes step 14.
[0249] Step 13: When the subject to be photographed enters the second preview interface, the electronic device automatically controls the second and third cameras to capture images.
[0250] Step 14: When the subject to be photographed enters the second preview interface, the electronic device outputs a shooting prompt message and controls the second and third cameras to capture images based on the user's input.
[0251] In summary, the embodiments of this application can provide a predictive focusing method and an automatic or manual capture method for third-camera capture by using a predictive focusing and capture method based on a third camera, which can significantly improve the pain points and difficulties of focusing and capturing when using a third camera.
[0252] It should be noted that the above-described method embodiments, or the various possible implementations of the method embodiments, can be executed individually, or, provided there are no contradictions, they can be combined with each other. The specific implementation can be determined according to actual usage requirements, and this application embodiment does not impose any restrictions on this.
[0253] The focusing method provided in this application can be executed by a focusing device. This application uses a focusing device executing the focusing method as an example to illustrate the focusing device provided in this application.
[0254] Figure 14 This is a schematic diagram of a focusing device provided in an embodiment of this application. Figure 14 As shown, the focusing device 400 includes: a display module 401 for displaying a first preview interface and a second preview interface; the first preview interface includes a preview image captured by a first camera based on a first focal length; the first preview interface includes the object to be photographed; the second preview interface includes preview images captured by a second camera and a third camera based on a second focal length; the second preview interface does not include the object to be photographed. A control module 402 is used to control the third camera to perform focusing processing on the object to be photographed based on the first focal length and the second focal length.
[0255] This application provides a focusing device. Since the focusing device can control the third camera to focus on the object beforehand, based on a first focal length and a second focal length, when the object is displayed in the first preview interface but not in the second preview interface (i.e., when the user needs to use the second and third cameras to photograph the object but has not yet aligned them), the focusing device can directly control the second and third cameras to capture images when the object appears in the second preview interface, without waiting for the focusing device to perform focusing based on the image information in the second preview interface. This reduces the waiting time required before capturing images of distant objects, thus optimizing the focusing device's performance when photographing distant objects.
[0256] In some embodiments of this application, the focusing device 400 provided in this application further includes: a determining module, configured to determine the object distance between the object to be photographed and the focusing device 400 based on a first focal length and the image distance of the first camera; and to determine the image distance of the third camera based on the object distance and a second focal length. The control module 402 is specifically configured to control the lens movement of the third camera based on the image distance of the third camera determined by the determining module, so as to perform focusing processing on the object to be photographed.
[0257] In some embodiments of this application, the display module 401 is specifically used to display a first preview interface; and when the third camera is connected to the focusing device 400, a second preview interface is displayed on a first area of the first preview interface; wherein the image content in the first area is the same as the image content in the second preview interface.
[0258] In some embodiments of this application, the first preview interface includes at least two candidate objects; the focusing device 400 provided in this application further includes: a determining module, used to determine the probability score of each candidate object based on the motion parameters of each candidate object in the first preview interface, the area where each candidate object is located in the first preview interface, and the first area before the control module 402 controls the third camera to perform focusing processing on the object to be photographed based on the first focal length and the second focal length; the probability score represents the probability that a candidate object is the object to be photographed that satisfies the user's shooting intention; and the candidate object with the highest probability score among the at least two candidate objects is determined as the object to be photographed; wherein, the image content in the first area is the same as the image content in the second preview interface.
[0259] In some embodiments of this application, the aforementioned motion parameters include motion direction and motion speed; the aforementioned determining module is specifically used to determine the probability of being on camera based on the motion direction of the candidate object in the first preview interface, the area it occupies in the first preview interface, and the first area; the probability of being on camera is the probability of the candidate object entering the second preview interface; and to determine the time of being on camera based on the motion speed of the candidate object in the first preview interface, the area it occupies in the first preview interface, and the first area; the time of being on camera is the time when the candidate object enters the second preview interface; and to calculate a probability score based on the probability of being on camera, the time of being on camera, and the area size; the area size is the size of the area where the candidate object occupies in the first preview interface.
[0260] In some embodiments of this application, the aforementioned determining module is specifically used to predict the maximum overlap size between the candidate object and the first region based on the movement direction of the candidate object in the first preview interface, the region coordinate information of the area where the candidate object is located in the first preview interface, and the region coordinate information of the first region; the region coordinate information includes the coordinate information of at least one reference point in the region; and the ratio of the maximum overlap size to the region size is determined as the probability of being in the shot.
[0261] In some embodiments of this application, the aforementioned determining module is specifically used to predict the time when the candidate object enters the first area based on the candidate object's movement speed in the first preview interface, the area coordinate information of the area in the first preview interface, and the area coordinate information of the first area; the area coordinate information includes the coordinate information of at least one reference point in the area; and the time when the candidate object enters the first area is determined as the entry time.
[0262] In some embodiments of this application, the first preview interface includes at least two candidate objects; the focusing device 400 provided in this application further includes: a receiving module, used to receive a user's selection input of a target candidate object from at least two candidate objects before the control module 402 controls the third camera to perform focusing processing on the object to be photographed based on a first focal length and a second focal length; and a determining module, used to determine the target candidate object as the object to be photographed in response to the selection input received by the receiving module.
[0263] In some embodiments of this application, the focusing device 400 provided in this application further includes: a determining module, used to determine the shooting time after the control module 402 controls the third camera to focus on the object to be photographed based on the first focal length and the second focal length; the shooting time is the time when the object to be photographed enters the second preview interface; the control module 402 is also used to control the second camera and the third camera to capture images when the system time of the focusing device 400 matches the shooting time determined by the determining module.
[0264] In some embodiments of this application, the focusing device 400 provided in this application further includes: an output module, used to output shooting prompt information before the control module 402 controls the second camera and the third camera to capture images; the shooting prompt information is used to prompt the object to be photographed to enter the second preview interface; a receiving module, used to receive the user's shooting input; the control module 402 is specifically used to control the second camera and the third camera to capture images in response to the shooting input received by the receiving module.
[0265] In some embodiments of this application, the third camera described above is detachably connected to the focusing device 400.
[0266] The focusing device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the device.
[0267] The focusing device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0268] The focusing device provided in this application embodiment can achieve... Figures 1 to 1 To avoid repetition, the various processes implemented in the method embodiment 3 will not be described again here.
[0269] In some embodiments of this application, such as Figure 15As shown, this application embodiment also provides an electronic device 500, including a processor 501 and a memory 502. The memory 502 stores a program or instructions that can run on the processor 501. When the program or instructions are executed by the processor 501, they implement the various steps of the above-described focusing method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0270] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.
[0271] Figure 16 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0272] The electronic device 600 includes, but is not limited to, components such as: radio frequency unit 601, network module 602, audio output unit 603, input unit 604, sensor 605, display unit 606, user input unit 607, interface unit 608, memory 609, and processor 610.
[0273] Those skilled in the art will understand that the electronic device 600 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 610 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 16 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0274] The display unit 606 is used to display a first preview interface and a second preview interface; the first preview interface includes a preview image captured by a first camera based on a first focal length; the first preview interface includes the object to be photographed; the second preview interface includes preview images captured by a second camera and a third camera based on a second focal length; the second preview interface does not include the object to be photographed.
[0275] The processor 610 is used to control the third camera to focus on the subject based on the first focal length and the second focal length.
[0276] This application provides an electronic device that, when the first preview interface includes the object to be photographed but the second preview interface does not, i.e., when the user needs to use the second and third cameras to photograph the object but has not yet pointed the second and third cameras at the object, can control the third camera to focus on the object in advance based on the first and second focal lengths. In this way, when the object appears in the second preview interface, the electronic device can directly control the second and third cameras to capture images without waiting for the electronic device to focus based on the image information in the second preview interface, i.e., without waiting for a long time. Therefore, the waiting time required before capturing an image including a distant object can be reduced, thus optimizing the shooting performance of the electronic device when photographing distant objects.
[0277] In some embodiments of this application, the processor 610 is specifically configured to determine the object distance between the object to be photographed and the electronic device based on the first focal length and the image distance of the first camera; and to determine the image distance of the third camera based on the object distance and the second focal length; and to control the lens movement of the third camera based on the image distance of the third camera to perform focusing processing on the object to be photographed.
[0278] In some embodiments of this application, the display unit 606 is specifically used to display a first preview interface; and when the third camera is connected to the electronic device, a second preview interface is displayed on a first area of the first preview interface; wherein the image content in the first area is the same as the image content in the second preview interface.
[0279] In some embodiments of this application, the first preview interface described above includes at least two candidate objects.
[0280] The processor 610 is further configured to, before controlling the third camera to focus on the object to be photographed based on the first focal length and the second focal length, determine the probability score of each candidate object based on the motion parameters of each candidate object in the first preview interface, the area where each candidate object is located in the first preview interface, and the first area; the probability score represents the probability that a candidate object is the object to be photographed that satisfies the user's shooting intention; and determine the candidate object with the highest probability score among at least two candidate objects as the object to be photographed; wherein the image content in the first area is the same as the image content in the second preview interface.
[0281] In some embodiments of this application, the above-mentioned motion parameters include motion direction and motion speed.
[0282] The processor 610 is specifically configured to determine the probability of a candidate object entering the second preview interface based on its movement direction, location, and first region in the first preview interface; the probability of entering the second preview interface is the probability of the candidate object entering the second preview interface; and determine the time of entry based on the candidate object's movement speed, location, and first region in the first preview interface; the time of entry is the time the candidate object enters the second preview interface; and calculate a probability score based on the probability of entry, the time of entry, and the size of the region; the size of the region is the size of the region in the first preview interface where the candidate object is located.
[0283] In some embodiments of this application, the processor 610 is specifically configured to predict the maximum overlap size between the candidate object and the first region based on the movement direction of the candidate object in the first preview interface, the region coordinate information of the region in the first preview interface, and the region coordinate information of the first region; the region coordinate information includes the coordinate information of at least one reference point in the region; and determine the ratio of the maximum overlap size to the region size as the probability of being in the shot.
[0284] In some embodiments of this application, the processor 610 is specifically configured to predict the time when the candidate object enters the first area based on the movement speed of the candidate object in the first preview interface, the area coordinate information of the area in the first preview interface, and the area coordinate information of the first area; the area coordinate information includes the coordinate information of at least one reference point in the area; and determine the time when the candidate object enters the first area as the entry time.
[0285] In some embodiments of this application, the first preview interface described above includes at least two candidate objects.
[0286] User input unit 607 is used to receive user input for selecting a target candidate object from at least two candidate objects before controlling the third camera to focus on the object to be photographed based on the first focal length and the second focal length.
[0287] The processor 610 described above is also configured to determine a target candidate object as the object to be photographed in response to a selection input.
[0288] In some embodiments of this application, the processor 610 is further configured to determine the shooting time after controlling the third camera to focus on the object to be photographed based on the first focal length and the second focal length; the shooting time is the time when the object to be photographed enters the second preview interface; and control the second camera and the third camera to capture images when the system time of the electronic device matches the shooting time.
[0289] In some embodiments of this application, the processor 610 is further configured to output shooting prompt information before controlling the second and third cameras to capture images; the shooting prompt information is used to prompt the object to be photographed to enter the second preview interface.
[0290] User input unit 607 is used to receive user's shooting input.
[0291] The aforementioned processor 610 is specifically used to control the second and third cameras to capture images in response to shooting input.
[0292] It should be understood that, in this embodiment, the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. The GPU 6041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0293] The memory 609 can be used to store software programs and various data. The memory 609 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 609 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 609 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0294] Processor 610 may include one or more processing units; optionally, processor 610 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 610.
[0295] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described focusing method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0296] The processor mentioned above is the processor in the electronic device described in the above embodiments. The readable storage medium mentioned above includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0297] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described focusing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0298] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0299] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the focusing method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0300] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0301] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0302] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A focusing method, characterized in that, include: The first preview interface and the second preview interface are displayed; the first preview interface includes a preview image captured by the first camera based on a first focal length; The first preview interface includes the object to be photographed; the second preview interface includes preview images captured by the second camera and the third camera based on the second focal length; the second preview interface does not include the object to be photographed. Based on the first focal length and the second focal length, the third camera is controlled to focus on the object to be photographed.
2. The method according to claim 1, characterized in that, The step of controlling the third camera to focus on the object to be photographed based on the first focal length and the second focal length includes: Based on the first focal length and the image distance of the first camera, determine the object distance between the object to be photographed and the electronic device. The image distance of the third camera is determined based on the object distance and the second focal length. Based on the image distance captured by the third camera, the lens of the third camera is controlled to move in order to focus on the object to be photographed.
3. The method according to claim 1, characterized in that, The display of the first preview interface and the second preview interface includes: Display the first preview interface; When the third camera is connected to an electronic device, a second preview interface is displayed in the first area of the first preview interface; The image content in the first area is the same as the image content in the second preview interface.
4. The method according to claim 1, characterized in that, The first preview interface includes at least two candidate objects; Before controlling the third camera to focus on the object to be photographed based on the first focal length and the second focal length, the method further includes: Based on the motion parameters of each candidate object in the first preview interface, the region where each candidate object is located in the first preview interface, and the first region, a probability score is determined for each candidate object; the probability score represents the probability that a candidate object is a shooting object that satisfies the user's shooting intention. The candidate with the highest probability score among the at least two candidate objects is determined as the object to be photographed. The image content in the first area is the same as the image content in the second preview interface.
5. The method according to claim 4, characterized in that, The motion parameters include the direction of motion and the speed of motion; The step of determining the probability score of each candidate object based on its motion parameters in the first preview interface, the region it occupies in the first preview interface, and the first region includes: The probability of the candidate object appearing in the camera is determined based on its movement direction in the first preview interface, its location in the first preview interface, and the first area; the probability of the candidate object appearing in the camera is the probability that it will enter the second preview interface. The entry time is determined based on the candidate object's movement speed in the first preview interface, its location in the first preview interface, and the first area; the entry time is the time when the candidate object enters the second preview interface. The probability score is calculated based on the on-screen probability, the on-screen time, and the area size; the area size is the size of the area where the candidate object is located in the first preview interface.
6. The method according to claim 5, characterized in that, The step of determining the probability of the candidate object appearing on screen based on its movement direction in the first preview interface, its location in the first preview interface, and the first area includes: Based on the movement direction of the candidate object in the first preview interface, the regional coordinate information of the area where the candidate object is located in the first preview interface, and the regional coordinate information of the first area, the maximum overlap size between the candidate object and the first area is predicted; the regional coordinate information includes the coordinate information of at least one reference point in the area; The ratio of the maximum overlap size to the region size is determined as the probability of being in the shot.
7. The method according to claim 5 or 6, characterized in that, The step of determining the on-screen entry time based on the candidate object's movement speed in the first preview interface, its location in the first preview interface, and the first area includes: Based on the candidate object's movement speed in the first preview interface, the region coordinates of the area it occupies in the first preview interface, and the region coordinates of the first region, the time when the candidate object enters the first region is predicted; the region coordinates include the coordinates of at least one reference point in the region. The time when the candidate object enters the first area is determined as the entry time.
8. The method according to claim 1, characterized in that, The first preview interface includes at least two candidate objects; Before controlling the third camera to focus on the object to be photographed based on the first focal length and the second focal length, the method further includes: Receive user input selecting a target candidate from the at least two candidate objects; In response to the selection input, the target candidate object is determined as the object to be photographed.
9. The method according to claim 1, characterized in that, After controlling the third camera to focus on the object to be photographed based on the first focal length and the second focal length, the method further includes: Determine the shooting time; the shooting time is the time when the object to be photographed enters the second preview interface; When the system time of the electronic device matches the shooting time, the second camera and the third camera are controlled to capture images.
10. The method according to claim 9, characterized in that, Before controlling the second and third cameras to capture images, the method further includes: Output shooting prompt information; the shooting prompt information is used to prompt the subject to be shot to enter the second preview interface; Receive user's camera input; The control of the second camera and the third camera to capture images includes: In response to the shooting input, control the second camera and the third camera to capture images.
11. The method according to claim 1, characterized in that, The third camera is detachably connected to the electronic device.
12. A focusing device, characterized in that, include: The display module is used to display the first preview interface and the second preview interface; The first preview interface includes a preview image captured by the first camera based on a first focal length; The first preview interface includes the object to be photographed; the second preview interface includes preview images captured by the second camera and the third camera based on the second focal length; the second preview interface does not include the object to be photographed. The control module is used to control the third camera to focus on the object to be photographed based on the first focal length and the second focal length.
13. The apparatus according to claim 12, characterized in that, The first preview interface includes at least two candidate objects; The focusing device also includes: The determining module is configured to, before the control module controls the third camera to focus on the object to be photographed based on the first focal length and the second focal length, determine the probability score of each candidate object based on the motion parameters of each candidate object in the first preview interface, the area where each candidate object is located in the first preview interface, and the first area; the probability score represents the probability that a candidate object is a photographing object that satisfies the user's shooting intention; and determine the candidate object with the highest probability score among the at least two candidate objects as the object to be photographed; The image content in the first area is the same as the image content in the second preview interface.
14. The apparatus according to claim 12, characterized in that, The focusing device also includes: The determining module is used to determine the shooting time after the control module controls the third camera to focus on the object to be photographed based on the first focal length and the second focal length; the shooting time is the time when the object to be photographed enters the second preview interface; The control module is further configured to control the second camera and the third camera to capture images when the system time of the focusing device matches the shooting time determined by the determining module.
15. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the method as described in any one of claims 1 to 11.