Image capturing method and electronic device
By using double exposure and/or double focusing, the problem of both the moon and the foreground object being in sharp focus at the same time was solved, resulting in improved image aesthetics and a superior user experience when shooting scenes with both the moon and the foreground object.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2025-03-13
- Publication Date
- 2026-05-07
AI Technical Summary
In scenarios where the moon and foreground objects are photographed, images taken by ordinary users often show the moon as overexposed or out of focus, while the foreground objects are underexposed or out of focus, resulting in a lack of aesthetic appeal in the images.
By employing a double exposure and/or double focusing method, different exposure parameters and focus positions are used for the moon and the foreground object respectively to obtain clear images of the moon and the foreground object. Then, image fusion is performed to ensure that the moon is not overexposed and the foreground object is not underexposed and is clear.
This achieves clarity for both the moon and foreground objects in the same image, enhancing the image's aesthetics and quality, and providing a good user experience.
Smart Images

Figure CN2025082383_07052026_PF_FP_ABST
Abstract
Description
Image shooting method and electronic device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese Patent Application No. 202410394154.7, filed on March 29, 2024, and entitled "Image shooting method and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] The present application relates to the technical field of terminal, and in particular, to an image shooting method and an electronic device. BACKGROUND
[0004] When a user uses an electronic device to shoot a night scene, the moon is often taken as a subject. For a user without professional photography skills, when the user uses the electronic device to shoot the moon, the image shot often only has the moon, and the image is monotonous and has no aesthetic feeling. SUMMARY
[0005] Embodiments of the present application provide an image shooting method and an electronic device, which can shoot a clear moon and a foreground object in a scene of shooting the moon and the foreground object, and improve the aesthetic feeling of an image.
[0006] In a first aspect, an image shooting method is provided, applied to an electronic device. The electronic device can be a mobile phone, for example. The method can include: displaying a preview interface of a camera, the preview interface including a first preview image; when it is identified that the first preview image includes a moon and a foreground object, entering a moon mode; setting an exposure parameter to a first exposure parameter; focusing on the moon to obtain a first image; setting the exposure parameter to a second exposure parameter, the second exposure parameter being greater than the first exposure parameter; focusing on the foreground object to obtain a second image; and fusing the first image and the second image to obtain a third image.
[0007] In embodiments of the present application, in a scene of shooting a moon and a foreground object, the electronic device can first use a small exposure to restore an overexposed moon, then focus on the moon to obtain a first image, then use a large exposure to make the foreground object visible on the image, then focus on the foreground object to obtain a second image, and the moon and the foreground object are both clear on a third image obtained by fusing the first image and the second image.
[0008] In a possible design, the focusing on the foreground object includes: focusing on the foreground object according to the second exposure parameter.
[0009] In the embodiments of the present application, the exposure parameter of the foreground object affects the focus position of the foreground object, exposure and focus linkage is realized, and the focus accuracy is improved.
[0010] In a possible design, according to the second exposure parameter, the foreground object is focused, including: determining a sharpness threshold of the foreground object according to the second exposure parameter; calculating the sharpness of the foreground object once every time the lens moves a position by pushing the lens to move the position by a camera motor, to find a first position at which the sharpness of the foreground object reaches the sharpness threshold, and focusing the foreground object when the lens is at the first position.
[0011] In the embodiments of the present application, for the foreground object, exposure can be performed first and then focus, and exposure and focus linkage is used, that is, a sharpness threshold is determined according to exposure, and then a focus position is found based on the sharpness threshold, to avoid the case that the foreground object cannot be focused due to improper exposure.
[0012] In a possible design, the focusing the foreground object includes: focusing the foreground object according to the distance between the foreground object and the electronic device.
[0013] In the embodiments of the present application, the electronic device can focus the foreground object according to the distance between the foreground object and the electronic device, to avoid the case that the foreground object cannot be focused due to improper exposure.
[0014] In a possible design, the electronic device includes a first camera, the setting the exposure parameter to the first exposure parameter includes: setting the exposure parameter of the first camera to the first exposure parameter, the focusing the moon to obtain the first image includes: controlling the first camera to focus on the moon, so that the first camera outputs the first image, the setting the exposure parameter to the second exposure parameter includes: setting the exposure parameter of the first camera to the second exposure parameter, and the focusing the foreground object to obtain the second image includes: controlling the first camera to focus on the foreground object, so that the first camera outputs the second image.
[0015] In the embodiments of the present application, the same camera (that is, the first camera) on the electronic device can perform secondary exposure and secondary focus, so that the same camera can output the moon frame (that is, the first image) and the foreground frame (that is, the second image), the registration difficulty of the moon frame and the foreground frame is reduced, and the efficiency of image fusion is improved.
[0016] In a possible design, the electronic device includes a first camera and a second camera, the setting the exposure parameter to the first exposure parameter includes: setting the exposure parameter of the first camera to the first exposure parameter; the focusing on the moon to obtain the first image includes: controlling the first camera to focus on the moon, so that the first camera outputs the first image; the setting the exposure parameter to the second exposure parameter includes: setting the exposure parameter of the second camera to the second exposure parameter; and the focusing on the foreground object to obtain the second image includes: controlling the second camera to focus on the foreground object, so that the second camera outputs the second image.
[0017] In the embodiment of the application, two different cameras (that is, the first camera and the second camera) on the electronic device can use respective exposure parameters and focusing positions to capture the moon and the foreground object. For example, the first camera uses a lower exposure and focuses on the moon to obtain a moon frame (that is, the first image), and the second camera uses a higher exposure and focuses on the foreground to obtain a foreground frame (that is, the second image), and the images output by the two cameras are fused to obtain a third image. This manner reduces the frame output time and shortens the system delay, and the user experience is better because the two cameras can output frames synchronously.
[0018] In a possible design, the setting the exposure parameter to the second exposure parameter includes: evaluating the brightness of the foreground object, and setting the exposure parameter to the second exposure parameter according to the brightness of the foreground object.
[0019] In the embodiment of the application, the electronic device can perform exposure on the foreground object according to the brightness of the foreground object. For example, a larger exposure can be used when the brightness is smaller, to avoid underexposure of the foreground object.
[0020] In a possible design, the electronic device further includes a second camera, the second camera is configured to debug the exposure parameter of the foreground object, and the setting the exposure parameter of the first camera to the second exposure parameter includes: setting the exposure parameter of the first camera to the second exposure parameter according to a third exposure parameter of the second camera.
[0021] In the embodiment of the application, the electronic device includes a first camera and a second camera, the first camera is used to perform secondary exposure and secondary focusing, so that the first camera outputs a moon frame (that is, the first image) and a foreground frame (that is, the second image), and the first camera can perform exposure on the foreground object according to a third exposure parameter provided by the second camera before outputting the foreground frame, to improve the efficiency and the accuracy of exposure.
[0022] In a possible design, the exposure parameter of the first camera is set as the second exposure parameter according to a third exposure parameter of the second camera, including: setting the exposure parameter of the first camera as the second exposure parameter according to the third exposure parameter and exposure calibration results of the first camera and the second camera.
[0023] In the embodiment of the present application, the electronic device includes the first camera and the second camera, the first camera performs secondary exposure and secondary focusing to make the first camera output a moon frame (i.e., a first image) and a foreground frame (i.e., a second image), and before outputting the foreground frame, the first camera can correct a third exposure parameter provided by the second camera according to exposure calibration results of the two cameras, and perform exposure on the foreground object using the corrected exposure parameter, to improve the accuracy of exposure.
[0024] In the embodiment of the present application, the electronic device can focus on the foreground object according to the distance from the foreground object to the electronic device, to avoid that the foreground object cannot be focused because the brightness is too low and the blur is invisible.
[0025] In a possible design, the electronic device further includes a second camera, and the second camera is configured to focus on the foreground object, and the control of the first camera to focus on the foreground object includes: controlling the first camera to focus on the foreground object according to a first focusing position of the second camera.
[0026] In the embodiment of the present application, the electronic device includes the first camera and the second camera, the first camera performs secondary exposure and secondary focusing to make the first camera output a moon frame (i.e., a first image) and a foreground frame (i.e., a second image), and before outputting the foreground frame, the first camera can focus on the foreground object according to a first focusing position provided by the second camera, to improve the efficiency and the accuracy of focusing.
[0027] In a possible design, the control of the first camera to focus on the foreground object according to the first focusing position of the second camera includes: controlling the first camera to focus on the foreground object according to the first focusing position and focus position calibration results of the first camera and the second camera.
[0028] In the embodiment of the present application, the electronic device includes the first camera and the second camera, the first camera performs secondary exposure and secondary focusing to make the first camera output a moon frame (i.e., a first image) and a foreground frame (i.e., a second image), and before outputting the foreground frame, the first camera can correct a first focusing position provided by the second camera according to focusing position calibration results of the two cameras, and focus on the foreground object using the corrected focusing position, to improve the accuracy of focusing.
[0029] In a possible design, the first exposure parameter includes at least one of a first aperture, a first exposure duration, and a first ISO value, the second exposure parameter includes at least one of a second aperture, a second exposure duration, and a second ISO value, the second exposure parameter is greater than the first exposure parameter, and includes at least one of the following:
[0030] The second aperture is greater than the first aperture.
[0031] The second exposure duration is greater than the first exposure duration.
[0032] The second ISO value is greater than the first ISO value.
[0033] It should be noted that the above illustrates several examples of exposure parameters, and the exposure parameters can also be described by other parameters, which are not limited in the embodiments of the present application.
[0034] In a possible design, before entering the moon mode, the method further includes: determining that the foreground object satisfies at least one of the following conditions:
[0035] The foreground object is a preset object.
[0036] A distance between the foreground object and the electronic device is less than a preset distance.
[0037] An area occupied by the foreground object in the first preview image is greater than a preset area.
[0038] A reserved duration of the foreground object in the first preview image is greater than a preset duration.
[0039] In the embodiments of the present application, when the electronic device determines that there is a foreground object in the first preview image, it can be judged whether the foreground object satisfies the condition, and if yes, the moon mode is entered, so as to avoid resource waste caused by false entry into the moon mode.
[0040] In a possible design, the first preview image is an image output by the first camera, and the method further includes: displaying a second preview image in the preview interface, the second preview image being an image output by the second camera.
[0041] In the embodiments of the present application, the first camera output preview image and the second camera output preview image can be displayed in the preview interface of the camera. If the first camera uses lower exposure and focuses on the moon, the moon in the preview image of the first camera in the preview interface is clear; if the second camera uses higher exposure and focuses on the foreground object, the foreground object in the preview image of the second camera in the preview interface is bright and clear. In this way, through the preview interface, the user can see the final imaging effect of the moon and the foreground object, and the experience is good.
[0042] In a possible design, the second preview image is displayed on the first preview image in a floating manner, and / or at least one of the position and the display area of the second preview image is adjustable. In this way, the user can adjust the display position and area of the preview image according to own needs, to better view the imaging effect of the moon and the foreground object, and the experience is good.
[0043] In a possible design, the method further includes: updating the first preview image to the third image.
[0044] In the embodiments of the present application, the preview image is obtained by using twice exposure and twice focusing and then fusing, so that the user can see the imaging effect through the preview image, and the user experience is improved.
[0045] In a possible design, when the shooting instruction is received, the third image is stored.
[0046] In the embodiments of the present application, when the electronic device receives the shooting instruction, the preview image is stored as a shooting image, so that the effect seen by the user through the preview image is the effect obtained by the final shooting, which can be understood as "what you see is what you get". Since the preview image is obtained by using twice exposure and twice focusing and then fusing, the moon and the foreground object in the preview image are clear, and after the user clicks the shooting key, the preview image is directly stored without waiting for a long time, and the experience is good.
[0047] In a possible design, when the operation on the shooting key is received, the exposure parameter is the first exposure parameter; the moon is focused to obtain a fourth image; the exposure parameter is set to the second exposure parameter; the foreground object is focused to obtain a fifth image; the fourth image and the fifth image are fused to obtain a sixth image, and the sixth image is stored.
[0048] In the embodiments of the present application, the preview image is obtained by using twice exposure and twice focusing, and when the electronic device receives the shooting instruction, an image is obtained again by using twice exposure and twice focusing and stored as a shooting image.
[0049] In a possible design, when the first image only includes the moon and the second image includes the moon and the foreground object, the fusing the first image and the second image to obtain a third image includes: performing background filling on a region where the moon is located in the second image to obtain a fourth image; and fusing the fourth image and the first image to obtain the third image.
[0050] In the embodiments of the present application, the moon in the foreground frame (i.e., the first image) is filled with the background, and then the fourth image filled with the background is fused with the foreground frame (i.e., the second image), which can avoid inaccurate fusion caused by the halo of the moon in the foreground frame when the foreground frame is directly fused with the moon frame.
[0051] In a possible design, when the first image and the second image both include the moon and the foreground object, the fusing the first image and the second image to obtain a third image includes: performing background filling on a region where the foreground object is located in the first image to obtain a fifth image; performing background filling on a region where the moon is located in the second image to obtain a sixth image; and fusing the fifth image and the sixth image to obtain the third image.
[0052] In the embodiments of the present application, the foreground object in the moon frame (i.e., the first image) is filled with the background to obtain the fifth image, the moon in the foreground frame (i.e., the second image) is filled with the background to obtain the sixth image, and then the fifth image and the sixth image are fused, which can avoid inaccurate fusion caused by the halo of the moon in the foreground frame when the foreground frame is directly fused with the moon frame.
[0053] In a second aspect, the present application provides an electronic device, including modules / units for performing the method corresponding to any of the designs in the first aspect. These modules / units can be implemented by hardware, or by hardware executing corresponding software.
[0054] In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the method according to any of the first aspect.
[0055] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and when the computer program is executed by at least one processor, the method according to any of the first aspect is implemented.
[0056] In a fifth aspect, the present application provides a computer program product, which includes a computer program, and when the computer program is executed on a computer, the computer can execute the method according to any of the first aspect.
[0057] In a sixth aspect, the present application provides a chip, comprising a processor and an interface; the processor is configured to read instructions through the interface to execute the method according to any one of the first aspect.
[0058] The beneficial effects of the design in any one of the second aspect to the sixth aspect can refer to the beneficial effects of the corresponding design in the first aspect, and the present application will not repeat them one by one. BRIEF DESCRIPTION OF DRAWINGS
[0059] FIG. 1A is a schematic diagram of a user using an electronic device to take a picture of the moon according to an embodiment of the present application;
[0060] FIG. 1B is another schematic diagram of a user using an electronic device to take a picture of the moon according to an embodiment of the present application;
[0061] FIG. 2A is still another schematic diagram of a user using an electronic device to take a picture of the moon according to an embodiment of the present application;
[0062] FIG. 2B is still another schematic diagram of a user using an electronic device to take a picture of the moon according to an embodiment of the present application;
[0063] FIG. 3 is a flowchart of an image taking method according to an embodiment of the present application;
[0064] FIG. 4 is another flowchart of an image taking method according to an embodiment of the present application;
[0065] FIG. 5 is another flowchart of an image taking method according to an embodiment of the present application;
[0066] FIG. 6 is another schematic diagram of a user using an electronic device to take a picture of the moon according to an embodiment of the present application;
[0067] FIG. 7 is a flowchart of an image taking method according to an embodiment of the present application;
[0068] FIG. 8 is another flowchart of an image taking method according to an embodiment of the present application;
[0069] FIG. 9 is another flowchart of an image taking method according to an embodiment of the present application;
[0070] FIG. 10 is another schematic diagram of a user using an electronic device to take a picture of the moon according to an embodiment of the present application;
[0071] FIG. 11 is a flowchart of an image taking method according to an embodiment of the present application;
[0072] FIG. 12 is another flowchart of an image taking method according to an embodiment of the present application;
[0073] FIG. 13 is another flow diagram of an image capturing method according to an embodiment of the present application;
[0074] FIG. 14 is another diagram of a user capturing the moon using an electronic device according to an embodiment of the present application;
[0075] FIG. 15 is a diagram of an electronic device according to an embodiment of the present application;
[0076] FIG. 16 is another diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0077] In the following, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
[0078] At least one of the embodiments of the present application includes one or more, and the plurality means greater than or equal to two. In addition, it should be understood that in the description of the present specification, the terms "first", "second", and the like are used only to distinguish the description, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating or implying order. For example, the first camera and the second camera do not represent the importance or order of the two, but only distinguish the description. In the embodiments of the present application, "and / or" is only to describe the relationship, which means that there are three relationships, for example, A and / or B, which means that A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in this paper generally represents that the front and rear associated objects are a "or" relationship.
[0079] The orientation terms mentioned in the embodiments of the present application, such as "up", "down", "left", "right", "in", "out", and the like, are only the direction of the drawing, therefore, the orientation terms used are to better and more clearly illustrate and understand the embodiments of the present application, and are not to indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore, it cannot be understood as a limitation of the embodiments of the present application.
[0080] Reference within the specification to "one embodiment," "some embodiments," or "some examples" in
[0081] The image capturing method provided by the embodiments of the present application can be applied to an electronic device. The electronic device can be any device with an image capturing function. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a personal computer (PC), an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or the like; or, the electronic device can also be a wearable device such as a watch or a bracelet; or, the electronic device can also be a vehicle-mounted device such as a camera device of various types of vehicles or mounted on a vehicle; of course, the vehicle can be replaced by a train, an aircraft, a mobile platform, or other carriers or vehicles, and the present application does not limit the vehicle; or, the electronic device can also be a virtual reality (VR) device, an augmented reality (AR) device, a mixed reality (MR) device, or the like, and the embodiments of the present application do not limit the specific type of the electronic device.
[0082] Hereinafter, the image capturing method provided by the embodiments of the present application is described with reference to the case where the electronic device is a mobile phone.
[0083] When a user uses a mobile phone to capture a night scene, the moon is often used as the main subject of the captured image. Alternatively, when the user uses the mobile phone to capture the moon, the following two capturing modes can be included.
[0084] One kind of shooting mode is to only shoot the moon. For example, after the user starts the camera application in the mobile phone, the shooting angle, magnification, etc. are adjusted so that only the moon is included in the preview image of the camera. For example, as shown in FIG. 1A, only the moon is included in the preview image of the camera. In order to shoot a clear moon, the mobile phone can focus on the moon, and since the moon itself is relatively high in brightness, in order to prevent the moon from overexposure, a low exposure mode can be used for shooting. In this way, the image obtained by shooting only includes the moon, and the moon is not out of focus, not overexposed, and has appropriate brightness and is relatively clear. However, such an image is relatively monotonous, empty, lacks atmosphere, and lacks beauty.
[0085] Another kind of shooting mode is to shoot the moon and a foreground object. For example, after the user starts the camera application in the mobile phone, the shooting angle, magnification, etc. are adjusted so that both the moon and the foreground object are included in the preview image of the camera. The foreground object can be any object, such as a plant, an animal, a person, a building, etc. For example, as shown in FIG. 1B, the preview image of the camera includes the moon and leaves. In order to shoot a clear moon, the mobile phone can focus on the moon, and in order to prevent the moon from overexposure, a low exposure mode can be used for shooting. In this way, the image obtained by shooting includes the moon and the foreground object, and the moon is not out of focus, not overexposed, and can interact with the foreground object, thereby enhancing the atmosphere and beauty.
[0086] It should be noted that in the second kind of shooting mode described above, in order to make the moon in the image not out of focus and not overexposed, the mobile phone focuses on the moon and shoots with low exposure, but in this case, the foreground object in the image will be underexposed and out of focus, for example, in FIG. 1B, the foreground object is underexposed and out of focus, underexposure will cause the foreground object to be very dark and not bright enough, and out of focus will cause the foreground object to be blurred and not clear, and the specific reasons can include at least one of the following two items.
[0087] (1) In order to prevent the moon from overexposure, the mobile phone uses low exposure for shooting, but too low exposure, combined with too dark environment, will cause the foreground object to be underexposed, and thus the foreground object in the image will be dark and not bright enough. Of course, the user can increase the exposure to improve the brightness of the foreground object, but after increasing the exposure, the moon will be overexposed. That is, in the scene of shooting the moon and the foreground object, the moon needs a small exposure, and the foreground object needs a large exposure, and the difference in the demand for exposure is large, and they cannot be satisfied at the same time.
[0088] In order to prevent the moon from being out of focus, the mobile phone focuses on the moon for shooting. However, when focusing on the moon, the focusing position of the moon and the focusing position of the foreground object are very different, which leads to the failure to focus on the foreground object, and the foreground object is out of focus. Of course, the mobile phone can also focus on the foreground object. However, when focusing on the foreground object, the focusing position of the moon and the focusing position of the foreground object are very different, which leads to the failure to focus on the moon. That is, in the scene of shooting the moon and the foreground object, the moon and the foreground object cannot be focused at the same time. The reason why the focusing position of the moon and the focusing position of the foreground object are very different is that, in the real scene, the moon is at an infinite distance, and the distance between the moon and the foreground object is very far. For the mobile phone camera, the difference between the focusing position of the moon and the focusing position of the foreground object is very large.
[0089] In summary, through the above shooting mode, the moon and the foreground object cannot be shot without being out of focus, and the image of the moon is not overexposed and the foreground is not underexposed.
[0090] In view of this, the embodiment of the present application provides an image shooting method. In the method, when the mobile phone shoots the moon and the foreground object, the mobile phone can use the way of twice exposure and / or twice focusing for shooting. The twice exposure can include using a lower exposure for the moon and using a higher exposure for the foreground object. The image obtained by the twice exposure is fused to obtain the shot image, so that the moon is not overexposed and the foreground object is not underexposed on the image. The twice focusing can include focusing on the moon once and focusing on the foreground object once. The image obtained by the twice focusing is fused to obtain the shot image, so that the moon and the foreground object are not out of focus on the image. Therefore, the technical solution provided by the embodiment of the present application can improve the image quality in the scene of shooting the moon and the foreground object.
[0091] As an example, please refer to FIG. 2A, which is a schematic diagram of the process of shooting the moon by the user using the mobile phone according to an embodiment of the present application. As shown in (a) of FIG. 2A, the mobile phone displays a graphical user interface (GUI), which is the desktop of the mobile phone. The desktop of the mobile phone includes an icon 201 of a camera application. When the mobile phone receives an operation on the icon 201, a preview interface 202 as shown in (b) of FIG. 2A is displayed. The preview interface 202 includes a preview image. The preview image includes the moon and the foreground object (for example, leaves). In this example, the preview image is obtained by the technical solution provided by the embodiment of the present application, so the moon and the foreground object in the preview image are relatively clear. When the mobile phone receives an operation on the shooting key, an image is shot, and the moon and the foreground object in the image are relatively clear. In this example, the user can feel the final shooting effect through the preview image, and the experience is good.
[0092] It should be noted that in (b) of FIG. 2A, the phone displays the preview image, and the technical solution provided in the embodiments of the present application has been started. The preview image is obtained by the technical solution provided in the embodiments of the present application. In other embodiments, considering that after the user opens the preview image of the camera, the user may not take a photo or wait for a long time before taking a photo. If the technical solution provided in the embodiments of the present application is started when the preview image is displayed, it will generate a large amount of calculation, resulting in waste of resources. Therefore, as another example, when the phone displays the preview image, the technical solution provided in the embodiments of the present application does not need to be started, and when the phone receives an operation on the shooting key, the technical solution provided in the embodiments of the present application is started to take a photo, to ensure that the moon and the foreground object in the taken image are both clear.
[0093] As an example, please refer to FIG. 2B, which is another schematic diagram of a process of taking a photo of the moon by a user using a phone according to an embodiment of the present application. As shown in (a) of FIG. 2B, the phone displays a GUI, which is a desktop of the phone. The desktop of the phone includes an icon 201 of a camera application. When the phone receives an operation on the icon 201, a preview interface 202 as shown in (b) of FIG. 2B is displayed. The preview interface 202 includes a preview image. In this example, the preview image is not obtained by using the technical solution provided in the embodiments of the present application, for example, the moon in the preview image is clear and the foreground object is out of focus. When the phone receives an operation on a shooting key, an image is taken by using the technical solution provided in the embodiments of the present application and is stored, for example, an interface as shown in (c) of FIG. 2B is displayed, and the interface includes a thumbnail 203 of the taken image. When the phone receives an operation on the thumbnail 203, an interface as shown in (d) of FIG. 2B is displayed, and the interface includes an image taken by using the technical solution provided in the embodiments of the present application, and the moon and the foreground object in the image are both clear. In this example, although the moon in the preview image is clear and the foreground object is clear, the final taken image has both the moon and the foreground object clear, and since the technical solution provided in the embodiments of the present application is not started during the process of displaying the preview image, the calculation amount can be saved and resource waste can be avoided.
[0094] The technical solution provided in the embodiments of the present application is described in detail below. As described above, in the technical solution provided in the embodiments of the present application, when the phone takes a photo of the moon and the foreground object, the phone can take a photo by using twice exposure and / or twice focusing. Therefore, the embodiments of the present application include three schemes: the first scheme, twice exposure; the second scheme, twice focusing; and the third scheme, twice exposure + twice focusing. The three schemes are described below. It should be noted that any technical feature in any of the three schemes below can be applied to the other two schemes, and the technical features described in one scheme are not repeated here for the sake of brevity.
[0095] The first solution is double exposure
[0096] In this solution, when the mobile phone captures the moon and the foreground object, double exposure can be performed, for example, a lower exposure is used for the moon and a higher exposure is used for the foreground object, and the image obtained by double exposure is fused to obtain the captured image, so that the moon is not overexposed and the foreground object is not underexposed. It should be noted that the focusing position in the double exposure process of this solution can remain unchanged, for example, the moon is always in focus. As described above, when the moon is in focus, the foreground object cannot be focused. It should be noted that in this solution, although the foreground object is not in focus, the underexposure problem of the foreground object is solved through double exposure, which improves the brightness and visibility of the foreground object in the image and improves the image quality.
[0097] For example, please refer to FIG. 3, which is a flowchart of an image capturing method provided by an embodiment of the present application. The method can be applied to an electronic device, for example, a mobile phone. As shown in FIG. 3, the flowchart includes the following steps:
[0098] S301, determining whether there is a moon in the preview image; if yes, performing S302, otherwise, performing S301.
[0099] It can be understood that before S301, the mobile phone can also display a preview image by starting a camera application.
[0100] As an example, the mobile phone can include an image semantic recognition function, which can recognize various objects in the preview image. The image semantic recognition process is not described in detail in the embodiments of the present application.
[0101] S302, determining whether there is a foreground object in the preview image; if yes, performing S304, otherwise, performing S303.
[0102] The embodiments of the present application do not limit the type of foreground object. For example, the foreground object can include any type of object such as a person, an animal, a plant, a building, etc. Optionally, when the mobile phone determines that there is a foreground object in the preview image, it can also determine whether the foreground object meets the condition, if yes, performing S304, if not, performing S303. As an example, the condition can include at least one of the following:
[0103] (1) The foreground object is a preset object. The preset object can include various types of objects such as a person, an animal, a plant, a building, etc. As an example, the preset object can be stored in the mobile phone in advance. That is, if the foreground object is not a preset object, the double focusing capturing mode can not be used.
[0104] (2) The distance between the foreground object and the mobile phone is less than a preset distance. The preset distance can be 5m, 10m, 20m, etc., and the specific value is not limited in the embodiment of the application. For example, if the distance between the foreground object and the mobile phone is very far, for example, the foreground object is a mountain far away, the shooting mode of secondary focusing can not be used.
[0105] (3) The area occupied by the foreground object in the preview image is greater than a preset area; or the ratio between the area occupied by the foreground object in the preview image and the total area of the preview image is greater than a preset value. The preset value can be 30%, 50%, etc. That is, if the area occupied by the foreground object in the preview image is very small, it means that the user can not have adjusted the shooting angle well, resulting in that the foreground object is mistakenly in the shooting range of the lens, and the shooting mode of secondary focusing can not be used. On the contrary, if the area occupied by the foreground object in the preview image is relatively large, it means that the foreground object is the object that the user wants to shoot, and the shooting mode of secondary focusing can be used.
[0106] (4) The retention time of the foreground object in the preview image is greater than a preset time length. The retention time can also be referred to as the stay time, the stable time, etc., or the time length during which the foreground object exists on the preview image is greater than a preset time length. It should be understood that if the foreground object appears on the preview image for a short time, it means that the user can not have adjusted the shooting angle well, resulting in that the foreground object is mistakenly in the shooting range of the lens, and the shooting mode of secondary focusing can not be used. On the contrary, if the foreground object stays in the preview image for a long time, it means that the foreground object is the object that the user wants to shoot, and the shooting mode of secondary focusing can be used.
[0107] S303, entering a first moon mode.
[0108] In this embodiment, the first moon mode can include a mode of shooting the moon using low exposure. Optionally, the first moon mode can also include focusing on the moon.
[0109] As an example, after S303, the following can also be included: outputting first prompt information, the first prompt information being used to prompt that the first moon mode has been entered. For example, the first prompt information can be text information displayed in the preview interface of the camera.
[0110] S304, entering a second moon mode.
[0111] In the embodiment, the second moon mode can include: a shooting mode of first shooting a moon frame (i.e., the first image) using a low exposure, then shooting a foreground frame (i.e., the second image) using a high exposure, and then fusing the moon frame and the foreground frame; or a shooting mode of first shooting a foreground frame (i.e., the second image) using a high exposure, then shooting a moon frame (i.e., the first image) using a low exposure, and then fusing the moon frame and the foreground frame. Optionally, the second moon mode can further include: focusing on the moon.
[0112] As an example, after S304, the method can further include: outputting second prompt information, the second prompt information being used to prompt that the second moon mode has been entered. For example, the second prompt information can be text information displayed in a preview interface of the camera.
[0113] S305, setting an exposure parameter as a first exposure parameter. As an example, the first exposure parameter is relatively small, which is suitable for the moon and can prevent the moon from being overexposed.
[0114] S306, obtaining a first image. It should be understood that the moon in the first image is not overexposed.
[0115] S307, setting the exposure parameter as a second exposure parameter. The second exposure parameter is greater than the first exposure parameter. As an example, the second exposure parameter is relatively large, which is suitable for the foreground object and can make the foreground object in the image bright and visible.
[0116] In the embodiment of the present application, the first exposure parameter can include at least one of a first aperture, a first exposure time, and a first ISO value; and the second exposure parameter can include at least one of a second aperture, a second exposure time, and a second ISO value. The second exposure parameter is greater than the first exposure parameter, including at least one of the following:
[0117] (1) The second aperture is greater than the first aperture. The aperture can be understood as the aperture of light, and the greater the aperture, the greater the amount of light, and the greater the exposure. Since the light in the shooting environment is relatively dark, a smaller aperture can be used when shooting the moon, and a larger aperture can be used when shooting the foreground object to improve the brightness of the foreground object.
[0118] (2) The second exposure time is greater than the first exposure time. It should be understood that the longer the exposure time, the greater the amount of light, and the greater the exposure. Since the light in the shooting environment is relatively dark, a shorter exposure time can be used when shooting the moon, and the exposure time can be increased when shooting the foreground object to improve the brightness of the foreground object.
[0119] (3) The second ISO value is greater than the first ISO value. The ISO value is used to express the light sensing capability of a light sensing element, the greater the ISO value, the stronger the capability of the light sensing element, the greater the image brightness, and vice versa, the smaller the ISO value, the weaker the capability of the light sensing element, the smaller the image brightness. Therefore, the camera for shooting the moon can be a light sensing element with a small ISO, and the camera for shooting the foreground object can be a light sensing element with a large ISO.
[0120] In the embodiments of the present application, the second exposure parameter is used for the foreground object, and the exposure parameter is set to the second exposure parameter in S307 in multiple ways, including but not limited to way A and way B. Way A, using the brightness evaluation result of the foreground object, the exposure parameter is set to the second exposure parameter. Way B, the mobile phone includes two cameras, the first camera is used to output the first image and the second image, and the second camera is used to debug the exposure parameter of the foreground object, and the first camera can set the exposure parameter to the second exposure parameter according to the exposure parameter provided by the second camera. Way A and way B will be described in detail below.
[0121] S308, obtaining the second image. It should be understood that the foreground object on the second image is not underexposed.
[0122] S309, fusing the first image and the second image to obtain a third image.
[0123] In some embodiments, before S309, it can also include: registering the first image and the second image. The specific registration method is not limited in the embodiments of the present application, for example, binocular registration can be used.
[0124] In some embodiments, taking the example of focusing on the moon all the time in the double exposure process, the first image can only include the moon (e.g., the first image is obtained by the telephoto camera), and the moon is not overexposed and not out of focus. The second image includes the moon and the foreground object (e.g., the second image is obtained by the wide-angle camera), and the foreground object is not underexposed, but the moon is out of focus and overexposed. In this case, one possible fusion method is that since the first image does not contain the foreground object, and the foreground object is not underexposed in the second image, the phone can outline the edge profile of the region where the foreground object is located in the second image, and copy or cut the region to fill into the first image. Another possible fusion method is that since the foreground object is not underexposed in the second image, and the moon is overexposed, the phone can use background filling on the region where the moon is located in the second image to obtain a fourth image, so that the moon disappears in the fourth image, and then fuse the fourth image and the first image. Alternatively, after obtaining the fourth image, the phone can also outline the edge profile of the region where the moon is located in the first image, and copy or cut the region to fill into the fourth image. It should be noted that considering that the moon in the second image has a halo due to overexposure, the area of the moon will be larger than that of the normal moon, so when the phone uses background filling on the region where the moon is located in the second image, the out-of-focus region of the moon can be completely filled with background, so that the moon and the halo in the fourth image disappear.
[0125] In some embodiments, taking the example of focusing on the moon all the time in the double exposure process, the first image can only include the moon (e.g., the first image is obtained by the telephoto camera), and the moon is not overexposed and not out of focus. The second image includes the moon and the foreground object (e.g., the second image is obtained by the wide-angle camera), and the foreground object is not underexposed, but the moon is out of focus and overexposed. In this case, one possible fusion method is that since the first image does not contain the foreground object, and the foreground object is not underexposed in the second image, the phone can outline the edge profile of the region where the foreground object is located in the second image, and copy or cut the region to fill into the first image. Another possible fusion method is that since the foreground object is not underexposed in the second image, and the moon is overexposed, the phone can use background filling on the region where the moon is located in the second image to obtain a fourth image, so that the moon disappears in the fourth image, and then fuse the fourth image and the first image. Alternatively, after obtaining the fourth image, the phone can also outline the edge profile of the region where the moon is located in the first image, and copy or cut the region to fill into the fourth image. It should be noted that considering that the moon in the second image has a halo due to overexposure, the area of the moon will be larger than that of the normal moon, so when the phone uses background filling on the region where the moon is located in the second image, the out-of-focus region of the moon can be completely filled with background, so that the moon and the halo in the fourth image disappear.
[0126] As an example, the phone can store the third image. Optionally, the phone can also store the first image and / or the second image for the user to view and compare.
[0127] [Corrected according to Rule 91 on 20.05.2025] It should be noted that in the embodiment shown in FIG. 3, the first exposure is performed for the moon and then for the foreground object. It can be understood that the first exposure can also be performed for the foreground object and then for the moon. In short, the order of the two exposures is not limited.
[0128] As an example, the flow shown in FIG. 3 can be executed immediately after the phone starts the camera application. For example, after the phone starts the camera application, S301 is executed immediately, and when the third image is obtained through S301-S309, the third image can be used as a new preview image. That is, the preview image of the phone is the image obtained through the second exposure. As another example, the flow shown in FIG. 3 can also be executed when the phone receives an operation of the user clicking the shutter key. For example, when the phone receives an operation of the user clicking the shutter key, S301 is executed, and after the third image is obtained through S301-S309, the third image is stored as a captured image. As another example, the phone can execute S301 immediately after starting the camera application, and when the third image is obtained through S301-S309, the third image is used as a new preview image. Then, when the phone receives an operation for the shutter key, there are two processing methods. One, the phone can use a zero shutter lag (ZSL) method to obtain a captured image, that is, the current preview image (i.e., the third image) is stored as a captured image. That is, the effect seen by the user through the preview image is the effect obtained by the final shooting, which can be understood as "what you see is what you get". Two, the phone can also execute S305-S309 again to obtain a new image when it receives an operation for the shutter key, and store the new image as a captured image.
[0129] In some embodiments, the second exposure shown in FIG. 3 can be two exposures by the same camera. For example, the phone includes a first camera, and the second exposure is performed by the first camera. For example, the first camera can be a telephoto camera in the phone. Of course, the first camera can also be other cameras, such as a main camera, a secondary main camera, a wide-angle camera, etc. The type of the first camera is not limited in the embodiments of the present application. The second exposure process of the first camera can include: the first camera uses a first exposure parameter to capture the moon to obtain a first image, and the first camera uses a second exposure parameter to capture the foreground object to obtain a second image.
[0130] In the embodiments of the present application, before the first camera captures the foreground object using the second exposure parameter, the phone needs to set the exposure parameter of the first camera to the second exposure parameter. The specific setting method can include at least one of the following method A and method B:
[0131] In the manner A, the mobile phone can evaluate the brightness (e.g., the RGB brightness) of the foreground object, and set the exposure parameter of the first camera as the second exposure parameter according to the brightness of the foreground object. For example, when the brightness of the foreground object is low, a larger exposure parameter can be used to prevent underexposure of the foreground object.
[0132] In the manner B, the mobile phone further includes a second camera, and the second camera is used to debug the exposure parameter of the foreground object. The mobile phone can set the exposure parameter of the first camera as the second exposure parameter according to the third exposure parameter of the second camera. The second camera and the first camera have an overlapping shooting range, for example, the second camera and the first camera are both rear cameras, or both are front cameras, etc. As an example, the second camera can be a wide-angle camera, and of course, can also be other cameras, such as a main camera, a secondary main camera, a telephoto camera, a normal camera, etc. Optionally, the second camera and the first camera can be the same type of camera, or can be different types of cameras, and the embodiments of the present application are not limited. For the implementation process of the manner B, please refer to FIG. 4. As shown in FIG. 4, another flowchart of the image shooting method provided by an embodiment of the present application is shown. The method can be applied to an electronic device, such as a mobile phone. As shown in FIG. 4, the flowchart includes:
[0133] S401, it is judged whether there is a moon in the preview image. If yes, S402 is executed, otherwise, S401 is continuously executed.
[0134] S402, it is judged whether there is a foreground object in the preview image. If yes, S404 is executed, otherwise, S403 is executed.
[0135] S403, the first moon mode is entered.
[0136] S404, the second moon mode is entered.
[0137] For the implementation principle of S401 to S404, please refer to S301 to S304 in FIG. 3 in the foregoing, which will not be repeated.
[0138] S405, the exposure parameter of the first camera is set as the first exposure parameter.
[0139] S406, the first camera obtains the first image.
[0140] S407, the second camera debugs the exposure parameter of the foreground object to find the exposure parameter suitable for the foreground object.
[0141] S408, the third exposure parameter of the second camera is provided to the first camera. The third exposure parameter can be the exposure parameter of the second camera which can shoot the foreground object without underexposure and overexposure.
[0142] S409, set the exposure parameter of the first camera as the second exposure parameter according to the third exposure parameter of the second camera.
[0143] As an example, the third exposure parameter of the second camera is directly taken as the second exposure parameter of the first camera. In other words, the third exposure parameter is the same as the second exposure parameter.
[0144] As another example, considering that there is a difference between different cameras, if the third exposure parameter of the second camera is directly taken as the second exposure parameter of the first camera, it may cause improper exposure of the first camera. In order to improve accuracy, the mobile phone can determine the second exposure parameter of the first camera according to the third exposure parameter of the second camera and the exposure calibration result between the first camera and the second camera, so that the first camera can capture an image with proper exposure of the foreground object based on the second exposure parameter, without underexposure or overexposure. Optionally, the exposure calibration result between the first camera and the second camera can be stored in the mobile phone in advance, for example, when the mobile phone is manufactured.
[0145] S410, the first camera obtains the second image.
[0146] S411, the first image and the second image are fused to obtain a third image.
[0147] For the implementation principle of S411, please refer to S309 in FIG. 3 described above, which is not repeated here.
[0148] In the above embodiment, the same camera (i.e. the first camera) outputs the moon frame (i.e. the first image) and the foreground frame (i.e. the second image) respectively. In this way, since the first image and the second image come from the same camera, they are naturally aligned and do not need to be additionally registered, which reduces the difficulty of registration and improves efficiency.
[0149] In another embodiment, the double-exposure process shown in FIG. 3 can also be that two different cameras are exposed once respectively. For example, the mobile phone includes a first camera and a second camera. The first camera obtains a first image with a first exposure parameter, and the second camera obtains a second image with a second exposure parameter, that is, the two cameras are exposed respectively and the exposure parameters are different, and the double-exposure is completed. The types of the first camera and the second camera can be referred to the description above, which is not repeated here. For example, please refer to FIG. 5, which is another flowchart of an image capturing method provided by an embodiment of the present application. The method can be applied to an electronic device, such as a mobile phone. As shown in FIG. 5, the flowchart includes:
[0150] S501, determine whether there is a moon in the preview image. If yes, execute S502, otherwise continue to execute S501.
[0151] S502, determine whether there is a foreground object in the preview image. If there is, execute S504, otherwise, execute S503.
[0152] S503, enter the first moon mode.
[0153] S504, enter the second moon mode.
[0154] S505, the exposure parameter of the first camera is the first exposure parameter.
[0155] S506, the first camera obtains the first image.
[0156] S507, the exposure parameter of the second camera is the second exposure parameter. The second exposure parameter is greater than the first exposure parameter.
[0157] S508, the second camera obtains the second image.
[0158] S509, fuse the first image and the second image to obtain the third image.
[0159] For the implementation principle of S501 to S509, please refer to S301 to S309 in the foregoing FIG. 3, which will not be repeated here.
[0160] In the embodiment shown in FIG. 5, the double cameras are used to take pictures by exposure respectively. Since the double cameras can output frames synchronously, the time for outputting frames is short, and the user does not need to wait for a long time, thereby improving the shooting experience.
[0161] In some embodiments, in the scenario of the double cameras shown in FIG. 4 or FIG. 5, the mobile phone can display the preview images of the two cameras respectively in the preview interface of the camera. For example, as shown in (a) of FIG. 6, when the mobile phone receives an operation on the icon 201 of the camera application, the preview interface 202 as shown in (b) of FIG. 6 is displayed. The preview interface 202 includes a main preview image 601 and an auxiliary preview image 602. The main preview image 601 and the auxiliary preview image 602 can be images output by the first camera and the second camera respectively. For example, the main preview image 601 can be an image output by the first camera based on the first exposure parameter (low exposure), and the moon in the main preview image 601 is not overexposed. Optionally, the moon in the main preview image 601 can be in focus. The auxiliary preview image 602 can be an image output by the second camera based on the second exposure parameter (high exposure), and the foreground object in the auxiliary preview image 602 is not underexposed and is relatively bright.
[0162] As an example, the auxiliary preview image 602 can be displayed on the main preview image 601 in a floating manner. The display position, display area, etc. of the auxiliary preview image 602 are not limited in the embodiments of the present application. By way of example, by default, the auxiliary preview image 602 is located at the upper left corner of the main preview image 601 and occupies 1 / 4 of the total area of the main preview image 601. Optionally, at least one of the display position and display area of the auxiliary preview image 602 can be adjusted. For example, when the phone receives an operation for adjusting the display position of the auxiliary preview image 602 (e.g., a long-press-and-drag operation on the auxiliary preview image 602), the display position of the auxiliary preview image 602 is adjusted. For example, when the phone receives an operation for changing the display area of the auxiliary preview image 602 (e.g., a zoom-in or zoom-out operation on the auxiliary preview image 602), the display area of the auxiliary preview image 602 is adjusted.
[0163] As another example, the display position of the main preview image 601 and the display position of the auxiliary preview image 602 can be exchanged. For example, when the phone receives a switching operation (e.g., an operation of clicking the auxiliary preview image 602 by the user), the display position of the auxiliary preview image 602 and the display position of the main preview image 601 are exchanged.
[0164] In some embodiments, the field of view FOV of the first camera and the field of view FOV of the second camera can not be exactly the same. For example, the first camera is a telephoto camera, and the second camera is a wide-angle camera. The field of view FOV of the first camera can be smaller than the field of view FOV of the second camera. Therefore, the shooting range corresponding to the main preview image 601 is smaller than the shooting range corresponding to the auxiliary preview image 602. For example, in (b) of FIG. 6, the main preview image 601 only includes the moon and does not include the foreground object. The auxiliary preview image 602 includes both the moon and the foreground object.
[0165] In other embodiments, the magnification of the first camera and the magnification of the second camera can be the same or different. By way of example, the magnification of the first camera can be higher than the magnification of the second camera. For example, in (b) of FIG. 6, the main preview image 601 is an image output by the first camera through a larger magnification, and the image only includes the moon and does not include the foreground object. The auxiliary preview image 602 is an image output by the second camera through a smaller magnification, and the image includes both the moon and the foreground object.
[0166] Therefore, in (b) of FIG. 6, the user sees the shooting effect of the moon and the foreground object through the main preview image 601 and the auxiliary preview image 602 respectively. When the phone receives the operation according to the key, the interface shown in (c) of FIG. 6 is displayed, which includes the thumbnail 603 of the photographed image. When the phone receives the operation on the thumbnail 603, the interface shown in (d) of FIG. 6 is displayed, which includes the photographed image, on which the moon is clear and the foreground object is relatively bright and not dark and invisible due to underexposure.
[0167] The second scheme, double focusing
[0168] In this scheme, when the phone photographs the moon and the foreground object, double focusing can be performed, in which the moon is focused once and the foreground object is focused once, and the photographed image is obtained by fusing the images obtained by the double focusing, so that the moon and the foreground object on the image are not out of focus. It should be noted that the exposure can remain unchanged during the double focusing process of this scheme, for example, the low exposure suitable for the moon is always used. As described above, although the moon is not overexposed and the foreground object is easily underexposed in low exposure, it should be noted that in this scheme, although the foreground object is easily underexposed, the out-of-focus problem of the foreground object is solved by double focusing, which improves the clarity of the foreground object on the image and improves the image quality to a certain extent.
[0169] For example, please refer to FIG. 7, which is a flowchart of an image shooting method provided by an embodiment of the present application. The method can be applied to an electronic device, for example, a phone. As shown in FIG. 7, the flowchart includes:
[0170] S701, determining whether there is a moon in the preview image; if yes, performing S702, otherwise, continuing to perform S701.
[0171] S702, determining whether there is a foreground object in the preview image; if yes, performing S704, otherwise, performing S703.
[0172] S703, entering a first moon mode.
[0173] In this embodiment, the first moon mode can include a shooting mode of focusing on the moon. Optionally, the first moon mode can also include using low exposure.
[0174] S704, entering a second moon mode.
[0175] In this embodiment, the second moon mode can include: a shooting mode of first focusing on the moon to obtain a moon frame (i.e., the first image), then focusing on the foreground object to obtain a foreground frame (i.e., the second image), and then fusing the moon frame and the foreground frame; or a shooting mode of first focusing on the foreground object to obtain a foreground frame (i.e., the second image), then focusing on the moon to obtain a moon frame (i.e., the first image), and then fusing the moon frame and the foreground frame. Optionally, the second moon mode can further include using low exposure.
[0176] S705, focusing on the moon.
[0177] As an example, the mobile phone can push the lens to move to a corresponding position by the camera motor, so that the lens can focus on the moon at the position to obtain a clear moon.
[0178] S706, obtaining the first image. It should be understood that the moon on the first image is not out of focus.
[0179] S707, focusing on the foreground object.
[0180] As an example, the mobile phone can push the lens to move to a corresponding position by the camera motor, so that the lens can focus on the foreground object at the position to obtain a clear foreground object.
[0181] In the embodiments of the present application, there are multiple ways to focus on the foreground object, including but not limited to way C and way B. Way C, using the distance measured by the ranging unit to focus on the foreground object. Way D, the mobile phone includes two cameras, the first camera is used to output the first image and the second image, and the second camera is used to focus on the foreground object, and the first camera can focus on the foreground object according to the focusing position provided by the second camera. Way C and way D will be described in detail later.
[0182] As described above, low exposure can be used throughout the two focusing processes to prevent the moon from overexposure. It should be noted that generally, when the exposure is low, the foreground object on the image will be underexposed, and underexposure will make it difficult to focus on the foreground object. In this embodiment, the foreground object can be focused by way C and way D, so even if the foreground object is underexposed, the foreground object can be accurately focused.
[0183] S708, obtaining the second image. It should be understood that the foreground object on the second image is not out of focus.
[0184] S709, fusing the first image and the second image to obtain a third image. The moon and the foreground object on the third image are clear.
[0185] For the implementation principle of S709, please refer to S309 in FIG. 3 in the foregoing description, which will not be repeated here.
[0186] In some embodiments, the double focusing shown in FIG. 7 can be two focusing by the same camera. For example, the phone includes a first camera, and the double focusing is performed by the first camera. The type of the first camera is described above. The double focusing process of the first camera can include: after the first camera focuses on the moon to obtain a first image, adjusting the lens position to focus on the foreground object to obtain a second image.
[0187] In the embodiments of the present application, the manner in which the first camera focuses on the foreground object can include at least one of the following manners C and D:
[0188] Manner C, the phone includes a ranging unit, the ranging unit is configured to measure the distance between the foreground object and the phone, and control the first camera to focus on the foreground object according to the distance. For example, the phone stores a corresponding relationship, the corresponding relationship includes different distances between the shooting object and the phone, and the focusing position corresponding to each distance. After the phone obtains the distance between the foreground object and the phone, the focusing position of the foreground object can be determined based on the distance and the corresponding relationship, and then the first camera is controlled to focus on the foreground object based on the determined focusing position. For example, the corresponding relationship can be configured in the phone when the phone is manufactured. As an example, the ranging unit can be based on at least one of a plurality of ranging technologies such as laser ranging, ultrasonic ranging, radar ranging, time of flight (TOF), etc.
[0189] Manner D, the phone further includes a second camera, the second camera is configured to focus on the foreground object. The phone can control the first camera to focus on the foreground object according to the focusing position of the second camera. For the implementation process of manner D, please refer to FIG. 8. FIG. 8 is another flowchart of an image shooting method according to an embodiment of the present application. The method can be applied to an electronic device such as a phone. As shown in FIG. 8, the flowchart includes:
[0190] S801, determining whether there is a moon in the preview image; if yes, performing S802, otherwise, continuing to perform S801.
[0191] S802, determining whether there is a foreground object in the preview image; if yes, performing S804, otherwise, performing S803.
[0192] S803, entering a first moon mode.
[0193] S804, entering a second moon mode.
[0194] For the implementation principle of S801 to S804, please refer to S301 to S304 in FIG. 3 described above, which will not be repeated here.
[0195] S805, the first camera focuses on the moon.
[0196] S806, the first camera obtains the first image.
[0197] S807, the second camera focuses on the foreground object.
[0198] S808, the first camera is provided with the first focus position of the second camera. The first focus position can be the focus position when the second camera focuses on the foreground object, which can be the position of the lens of the second camera, for example.
[0199] S809, according to the first focus position of the second camera, the first camera is controlled to focus on the foreground object.
[0200] As an example, the first focus position of the second camera can be directly used as the focus position of the first camera. For example, the first focus position of the second camera is position A, and the first camera can move the lens so that the focus position of the first camera is adjusted to position A.
[0201] As another example, considering that there are differences between different cameras, if the first focus position of the second camera is directly used as the focus position of the first camera, the first camera can not accurately focus on the foreground object. In order to improve the accuracy, the mobile phone can determine the focus position of the first camera according to the first focus position of the second camera and the focal point position calibration result between the first camera and the second camera, so that the first camera can accurately focus on the foreground object based on the determined focus position. Optionally, the focal point position calibration result between the first camera and the second camera can be stored in the mobile phone in advance, for example, when the mobile phone is manufactured.
[0202] S810, the first camera obtains the second image.
[0203] S811, the first image and the second image are fused to obtain the third image.
[0204] For the implementation principle of S811, please refer to S309 in FIG. 3 in the foregoing, which will not be repeated here.
[0205] In the above embodiment, the same camera (i.e. the first camera) is used to output the moon frame (i.e. the first image) and the foreground frame (i.e. the second image) respectively. In this way, since the first image and the second image come from the same camera, they are naturally aligned and do not need to be additionally registered, which reduces the difficulty of registration and improves the efficiency.
[0206] In some other embodiments, the double focusing shown in FIG. 7 can also be one focusing by each of the two different cameras. For example, a mobile phone can include a first camera and a second camera. The first camera focuses on the moon to obtain a first image, and the second camera focuses on the foreground object to obtain a second image, i.e., each of the two cameras focuses once, and the two focusing is completed. The types of the first camera and the second camera can refer to the description above, which will not be repeated here. For example, please refer to FIG. 9, which is another flowchart of the image shooting method provided by an embodiment of the present application. The method can be applied to an electronic device, such as a mobile phone. As shown in FIG. 9, the flowchart includes:
[0207] S901, determining whether there is a moon in the preview image; if yes, performing S902, otherwise, continuing to perform S901.
[0208] S902, determining whether there is a foreground object in the preview image; if yes, performing S904, otherwise, performing S903.
[0209] S903, entering a first moon mode.
[0210] S904, entering a second moon mode.
[0211] S905, focusing on the moon by the first camera.
[0212] S906, obtaining a first image by the first camera.
[0213] S907, focusing on the foreground object by the second camera.
[0214] S908, obtaining a second image by the second camera.
[0215] S909, fusing the first image and the second image to obtain a third image.
[0216] In the embodiment shown in FIG. 9, the moon and the foreground object are focused by the two cameras respectively, and since the two cameras can be synchronized to frame, the framing time is short, and the user does not need to wait for a long time, which improves the shooting experience.
[0217] In some embodiments, in the dual camera scenario shown in FIG. 8 or FIG. 9, the phone can display the preview images of the two cameras respectively in the preview interface of the camera. For example, as shown in (a) of FIG. 10, the phone receives an operation on the icon 201 of the camera application, and displays the preview interface 202 as shown in (b) of FIG. 10. The preview interface 202 includes a main preview image 1001 and an auxiliary preview image 1002. The main preview image 1001 and the auxiliary preview image 1002 can be the images output by the first camera and the second camera respectively. For example, the main preview image 1001 can be the image output by the first camera after focusing on the moon, so the moon in the main preview image 1001 is not out of focus. Optionally, the main preview image 1001 can be obtained using low exposure. The auxiliary preview image 1002 can be the image output by the second camera after focusing on the foreground object, so the foreground object in the auxiliary preview image 1002 is not out of focus.
[0218] As an example, the auxiliary preview image 1002 can be displayed floating on the main preview image 1001. Optionally, at least one of the display position and the display area of the auxiliary preview image 1002 can be adjustable.
[0219] As another example, the display position of the main preview image 1001 and the display position of the auxiliary preview image 1002 can be exchanged. For example, the phone receives a switching operation (for example, an operation of the user clicking the auxiliary preview image 1002), and the auxiliary preview image 1002 and the main preview image 1001 exchange the display positions.
[0220] In some embodiments, the field of view FOV of the first camera and the second camera can not be exactly the same. Alternatively, the magnification of the first camera and the second camera can be the same or different.
[0221] Therefore, in (b) of FIG. 10, the user sees the shooting effect of the moon and the foreground object through the main preview image 1001 and the auxiliary preview image 1002 respectively. When the phone receives an operation on the shutter key, an interface as shown in (c) of FIG. 10 is displayed, which includes a thumbnail 1003 of the image obtained by shooting. When the phone receives an operation on the thumbnail 1003, an interface as shown in (d) of FIG. 10 is displayed, which includes the image obtained by shooting, and the moon and the foreground object in the image are clear.
[0222] The third scheme is double exposure + double focusing.
[0223] Taking the first scheme in the foregoing as an example, assuming that the focusing position remains unchanged during the second exposure process and the moon is always in focus, although the brightness of the foreground object is improved through the second exposure, the definition of the foreground object on the image is still poor because the foreground object is not in focus. Therefore, the second scheme can be added on the basis of the first scheme.
[0224] Taking the second scheme in the foregoing as an example, assuming that the exposure remains unchanged during the second focusing process and the low exposure suitable for the moon is always used, although the definition of the foreground object is improved through the second focusing, the brightness of the foreground object on the image is poor because the exposure is small. Therefore, the second exposure can be added on the basis of the second scheme.
[0225] Therefore, in the second scheme, when the moon and the foreground object are photographed, the second exposure and the second focusing can be performed, so that the moon and the foreground object are not out of focus on the image obtained by photographing, and the moon is not overexposed and the foreground object is not underexposed.
[0226] It should be noted that the order of exposure and focusing in the second scheme is not limited, and the exposure can be performed first and then the focusing can be performed, or the focusing can be performed first and then the exposure can be performed. Taking the case of performing the focusing first and then the exposure as an example, the focusing can be performed on the moon first and then the moon can be photographed by using the low exposure, or the focusing can be performed on the foreground object first and then the foreground object can be photographed by using the high exposure. Taking the case of performing the exposure first and then the focusing as an example, the low exposure can be set first and then the moon can be photographed by focusing, or the high exposure can be set first and then the foreground object can be photographed by focusing.
[0227] In some embodiments, considering that improper exposure affects the focusing accuracy, for example, if the moon is overexposed, the moon on the image is large and has a halo, so the moon cannot be accurately focused; for another example, if the foreground object is underexposed, the foreground object on the image is too dark, so the foreground object cannot be accurately focused. Therefore, the second scheme can adopt the mode of performing the exposure first and then the focusing to improve the focusing accuracy.
[0228] For example, as shown in FIG. 11, which is a flowchart of an image photographing method provided by an embodiment of the present application. The method can be applied to an electronic device, for example, a mobile phone. As shown in FIG. 11, the flowchart includes the following steps.
[0229] S1101, it is determined whether the moon exists in the preview image. If the moon exists, S1102 is performed, otherwise, S1101 is continuously performed.
[0230] S1102, determine whether there is a foreground object in the preview image. If yes, perform S1104, otherwise, perform S1103.
[0231] S1103, enter the first moon mode.
[0232] In this embodiment, the first moon mode can include a shooting mode using low exposure and focusing on the moon.
[0233] S1014, enter the second moon mode.
[0234] In this embodiment, the second moon mode can include a shooting mode using low exposure and focusing on the moon to obtain a moon frame (i.e., the first image) first, and then using high exposure and focusing on the foreground object to obtain a foreground frame (i.e., the second image), and then fusing the moon frame and the foreground frame; or, a shooting mode using high exposure and focusing on the foreground object to obtain a foreground frame (i.e., the second image) first, and then using low exposure and focusing on the moon to obtain a moon frame (i.e., the first image), and then fusing the moon frame and the foreground frame.
[0235] S1105, set the exposure parameter to the first exposure parameter.
[0236] S1106, focus on the moon.
[0237] S1107, obtain the first image. It should be understood that the moon on the first image is not overexposed and out of focus.
[0238] S1108, set the exposure parameter to the second exposure parameter. The second exposure parameter is greater than the first exposure parameter.
[0239] Optionally, the way of setting the exposure parameter to the second exposure parameter can include multiple ways, including but not limited to the following ways:
[0240] Way one, set the exposure parameter to the second exposure parameter by using the brightness of the foreground object. It should be noted that way one can be an iterative process (referred to as an exposure iterative process), in which the exposure is adjusted constantly to finally determine a relatively accurate exposure parameter. For example, when the brightness of the foreground object on the image is too low, the exposure parameter is increased, and then it is determined how much the brightness of the foreground object is improved after the exposure parameter is increased. If the brightness is still relatively low, the exposure parameter is continuously increased. If the brightness is too high, the exposure parameter is reduced, until the brightness of the foreground object is appropriate (e.g., the brightness is within a preset brightness range).
[0241] The second mode is that the mobile phone includes two cameras, the first camera is used to output the first image and the second image, and the second camera is used to debug the exposure parameter of the foreground object. The first camera can set the exposure parameter as the second exposure parameter according to the exposure parameter provided by the second camera. The second mode can refer to the mode B in the first scheme, and details are not repeated.
[0242] S1109, focusing on the foreground object.
[0243] Optionally, the focusing on the foreground object can include any one of the following modes:
[0244] The third mode is that the foreground object is focused according to the exposure parameter (i.e., the second exposure parameter) of the foreground object. That is, the exposure parameter of the foreground object affects the focusing position of the foreground object.
[0245] It should be noted that, in general, the image focusing process includes: moving the position of the lens by the camera motor, calculating the sharpness once every time the position is moved, until a position is found, so that the sharpness of the image reaches the sharpness threshold when the lens is in the position. It should be understood that if the sharpness threshold is not set properly, it is difficult to find the focusing position of the lens. Assuming that a unified sharpness threshold is set in the scene of shooting the moon and the foreground object, and in order to shoot a clear moon, the sharpness threshold is set higher, then when shooting at low exposure, the moon is normally exposed, and the foreground object is underexposed. Based on the sharpness threshold, the focusing position of the moon can be found, but the focusing position of the foreground object cannot be found, because the foreground object is underexposed, the foreground object on the image is too dark, and the sharpness threshold is high, so it is difficult to find a lens position that meets the sharpness threshold.
[0246] Therefore, the third mode can include: determining the sharpness threshold according to the second exposure parameter, assuming that the threshold is 1, moving the position of the lens by the camera motor, calculating the sharpness of the foreground object once every time the position is moved, until a first position is found, so that the sharpness of the foreground object reaches the threshold 1 when the lens is in the first position. The process can be an iteration process (referred to as a focusing iteration process), in which the lens position is continuously debugged to finally focus on the foreground object.
[0247] It should be noted that the exposure parameter of the foreground object (i.e., the second exposure parameter) is different, the sharpness threshold is different, and the lens focusing position determined based on the sharpness threshold is different. In some embodiments, in the case of underexposure or overexposure, the sharpness threshold can be set lower to avoid not finding the focusing position, and in the case of not underexposure and not overexposure, the sharpness threshold can be set higher to find the accurate focusing position. As an example, the mobile phone can store a correspondence between different exposure parameters and sharpness thresholds, and based on the second exposure parameter and the correspondence, the corresponding sharpness threshold is determined. As another example, the mobile phone can also store a correspondence between different brightness and sharpness thresholds, determine the brightness of the foreground object based on the second exposure parameter, and then determine the sharpness threshold based on the brightness of the foreground object and the correspondence.
[0248] It should be noted that generally, focusing and exposure are two independent processes, and focusing can be performed before exposure or after exposure, that is, there is no certain relevance between exposure and focusing. In the embodiments of the present application, for the foreground object, the exposure is performed before the focusing, and the exposure and focusing are linked, that is, the focusing is performed according to the exposure of the foreground object (i.e., mode three), to improve the focusing accuracy.
[0249] Mode four, using a ranging unit to focus on the foreground object. For mode four, please refer to mode C in the second scheme in the foregoing.
[0250] Mode five, the mobile phone includes two cameras, the first camera is used to output the first image and the second image, and the second camera is used to focus on the foreground object. The first camera can focus on the foreground object according to the focusing position provided by the second camera. For mode five, please refer to mode D in the second scheme in the foregoing. Optionally, in mode five, when the second camera focuses on the foreground object, mode three or mode four can be used for focusing.
[0251] S1110, obtaining the second image. It should be understood that the foreground object on the second image is not underexposed and not out of focus.
[0252] S1111, fusing the first image and the second image to obtain a third image.
[0253] For the implementation principle of S1111, please refer to S309 in FIG. 3 in the foregoing, which will not be repeated here.
[0254] In some embodiments, the secondary exposure + secondary focusing process shown in FIG. 11 can be completed by the same camera. For example, the phone includes a first camera, and the secondary exposure + secondary focusing is performed by the first camera. For the type of the first camera, please refer to the foregoing description. The secondary exposure + secondary focusing process of the first camera can include: using a small exposure (i.e., the first exposure parameter), focusing on the moon to obtain a first image, and then increasing the exposure (i.e., the second exposure parameter), focusing on the foreground object to obtain a second image.
[0255] In some embodiments, before the phone uses the second exposure parameter to capture the foreground object, the phone needs to set the exposure parameter of the first camera to the second exposure parameter. The specific setting method includes at least one of the following method one and method two:
[0256] Method one: the phone can evaluate the brightness (e.g., RGB brightness) of the foreground object, and set the exposure parameter of the first camera to the second exposure parameter according to the brightness of the foreground object.
[0257] Method two: the phone further includes a second camera, and the second camera is used to debug the exposure parameter of the foreground object. The phone can set the exposure parameter of the first camera to the second exposure parameter according to the third exposure parameter of the second camera.
[0258] In some embodiments, the way in which the first camera focuses on the foreground object includes at least one of the following three ways:
[0259] Method three: using the second exposure parameter to focus on the foreground object.
[0260] Method four: the phone includes a ranging unit, and the ranging unit is used to measure the distance between the foreground object and the phone, and control the first camera to focus on the foreground object according to the distance.
[0261] Method five: the phone further includes a second camera, and the second camera is used to focus on the foreground object. The phone can control the first camera to focus on the foreground object according to the focusing position of the second camera.
[0262] For the above-mentioned method one to method five, please refer to the foregoing description, which will not be repeated. Taking the phone using the above-mentioned method two and method five as an example, the implementation process can be seen from FIG. 12. As shown in FIG. 12, another flowchart of an image capturing method is provided in an embodiment of the present application. The method can be applied to an electronic device, such as a phone. As shown in FIG. 12, the flowchart includes:
[0263] S1201: determining whether there is a moon in a preview image. If yes, performing S1202, otherwise, continuing to perform S1201.
[0264] S1202, determine whether there is a foreground object in the preview image. If yes, perform S1204, otherwise, perform S1203.
[0265] S1203, enter the first moon mode.
[0266] S1204, enter the second moon mode.
[0267] S1205, set the exposure parameter of the first camera to the first exposure parameter.
[0268] S1206, focus the moon by the first camera.
[0269] S1207, obtain the first image by the first camera.
[0270] S1208, adjust the exposure parameter of the second camera.
[0271] Optionally, when adjusting the exposure parameter of the second camera, the first mode or the second mode in the foregoing can be used.
[0272] S1209, focus the foreground object by the second camera.
[0273] Optionally, when focusing the foreground object by the second camera, the third mode or the fourth mode in the foregoing can be used.
[0274] S1210, provide the third exposure parameter of the second camera and the first focus position to the first camera.
[0275] In the embodiments of the present application, the third exposure parameter can be the exposure parameter of the second camera, which can be used to shoot the foreground object without underexposure and overexposure. The first focus position is the focus position of the second camera when focusing the foreground object.
[0276] S1211, set the exposure parameter of the first camera to the second exposure parameter according to the third exposure parameter of the second camera.
[0277] [Corrected according to Rule 91 on 20.05.2025] Optionally, the implementation principle of S1211 can refer to the implementation principle of S409 in FIG. 4 in the foregoing, which is not repeated here.
[0278] S1212, control the first camera to focus the foreground object according to the first focus position of the second camera.
[0279] [Corrected according to Rule 91 on 20.05.2025] Optionally, the implementation principle of S1212 can refer to the implementation principle of S809 in FIG. 8 in the foregoing, which is not repeated here.
[0280] S1213, obtain the second image by the first camera.
[0281] S1214, the first image and the second image are fused to obtain a third image.
[0282] In some other embodiments, the two-time focusing + two-time focusing shown in FIG. 11 can be performed by two different cameras respectively. For example, a mobile phone includes a first camera and a second camera. The first camera uses a first exposure parameter and focuses on the moon to obtain a first image, and the second camera uses a second exposure parameter and focuses on the foreground object to obtain a second image, that is, two-time focusing + two-time focusing is completed by the two cameras respectively exposing and respectively focusing. The types of the first camera and the second camera can be referred to the foregoing description, which will not be repeated here. For example, please refer to FIG. 13, which is another flowchart of the image shooting method provided by an embodiment of the present application. The method can be applied to an electronic device, such as a mobile phone. As shown in FIG. 13, the flowchart includes:
[0283] S1301, it is judged whether there is a moon in a preview image. If yes, S1302 is executed, otherwise, S1301 is continuously executed.
[0284] [According to Rule 91 correction 20.05.2025]S1302, it is judged whether there is a foreground object in the preview image. If yes, S1304 is executed, otherwise, S1303 is executed.
[0285] S1303, a first moon mode is entered.
[0286] S1304, a second moon mode is entered.
[0287] S1305, an exposure parameter of a first camera is set as a first exposure parameter.
[0288] S1306, the first camera focuses on the moon.
[0289] S1307, the first camera obtains a first image.
[0290] S1308, an exposure parameter of a second camera is set as a second exposure parameter. The second exposure parameter is greater than the first exposure parameter.
[0291] Optionally, when the second camera sets the exposure parameter as the second exposure parameter, the way one or the way two in the foregoing description can be used.
[0292] S1309, the second camera focuses on the foreground object.
[0293] Optionally, when the second camera focuses on the foreground object, the way three or the way four in the foregoing description can be used.
[0294] S1310, the second camera obtains a second image.
[0295] S1311, fuse the first image and the second image to obtain a third image.
[0296] In some embodiments, in the scenario of the dual camera shown in FIG. 12 or FIG. 13, the phone can display the preview images of the two cameras respectively in the preview interface of the camera. For example, as shown in (a) of FIG. 14, the phone displays the preview interface 202 as shown in (b) of FIG. 14 when receiving the operation on the icon 201 of the camera application. The preview interface 202 includes a main preview image 1401 and an auxiliary preview image 1402. The main preview image 1401 and the auxiliary preview image 1402 can be the images output by the first camera and the second camera respectively. For example, the main preview image 1401 can be the image output by the first camera when using the first exposure parameter (low exposure) and focusing on the moon, so that the moon in the main preview image 1401 is not overexposed and out of focus. The auxiliary preview image 1402 can be the image output by the second camera when using the second exposure parameter (high exposure) and focusing on the foreground object, so that the foreground object in the auxiliary preview image 1402 is not underexposed and out of focus.
[0297] As an example, the auxiliary preview image 1402 can be displayed floating on the main preview image 1401. Optionally, at least one of the display position and the display area of the auxiliary preview image 1402 can be adjustable. The display position of the main preview image 1401 and the display position of the auxiliary preview image 1402 can be exchanged.
[0298] As other examples, the field of view FOV of the first camera and the second camera can not be exactly the same. The magnification of the first camera and the second camera can be the same or different.
[0299] Therefore, in (b) of FIG. 14, the user sees the shooting effect of the moon and the foreground object respectively through the main preview image 1401 and the auxiliary preview image 1402. When the phone receives the operation on the shutter key, the interface shown in (c) of FIG. 14 is displayed, which includes the thumbnail 1403 of the captured image. When the phone receives the operation on the thumbnail 1403, the interface shown in (d) of FIG. 14 is displayed, which includes the captured image, and the moon and the foreground object in the image are clear.
[0300] Please refer to FIG. 15, which is a structural schematic diagram of an electronic device provided in an embodiment of the present application. The electronic device can be the mobile phone in the foregoing. As shown in FIG. 15, the electronic device can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a loudspeaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0301] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors. The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions. A memory can also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that have just been used or are repeatedly used by the processor 110. If the processor 110 needs to use the instructions or data again, it can directly call them from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.
[0302] In some embodiments, the image shooting method provided by the embodiments of the present application can be executed by the processor 110. For example, the processor 110 can identify whether the moon and the foreground object exist on the preview image, and if so, enter the moon mode. The processor 110 can shoot in the way of secondary exposure and / or secondary focusing to shoot the clear moon and the foreground object.
[0303] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0304] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 can contain multiple groups of I2C buses. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example, the processor 110 can be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to realize the touch function of the electronic device 100.
[0305] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can contain multiple groups of I2S buses. The processor 110 can be coupled to the audio module 170 through the I2S bus to realize the communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can deliver the audio signal to the wireless communication module 160 through the I2S interface to realize the function of answering the phone through the Bluetooth headset.
[0306] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 can be coupled with the wireless communication module 160 through a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, realizing the function of answering a phone call through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0307] The UART interface is a general-purpose serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is usually used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface, realizing the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, realizing the function of playing music through a Bluetooth headset.
[0308] The MIPI interface can be used to connect the processor 110 and peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes the camera serial interface (CSI), the display screen serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface, realizing the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface, realizing the display function of the electronic device 100.
[0309] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0310] The USB interface 130 is an interface that meets the USB standard specification, which can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0311] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation on the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.
[0312] The wireless communication function of the electronic device can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like. The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0313] The mobile communication module 150 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the electronic device. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves radiated by the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be arranged in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 can be arranged in the same device.
[0314] The wireless communication module 160 can provide a solution for wireless communication, including wireless local area networks (WLAN) (such as a wireless fidelity (Wi-Fi) network), Bluetooth (BT), a global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, and the like, which are applied to the electronic device. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency-modulate them, amplify them, and radiate them as electromagnetic waves via the antenna 2.
[0315] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device can communicate with a network and other devices through wireless communication technology.
[0316] The display screen 194 is used to display the display interface of an application, and the like. The display screen 194 includes a display panel. In some embodiments, the electronic device can include 1 or N display screens 194, N being a positive integer greater than 1.
[0317] The electronic device 100 can implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor, and the like. Among them, the ISP is used to process the data fed back by the camera 193.
[0318] In some embodiments, the camera 193 can include one or more. Taking one as an example, for example, the camera 193 can be the first camera in the foregoing, and the first camera can perform secondary exposure and / or secondary focusing. Taking the camera 193 including two cameras as an example, for example, the first camera and the second camera in the foregoing. The first camera and the second camera can complete the secondary exposure and / or the secondary focusing.
[0319] The internal memory 121 can be used to store computer executable program codes including instructions. The processor 110 performs various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system and software codes of at least one application program, etc. The data storage area can store data generated during the use of the electronic device (e.g., images, videos, etc.) and the like. In addition, the internal memory 121 can include a high-speed random access memory, and can further include a non-volatile memory such as at least one of a magnetic disk storage device, a flash memory device, a universal flash storage memory, etc.
[0320] The external memory interface 120 can be used to connect an external memory card such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to perform a data storage function. For example, files such as pictures, videos, etc. are saved in the external memory card.
[0321] The electronic device can implement an audio function through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, etc. For example, music playback, recording, etc.
[0322] The audio module 170 is used to convert digital audio information into an analog audio signal output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or part of the functions of the audio module 170 can be disposed in the processor 110.
[0323] The speaker 170A, also known as a "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to an external speaker scene such as a hands-free call through one or more speakers 170A.
[0324] The receiver 170B, also known as a "earpiece", can be one or more, and is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a phone or a voice message, the receiver 170B can be held close to the ear to listen to the voice.
[0325] The microphone 170C, also known as a "microphone", "sound transducer", is used to convert a sound signal into an electrical signal.
[0326] The earphone interface 170D is used to connect a wired earphone.
[0327] The pressure sensor 180A is used to sense a pressure signal, which can be converted into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed at the display screen 194.
[0328] The gyro sensor 180B can be used to determine the motion posture of the electronic device. In some embodiments, the angular velocity of the electronic device around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake photography.
[0329] The barometric sensor 180C is used to measure air pressure. In some embodiments, the electronic device calculates altitude, assists positioning and navigation by the air pressure value measured by the barometric sensor 180C.
[0330] The magnetic sensor 180D includes a Hall sensor. The electronic device can detect the opening and closing of a flip cover with the magnetic sensor 180D.
[0331] The acceleration sensor 180E can detect the magnitude of acceleration of the electronic device in various directions (typically three axes). When the electronic device is stationary, the magnitude and direction of gravity can be detected.
[0332] The distance sensor 180F is used to measure distance. The electronic device can measure distance by infrared or laser.
[0333] The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode. The electronic device emits infrared light outwardly through the light emitting diode. The electronic device detects infrared reflected light from nearby objects using the photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device. When insufficient reflected light is detected, the electronic device can determine that there is no object near the electronic device.
[0334] The ambient light sensor 180L is used to sense ambient light brightness. The electronic device can adaptively adjust the display screen 194 brightness according to the sensed ambient light brightness.
[0335] The fingerprint sensor 180H is used to collect a fingerprint.
[0336] The temperature sensor 180J is used to detect temperature.
[0337] The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K can be disposed at the display screen 194, and the touch sensor 180K and the display screen 194 together form a touch screen, also referred to as a "touch screen". The touch sensor 180K is used to detect a touch operation acting on or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the touch event type.
[0338] The bone conduction sensor 180M can acquire a vibration signal. In some embodiments, the bone conduction sensor 180M can acquire a vibration signal of a human vocal part vibration bone block.
[0339] The keys 190 include a power key, a volume key, and the like. The keys 190 can be mechanical keys. The keys 190 can also be touch keys. The electronic device can receive a key input, and generate a key signal input related to user settings and function control of the electronic device. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, and can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, and the like. The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device.
[0340] It can be understood that the components shown in FIG. 15 do not constitute a specific limitation on the electronic device. The electronic device in the embodiments of the present application can include more or fewer components than FIG. 15. In addition, the combination / connection relationship between the components in FIG. 15 can also be adjusted and modified.
[0341] [Corrected according to Rule 91 on 20.05.2025] FIG. 16 is a structural schematic diagram of an electronic device 1600 provided by an embodiment of the present application. The electronic device 1600 can be the mobile phone in the foregoing. As shown in FIG. 16, the electronic device 1600 can include one or more processors 1601, one or more memories 1602, a communication interface 1603, and one or more computer programs 1604, which can be connected through one or more communication buses 1605. The one or more computer programs 1604 are stored in the memory 1602 and configured to be executed by the one or more processors 1601, and the one or more computer programs 1604 include instructions. For example, when the electronic device 1600 is the mobile phone in the foregoing, the instructions can be used to perform the related steps of the mobile phone in any of the embodiments of the corresponding FIGS. 1A to 14. The communication interface 1603 is used to realize the communication between the electronic device 1600 and other devices, such as a transceiver.
[0342] In the embodiments of the present application provided above, the method provided by the embodiments of the present application is introduced from the perspective of an electronic device (for example, a mobile phone) as an execution subject. In order to implement each function in the method provided by the embodiments of the present application, the electronic device can include a hardware structure and / or a software module, and each function is implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a certain function in the above functions is implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application of the technical solution and the design constraint conditions.
[0343] In the above embodiments, the method can be implemented by software, hardware, firmware, or any combination thereof, in whole or in part. When implemented by software, the method can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the flow or function described in the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc. In the case of no conflict, the solutions of the above embodiments can be combined.
[0344] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0345] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.
[0346] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks.
[0347] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.
[0348] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. An image capturing method characterized by, The method is applied to an electronic device, and the method comprises: displaying a preview interface of a camera, the preview interface comprising a first preview image; when it is identified that the first preview image comprises a moon and a foreground object, entering a moon mode; setting an exposure parameter to a first exposure parameter; focusing on the moon to obtain a first image; setting the exposure parameter to a second exposure parameter, the second exposure parameter being greater than the first exposure parameter; focusing on the foreground object to obtain a second image; fusing the first image and the second image to obtain a third image.
2. The method of claim 1, wherein, The focusing on the foreground object comprises: focusing on the foreground object according to the second exposure parameter.
3. The method of claim 2, wherein, The focusing on the foreground object according to the second exposure parameter comprises: determining a sharpness threshold of the foreground object according to the second exposure parameter; pushing a lens to move a position by a camera motor, calculating the sharpness of the foreground object once every time the lens moves a position, to find a first position at which the sharpness of the foreground object reaches the sharpness threshold, and focusing on the foreground object when the lens is at the first position.
4. The method of claim 1, wherein, The focusing on the foreground object comprises: focusing on the foreground object according to a distance between the foreground object and the electronic device.
5. The method of claim 1, wherein, The electronic device comprises a first camera, The setting of the exposure parameter to the first exposure parameter comprises: setting the exposure parameter of the first camera to the first exposure parameter. The focusing on the moon to obtain the first image comprises: controlling the first camera to focus on the moon, so that the first camera outputs the first image. The setting of the exposure parameter to the second exposure parameter comprises: setting the exposure parameter of the first camera to the second exposure parameter. The focusing on the foreground object to obtain the second image comprises: controlling the first camera to focus on the foreground object, so that the first camera outputs the second image.
6. The method of claim 1, wherein, The electronic device comprises a first camera and a second camera, The setting of the exposure parameter to the first exposure parameter comprises: setting the exposure parameter of the first camera to the first exposure parameter. The focusing on the moon to obtain the first image comprises: controlling the first camera to focus on the moon, so that the first camera outputs the first image. The setting of the exposure parameter to the second exposure parameter comprises: setting the exposure parameter of the second camera to the second exposure parameter. The focusing on the foreground object to obtain the second image comprises: controlling the second camera to focus on the foreground object, so that the second camera outputs the second image.
7. The method of claim 5, wherein, The electronic device further comprises a second camera, and the second camera is configured to debug the exposure parameter of the foreground object, The setting of the exposure parameter of the first camera to the second exposure parameter comprises: setting the exposure parameter of the first camera to the second exposure parameter according to a third exposure parameter of the second camera.
8. The method of claim 7, wherein, The setting of the exposure parameter of the first camera to the second exposure parameter according to the third exposure parameter of the second camera comprises: setting the exposure parameter of the first camera to the second exposure parameter according to the third exposure parameter and exposure calibration results of the first camera and the second camera.
9. The method of claim 5, wherein, The electronic device further includes a second camera configured to focus on the foreground object, controlling the first camera to focus on the foreground object includes: controlling the first camera to focus on the foreground object according to the first focus position of the second camera.
10. The method of claim 9, wherein, controlling the first camera to focus on the foreground object according to the first focus position of the second camera includes: controlling the first camera to focus on the foreground object according to the first focus position and a focal position calibration result of the first camera and the second camera.
11. The method of any one of claims 1-10, wherein: the first exposure parameter includes at least one of a first aperture, a first exposure duration, and a first ISO value, the second exposure parameter includes at least one of a second aperture, a second exposure duration, and a second ISO value, the second exposure parameter is greater than the first exposure parameter, including at least one of: the second aperture is greater than the first aperture; the second exposure duration is greater than the first exposure duration; the second ISO value is greater than the first ISO value.
12. The method according to any one of claims 1 to 11, characterized in that, Before entering the moon mode, the method further includes: determining that the foreground object satisfies at least one of the following conditions: the foreground object is a preset object; a distance between the foreground object and the electronic device is less than a preset distance; an area occupied by the foreground object in the first preview image is greater than a preset area; a remaining duration of the foreground object in the first preview image is greater than a preset duration.
13. The method of claim 6, wherein, The first preview image is an image output by the first camera, and the method further includes: displaying a second preview image in the preview interface, the second preview image being an image output by the second camera.
14. The method of claim 13, wherein, The second preview image is displayed on the first preview image in a suspended manner, and / or at least one of a position and a display area of the second preview image is adjustable.
15. The method according to any one of claims 1 to 14, characterized in that, When the first image only includes the moon and the second image includes the moon and the foreground object, the fusing the first image and the second image to obtain a third image includes: filling a region where the moon is located in the second image with a background to obtain a fourth image; fusing the fourth image and the first image to obtain the third image.
16. The method according to any one of claims 1 to 14, characterized in that, When the first image and the second image both include the moon and the foreground object, the fusing the first image and the second image to obtain a third image includes: filling a region where the foreground object is located in the first image with a background to obtain a fifth image; filling a region where the moon is located in the second image with a background to obtain a sixth image; fusing the fifth image and the sixth image to obtain the third image.
17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor implements the method in any one of claims 1-16 when executing the computer program.
18. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by a processor, implements the method in any one of claims 1-16.
19. A computer program product, characterised in that, The computer program product includes a computer program that, when executed on a computer, causes the computer to perform the method in any one of claims 1-16.