Image processing methods, electronic devices and readable storage media

By using multi-camera collaborative acquisition and processing technology in electronic devices, the problem of unclear imaging of background objects in the moon-viewing shooting mode has been solved, realizing high-definition image capture of the moon and other objects, and improving the user experience.

CN119946416BActive Publication Date: 2026-01-30HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311407572.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-26
Publication Date
2026-01-30
Estimated Expiration
2043-10-26

AI Technical Summary

Technical Problem

When an electronic device captures a clear image of the moon in moon-viewing mode, other background objects may not be captured or may be captured unclearly, resulting in poor image quality.

Method used

The system uses a first camera and a second camera to capture images of the same scene. The first camera is used to detect the moon and adjust the exposure. The image captured by the second camera is displayed in a picture-in-picture mode. By adjusting the exposure parameters and focus distance, the target image is obtained through fusion processing, thereby improving the imaging clarity of background objects.

Benefits of technology

It improves the image clarity of the moon and other objects within the same frame, enhances image capture results, and improves user convenience and interactivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946416B_ABST
    Figure CN119946416B_ABST
Patent Text Reader

Abstract

This application discloses an image processing method, an electronic device, and a readable storage medium, belonging to the field of terminal technology. Applied to an electronic device, the method includes: during image acquisition via a first camera of the electronic device, if the zoom ratio of the first camera is greater than or equal to a first zoom ratio threshold, then performing moon detection on a first preview image acquired by the first camera; if the moon is present in the first preview image, displaying a second preview image acquired by a second camera of the electronic device in a picture-in-picture manner within the first preview image; updating the first preview image to a third preview image with lower exposure, where other objects besides the moon in the second preview image have higher clarity; and, in response to a shooting operation, processing the third preview image based on the second preview image to obtain a target image. This application improves the imaging clarity of other background objects within the same frame as the moon, and also improves the image shooting effect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminals, and in particular to an image processing method, an electronic device, and a readable storage medium. BACKGROUND

[0002] With the development of terminal technology, the camera function of electronic devices is becoming richer and richer. For example, an electronic device can provide a moon shooting mode. In the moon shooting mode, the electronic device can shoot a clear moon image through a camera.

[0003] However, while the electronic device shoots a clear moon image in the moon shooting mode, other background objects in the same framing frame as the moon cannot be imaged or are not imaged clearly, resulting in poor image shooting effect. SUMMARY

[0004] The present application provides an image processing method, an electronic device, and a readable storage medium, which can improve the imaging clarity of the moon and other objects. The technical solution is as follows:

[0005] In a first aspect, an image processing method is provided, applied to an electronic device, and the method comprises:

[0006] In the process of image acquisition by a first camera of the electronic device, if the zoom ratio of the first camera is greater than or equal to a first threshold, the first preview image collected by the first camera is subjected to moon detection; in the case where the moon exists in the first preview image, a second preview image collected by a second camera of the electronic device is displayed in the first preview image in a picture-in-picture manner, the second preview image and the first preview image both contain the moon; the first preview image is updated to a third preview image, the exposure of the third preview image is less than the exposure of the first preview image, and the clarity of objects other than the moon in the second preview image is greater than the clarity of objects other than the moon in the third preview image; in response to a shooting operation, the third preview image is processed based on the second preview image to obtain a target image.

[0007] Wherein, the first camera and the second camera perform image acquisition on the same shooting scene, and the image acquisition ranges of the first camera and the second camera are substantially the same, and the image acquisition range displayed by the second preview image is greater than the image acquisition range displayed by the third preview image in the shooting interface.

[0008] It should be noted that the first camera can be a telephoto camera of the electronic device, and the second camera can be a main camera of the electronic device.

[0009] It is worth noting that because the exposure of the third preview image is less than that of the first preview image, a clear image of the moon can be obtained in the third preview image. Furthermore, because the sharpness of other objects besides the moon in the second preview image is greater than that of other objects besides the moon in the third preview image, the target image obtained by processing the third preview image with the second preview image is an image with high sharpness including the moon and other objects. This improves the image sharpness of other background objects within the same frame as the moon and enhances the overall image capture effect.

[0010] In addition, if the moon is detected in the first preview image, the second preview image is displayed in a picture-in-picture manner in the first preview image. After the first preview image is updated to the third preview image, if the imaging effect of other objects in the third preview image is poor, the user can adjust the shooting angle by observing the imaging effect of the second preview image so that the captured image meets their own needs, thereby improving the user's shooting convenience and user engagement.

[0011] As an example of this application, in response to a shooting operation, the electronic device processes a third preview image based on a second preview image to obtain a target image, and can also focus on objects other than the moon within the image acquisition range of the second camera; after focusing is completed, the focusing distance of the second camera is determined.

[0012] It should be noted that the electronic device can focus on objects other than the moon within the image acquisition range of the second camera through a distance sensor or the motor corresponding to the second camera.

[0013] As an example, if an electronic device has a motor corresponding to a second camera, the device can determine the focusing distance by using the indicator code value of the current corresponding to the motor's stroke. Alternatively, the electronic device can use a range sensor to measure the distance between itself and other objects based on time-of-flight technology; the measured distance can then be determined as the focusing distance.

[0014] Based on this, the electronic device, in response to the shooting operation, processes the third preview image based on the second preview image to obtain the target image, including the following operations:

[0015] In response to the shooting operation, the third preview image is processed based on the second preview image according to the focus distance to obtain the target image.

[0016] It is worth noting that by using the focusing distance of the second camera, the distance between other objects outside the moon and electronic devices within the image acquisition range of the second camera can be accurately determined, thus providing data support for the subsequent determination of the target image.

[0017] As an example of this application, the exposure parameters include the exposure value and the exposure duration;

[0018] Based on this, the operation of the electronic device in response to the shooting operation, processing the third preview image based on the second preview image according to the focus distance, to obtain the target image includes:

[0019] In response to the shooting operation, based on the exposure parameters of the second preview image, an S-frame corresponding to the second preview image is obtained. The S-frame is a preview image captured by the second camera before capturing the second preview image, and the exposure value of the S-frame is less than the exposure value of the second preview image, and the exposure duration of the S-frame is less than the exposure duration of the second preview image. When the focusing distance is greater than a distance threshold, the third preview image is updated based on the S-frame and the second preview image, and the updated third preview image is fused with the second preview image to obtain the target image. When the focusing distance is less than or equal to the distance threshold, the S-frame, the second preview image, and the third preview image are fused to obtain the target image.

[0020] It is worth noting that electronic devices can select different methods to determine the target image based on different focusing distances, making the operation of determining the target image more targeted.

[0021] As an example of this application, when the focusing distance is greater than a distance threshold, the operation of updating the third preview image based on the S-frame and the second preview image, and fusing the updated third preview image with the second preview image to obtain the target image includes:

[0022] When the focusing distance is greater than the distance threshold, the S-frame is fused with the second preview image to obtain the first image; the exposure parameters of the third preview image are updated according to the exposure parameters of the first image; the updated third preview image is fused with the third preview image to obtain the target image.

[0023] It should be noted that the electronic device can re-expose the third preview image according to the exposure parameters of the first image to obtain an updated third preview image.

[0024] It is worth noting that since the exposure of the S-frame is less than that of the second preview image, the S-frame and the second preview image are fused to obtain the first image. The clarity of the moon region in the first image is improved, while the clarity of other objects besides the moon is not affected. Thus, by updating the exposure parameters of the third preview image using the exposure parameters of the first image, the clarity of other objects in the updated third preview image is improved, thereby ensuring the clarity of each object in the target image.

[0025] As an example of this application, when the focusing distance is greater than a distance threshold, the third preview image is updated based on the S-frame and the second preview image. Before fusing the updated third preview image with the second preview image to obtain the target image, the L-frame corresponding to the second preview image can also be obtained based on the exposure parameters of the second preview image. Here, the L-frame is the preview image captured by the second camera after acquiring the second preview image, and the exposure value of the L-frame is greater than the exposure value of the second preview image, and the exposure duration of the L-frame is greater than the exposure duration of the second preview image.

[0026] Based on this, when the focusing distance is greater than the distance threshold, the third preview image is updated based on the S-frame and the second preview image, and the updated third preview image is fused with the second preview image to obtain the target image. The operation includes:

[0027] The S-frame, the second preview image, and the L-frame are fused to obtain the second image; the exposure parameters of the third preview image are updated based on the exposure parameters of the second image; the updated third preview image is then fused with the third preview image to obtain the target image.

[0028] It is worth noting that by acquiring the L-frame of the second preview image and fusing the L-frame, S-frame, and second preview image, the signal-to-noise ratio of the second image is improved, the noise in the second image is reduced, and thus the clarity of the target image is improved.

[0029] As an example of this application, the operation of fusing the updated third preview image with the third preview image to obtain the target image includes:

[0030] Determine the first focus position of the moon in the third preview image and the second focus position of the moon in the updated third preview image; if the first focus position and the second focus position are inconsistent, adjust the focus position of the moon in the updated third preview image according to the deviation value between the first focus position and the second focus position; according to the target value, merge the third preview image with the adjusted focus position and the third preview image to obtain the target image, which is used to indicate the display size of the moon in the target image.

[0031] It is worth noting that by adjusting the display position of the moon, the problem of the moon appearing as a ghost image in the merged image is avoided, thereby improving the clarity of the target image.

[0032] As an example of this application, the operation of fusing the third preview image after focus adjustment and the third preview image to obtain the target image according to the target value includes:

[0033] When the target value is a preset value, the third preview image after the focus position is adjusted and the third preview image are merged to obtain the target image; when the target value is the target value, the display size of the moon in the third preview image is adjusted to the size indicated by the target value, and the third preview image after the moon display size is adjusted and the third preview image after the focus position is adjusted are merged to obtain the target image. The target value is determined based on the user operation of adjusting the display size of the moon received before the shooting operation.

[0034] In this way, by adjusting the focus position of the moon and then adjusting the size of the moon display, the possibility of moon ghosting in the target image is reduced, and the clarity and display effect of the target image are improved.

[0035] As an example of this application, during the image acquisition process using the first camera of the electronic device, if the zoom ratio of the first camera is greater than or equal to a first zoom ratio threshold, after detecting the moon in the first preview image acquired by the first camera, the electronic device can also display a moon adjustment control in the shooting interface if the moon is present in the first preview image. The moon adjustment control is used to adjust the display size of the moon in the target image. In response to user operation of the moon adjustment control, the target value selected by the user operation is stored, and the target value is used to indicate the display size of the moon in the target image.

[0036] It should be noted that the moon adjustment control can be composed of at least one of the following: a pattern, text, or numbers.

[0037] As an example, in response to a user's operation on the moon adjustment controls, the display size of the moon in the third preview image does not change, even if the electronic device stores the target value selected by the user's operation.

[0038] Alternatively, in response to a user's operation on the moon adjustment controls, the electronic device, upon storing a new target value selected by the user operation, can adjust the displayed size of the moon in the third preview image to the size indicated by the target value.

[0039] It is worth noting that by adjusting the size of the moon in the target image using the moon adjustment controls, the harmony between the moon and other objects in the target image is improved, while also enhancing interactivity with the user.

[0040] As an example of this application, when the focusing distance is less than or equal to a distance threshold, the operation of fusing the S-frame, the second preview image, and the third preview image to obtain the target image includes:

[0041] When the focusing distance is less than or equal to the distance threshold, the S-frame is fused with the second preview image to obtain the third image; the third preview image is fused with the third image to obtain the target image.

[0042] It is worth noting that by fusing the S-frame, the second preview image, and the third preview image, a target image with a clear moon and other clear objects can be obtained even when objects other than the moon are relatively close to the electronic device, thus improving the imaging clarity of the target image.

[0043] In a second aspect, an electronic device is provided, comprising a processor and a memory. The memory stores a program that supports the electronic device in executing the image processing method provided in the first aspect, and stores data related to implementing the image processing method described in the first aspect. The processor is configured to execute the program stored in the memory. The electronic device may further include a communication bus for establishing a connection between the processor and the memory.

[0044] Thirdly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform the image processing method described in the first aspect.

[0045] Fourthly, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to perform the image processing method described in the first aspect.

[0046] The technical effects achieved by the second, third, and fourth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0047] Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application;

[0048] Figure 2 This is a schematic diagram illustrating another application scenario provided by an embodiment of this application;

[0049] Figure 3 This is a schematic diagram illustrating another application scenario provided by an embodiment of this application;

[0050] Figure 4 This is a schematic flowchart of an image processing method provided in an embodiment of this application;

[0051] Figure 5 This application provides a grayscale value statistical chart of image pixels.

[0052] Figure 6 This is a flowchart illustrating another image processing method provided in an embodiment of this application;

[0053] Figure 7 This is a flowchart illustrating another image processing method provided in an embodiment of this application;

[0054] Figure 8 This is a flowchart illustrating another image processing method provided in an embodiment of this application;

[0055] Figure 9 This application provides a schematic diagram of the structure of an electronic device;

[0056] Figure 10 This is a block diagram of a software system for an electronic device provided in an embodiment of this application. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0058] It should be understood that "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " indicates "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, to facilitate a clear description of the technical solutions of this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.

[0059] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0060] In one application scenario, a user might use their mobile phone to photograph the moon, and under normal circumstances, a mobile phone can capture images such as...Figure 1 The image in Figure (a) is an overexposed and out-of-focus image of the moon. Therefore, in order to enable mobile phones to capture clear images of the moon, more and more types of mobile phones have begun to offer a moon-viewing mode (also known as a moon-shooting mode or moon mode, etc.).

[0061] As an example, the phone can automatically enter moon-viewing mode if it detects the moon in the preview image captured by the camera; or, the phone can enter moon-viewing mode if it receives a user's mode selection operation indicating that the shooting mode is moon-viewing. See [link to moon-viewing mode documentation] for details. Figure 1 In image (b), the mobile phone can capture a clear image of the moon. Among them, Figure 1 Images (a) and (b) in the image are images with different resolutions obtained from shooting the same scene.

[0062] However, through Figure 1 As can be seen from Figures (a) and (b), while the mobile phone captures a clear image of the moon in the moon-viewing mode, it causes other background objects within the same frame as the moon to be unable to be imaged or to be imaged unclearly, resulting in poor image capture quality.

[0063] To improve image clarity and shooting effect, this application provides an image processing method. In this method, when the moon is present in a first preview image captured by a first camera of an electronic device, and the zoom ratio of the first camera is large, a second preview image captured by a second camera of the electronic device of the same shooting scene can be displayed in a picture-in-picture manner within the first preview image. Furthermore, the first preview image can be updated to a third preview image. Responding to a shooting operation, the electronic device can process the third preview image based on the second preview image to obtain the target image. Since the exposure of the third preview image is less than that of the first preview image, a clear image of the moon can be obtained in the third preview image. Furthermore, since the clarity of other objects besides the moon in the second preview image is greater than that in the third preview image, the target image obtained by processing the third preview image using the second preview image is an image with high clarity including the moon and other objects. This improves the imaging clarity of other background objects within the same frame as the moon and enhances the overall image shooting effect.

[0064] To facilitate understanding, before providing a detailed description of the methods provided in the embodiments of this application, the application scenarios involved in the embodiments of this application will be introduced below.

[0065] Please refer to Figure 2 , Figure 2This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. In one application scenario, a user may take a picture through any of the phone's cameras while using the phone. After activating the camera, the phone can display the following on the screen: Figure 2 The shooting interface shown in Figure (a) displays a preview image A captured by camera S1. During the shooting process, the user can adjust the zoom level of camera S1; for example, by clicking the zoom control, the zoom level can be changed from 1× to 10×. In response to the zoom level adjustment, the phone captures an image using camera S1 at the adjusted zoom level, resulting in an image as shown in Figure (a). Figure 2 In the preview image B shown in Figure (b), the phone can detect whether the preview image B contains the moon. If the moon is detected in the preview image B, the phone reduces the exposure of the preview image B, resulting in the image shown. Figure 2 The preview image C shown in Figure (c) is displayed in a picture-in-picture format, with the preview image D captured by the phone's camera S2 shown in preview image C. If the user taps the shooting control P1 in this situation, the phone responds to the tap by performing image exposure based on preview images D and C. To view the captured image, see [link to relevant documentation]. Figure 2 In image (d), the user can click the image viewing control P2 in the shooting interface. In response to the click on the image viewing control P2, the phone can display the following: Figure 2 The target image E is shown in Figure (e).

[0066] It should be noted that camera S1 can be the telephoto camera of the phone, and camera S2 can be the main camera of the phone.

[0067] In yet another possible scenario, see Figure 3 In Figure (a), when the phone displays preview image D in picture-in-picture mode within preview image C, the shooting interface can also display moon adjustment control P3. The user can use moon adjustment control P3 to adjust the moon's display size in the target image E. For example, if the user can use moon adjustment control P3 to control the moon's display size to be 3 times the size of the currently captured moon, then the subsequently displayed target image E can be as follows: Figure 3 As shown in Figure (b); if the user can control the moon display size to be twice the size of the currently acquired moon using the moon adjustment control P3, then the subsequently displayed target image E can be as follows: Figure 3 As shown in Figure (c); if the user can control the moon display size to be 1.5 times the size of the currently captured moon using the moon adjustment control P3, then the subsequently displayed target image E can be as follows: Figure 3As shown in Figure (d). If the user does not control the display size of the moon using the moon adjustment control P3, then the target image E can be as follows: Figure 2 As shown in Figure (d) in the diagram.

[0068] It should be noted that the embodiments in this application are only based on the above. Figure 2 and Figure 3 The application scenarios shown are illustrated as examples and do not constitute a limitation on the embodiments of this application.

[0069] Based on the application scenarios provided in the above embodiments, the image processing method provided in this application will be described below. Please refer to... Figure 4 , Figure 4 This is a flowchart illustrating an image processing method by way of example, not limitation. The method is described with reference to its application in an electronic device and may include some or all of the following:

[0070] Step 401: During the image acquisition process using the first camera of the electronic device, if the zoom ratio of the first camera is greater than or equal to the first zoom ratio threshold, then perform moon detection on the first preview image acquired by the first camera.

[0071] During image capture using the electronic device's first camera, the user may adjust the zoom level of the first camera. If the zoom level is greater than or equal to a first zoom threshold, the electronic device can perform moon detection on the first preview image captured by the first camera. For example, this first preview image can be the aforementioned... Figure 2 Preview image B shown in Figure (b) of the diagram.

[0072] As an example, the first camera can be a telephoto camera of an electronic device. Exemplarily, the first camera can be camera A as described in the above application scenario.

[0073] In some embodiments, the electronic device can set not only a first zoom level but also a second zoom level. When the zoom level of the first camera is greater than or equal to a first zoom level threshold and less than or equal to a second zoom level threshold, the electronic device can perform moon detection on the first preview image captured by the first camera. When the zoom level of the first camera is less than the first zoom level threshold or greater than the second zoom level threshold, the electronic device may not display the second preview image; that is, the electronic device uses only one camera for image capture.

[0074] It should be noted that the first and second magnification thresholds can be preset according to requirements. For example, the first magnification threshold can be 10x (or written as 10X), 15x, 20x, or 30x, etc. The second magnification threshold can be 30x or 40x, etc., and the second magnification threshold is greater than the first magnification threshold.

[0075] In some embodiments, the zoom ratio of the first camera can be manually adjusted by the user to any zoom ratio greater than or equal to the first zoom ratio threshold, or it can be automatically adjusted by the electronic device to any zoom ratio greater than or equal to the first zoom ratio threshold.

[0076] For example, when the electronic device switches to certain shooting modes, it automatically increases the zoom level of the first camera. For instance, when the electronic device switches to the moon-viewing shooting mode, in order to obtain a clear image of the moon, the electronic device can adjust the zoom level of the first camera to a first magnification, which is greater than or equal to a first magnification threshold.

[0077] In some embodiments, the electronic device can perform moon detection on the first preview image captured by the first camera in various ways. For example, the electronic device may be equipped with a neural network model capable of object recognition. Thus, the electronic device can identify various objects in the first preview image through the neural network model, and detect the presence of the moon by recognizing each object. Alternatively, the electronic device may have AI (artificial intelligence) recognition capabilities. In this case, the electronic device can use AI recognition to identify various objects in the first preview image to detect the presence of the moon. This application does not impose specific limitations on this approach.

[0078] Step 402: If the moon is present in the first preview image, display the second preview image captured by the second camera of the electronic device in a picture-in-picture manner in the first preview image.

[0079] It should be noted that both the second and first preview images include the moon, and the image capture area displayed in the second preview image is larger than that displayed in the first preview image. The second camera and the first camera capture images of the same shooting scene.

[0080] As an example, if the moon is present in the first preview image, the electronic device can simultaneously capture images of the same scene using both the first and second cameras. After capturing the image using the second camera to obtain the second preview image, this second preview image can be displayed in a picture-in-picture format within the first preview image. For example, this scenario can be described as described above. Figure 2 The application scenario is shown in Figure (c).

[0081] It should be noted that the second camera can be the main camera of the electronic device, and the second camera can be camera B as described in the above scenario.

[0082] Step 403: Update the first preview image to the third preview image.

[0083] It should be noted that the exposure of the third preview image is less than that of the first preview image, and the sharpness of objects other than the moon in the second preview image is greater than that of objects other than the moon in the third preview image.

[0084] As an example, updating the first preview image to the third preview image may include: reducing the exposure and / or exposure duration of the first preview image to obtain the third preview image.

[0085] Because the moon's brightness was high when the electronic device's first camera captured the first preview image, the moon area appeared blurry in the first preview image. Normally, images with lower exposure and / or shorter exposure times are clearer when displaying areas in strong light. Therefore, to obtain a clear image of the moon, the electronic device can obtain a third preview image by reducing the exposure and / or exposure time of the first preview image.

[0086] For example, to facilitate understanding, embodiments of this application provide a grayscale value statistics chart of image pixels, see [link to relevant documentation]. Figure 5 , Figure 5 Figure (a) in the image is a statistical chart of the grayscale values ​​of pixels in the third preview image. Figure 5 As shown in Figure (a), the number of grayscale values ​​of the pixels in the third preview image is evenly distributed and relatively small. The distribution of grayscale values ​​of this pixel is usually the same as that of the pixels in the moon region.

[0087] Because the moon's light is strong in the first preview image while other objects are weakly lit, after reducing the exposure and / or exposure time of the first preview image, the moon's clarity in the third preview image is very high, but other objects may not be imaged or may be blurry. However, when the electronic device acquires the second preview image, the automatic exposure (AE) algorithm converges, meaning the second preview image is normally exposed, and the electronic device does not reduce the exposure and / or exposure time of the second preview image.

[0088] For example, see Figure 5 , Figure 5 Figure (b) in the image is a statistical chart of the grayscale values ​​of pixels in the second preview image. Figure 5As shown in Figure (b), the grayscale values ​​of the pixels in the second preview image are more concentrated.

[0089] Since images with higher exposure and / or longer exposure times are generally clearer when displaying image areas with low light, the moon appears blurry in the second preview image. However, the other objects in the second preview image are clearer than the other objects in the third preview image.

[0090] It should be noted that when the moon is present in the first preview image, the execution order of steps 402 and 403 in this embodiment of the application is not specifically limited. That is, when the moon is present in the first preview image, the electronic device can execute the operation of step 402 first and then the operation of step 403, or it can execute the operation of step 403 first and then the operation of step 402, or it can execute the operations of steps 402 and 403 simultaneously.

[0091] As an example, when the first preview image is updated to the third preview image, the second preview image is displayed on top of the third preview image in a picture-in-picture manner.

[0092] As described above, the electronic device can automatically increase the zoom level of the first camera after entering certain shooting modes, or the user can manually adjust the zoom level of the first camera. When the zoom level of the first camera is manually adjusted by the user, if the moon is present in the first preview image, the electronic device can enter the moon-viewing shooting mode. When the electronic device is in the moon-viewing shooting mode, it can perform steps 402 and 403.

[0093] In some embodiments, when the electronic device enters the moon-viewing shooting mode, a prompt message can be displayed on the shooting interface to indicate the current shooting mode. This prompt message can be in the form of at least one of text, an image, or a control.

[0094] It is worth noting that when the moon is detected in the first preview image, the second preview image is displayed in a picture-in-picture manner within the first preview image. This allows the user to adjust the shooting angle by observing the imaging effect of the second preview image after the first preview image is updated to the third preview image, if the imaging effect of other objects in the third preview image is poor, so that the shooting image can meet their own needs. This improves the user's shooting convenience and user engagement.

[0095] Step 404: In response to the shooting operation, process the third preview image based on the second preview image to obtain the target image.

[0096] If the user is satisfied with the currently captured image, the user can trigger a shooting operation. This shooting operation can be performed by the user clicking the shooting control in photo mode, or by the user clicking the recording control in video mode, etc. Thus, upon receiving the shooting operation, in order to obtain a clear image of the moon and other objects besides the moon, the electronic device, in response to the shooting operation, can process the third preview image based on the second preview image to obtain the target image, in which all objects have high clarity.

[0097] As an example, the operation of an electronic device in response to a shooting operation to process a third preview image based on a second preview image to obtain a target image includes: in response to the shooting operation, determining a target mapping parameter based on the exposure parameters of the second preview image, the target mapping parameter being used to adjust the exposure parameters of the third preview image; updating the exposure parameters of the third preview image based on the target mapping parameter; and fusing the third preview image with the updated third preview image to obtain the target image.

[0098] In some embodiments, the exposure parameters include an exposure value and an exposure duration. Thus, the operation of the electronic device determining the target mapping parameters based on the exposure parameters of the second preview image in response to the shooting operation includes: in response to the shooting operation, acquiring an S-frame (also called a short frame) corresponding to the second preview image based on the exposure parameters of the second preview image. The S-frame is a preview image captured before the second camera captures the second preview image, and the exposure value of the S-frame is less than the exposure value of the second preview image, and the exposure duration of the S-frame is less than the exposure duration of the second preview image; fusing the S-frame with the second preview image to obtain a fourth image; and determining the exposure parameters of the fourth image as the target exposure parameters.

[0099] As mentioned above, the exposure of the third preview image is not only less than that of the first preview image, but also less than that of the second preview image. Therefore, if the third preview image is processed directly based on the exposure parameters of the second preview image, the brightness of the moon displayed in the second preview image will affect the clarity of the moon displayed in the updated third preview image. Specifically, the moon area in the updated third preview image is prone to halos, leading to a decrease in the clarity of the moon in the target image after the updated third preview image is merged with the first preview image. Therefore, to avoid the second preview image negatively impacting the clarity of the moon displayed in the target image, the electronic device can determine the corresponding S-frame of the second preview image based on its exposure parameters.

[0100] It is worth noting that since the exposure of the S-frame is less than that of the second preview image, the fourth image is obtained by fusing the S-frame with the second preview image. The clarity of the moon region in the fourth image is improved, while the clarity of other objects besides the moon is not affected.

[0101] In some embodiments, the electronic device can acquire not only the S-frame corresponding to the second preview image, but also the L-frame (also called a long frame) corresponding to the second preview image. The L-frame is a preview image acquired by the second camera after acquiring the second preview image. The exposure value of the L-frame is greater than the exposure value of the second preview image, and the exposure duration of the L-frame is greater than the exposure duration of the second preview image. Then, the S-frame, the second preview image, and the L-frame can be fused to obtain a fifth image. The exposure parameters of the fifth image are determined as the target exposure parameters.

[0102] It is worth noting that by determining the L-frame of the second preview image and fusing the L-frame, S-frame, and second preview image, the signal-to-noise ratio of the fifth image is improved, the noise in the fifth image is reduced, and thus the clarity of the target image is improved.

[0103] In some embodiments, the operation of fusing a third preview image with an updated third preview image to obtain a target image includes: determining a first focus position of the moon in the third preview image and a second focus position of the moon in the updated third preview image; if the first focus position and the second focus position are inconsistent, adjusting the focus position of the moon in the updated third preview image according to the deviation value between the first focus position and the second focus position; and fusing the third preview image with the adjusted focus position with the third preview image to obtain the target image.

[0104] To avoid ghosting of the moon in the merged image, the electronic device can determine a first focus position and a second focus position separately. If the first and second focus positions are the same, the electronic device can directly merge the updated third preview image and the second preview image to obtain the target image. If the first and second focus positions are different, the position of the moon in the updated third preview image is adjusted first, and then the image is merged to obtain the target image.

[0105] It is worth noting that by adjusting the display position of the moon, the problem of the moon appearing as a ghost image in the merged image is avoided, thereby improving the clarity of the target image.

[0106] For example, see Figure 6In response to the shooting operation, the electronic device can acquire a third preview image in RAW format (RAB is a photo format or image format), a second preview image in RAW format, and S-frames and L-frames in RGB format (RGB is a photo format or image format) corresponding to the second preview image. The electronic device can merge the second preview image, S-frames, and L-frames, and map the exposure parameters of the merged image to the third preview image to obtain an updated third preview image. The updated third preview image and the original third preview image are then converted to RGB format images respectively. The position of the moon is detected to obtain the first focus position and the second focus position. If the first focus position and the second focus position are different, the position of the moon in the updated third preview image is adjusted so that the focus position of the moon in the updated third preview image is the first focus position. The updated third preview image is then merged with the original third preview image.

[0107] In other words, in response to a shooting operation, the electronic device can acquire two data streams. One data stream, X, is the data stream of the third preview image, which the electronic device can process according to the normal Image Signal Processing (ISP) pipeline. The other data stream, Y, can include the third preview image, the second preview image, and the corresponding S-frame and L-frame of the second preview image. The electronic device can sequentially process the other data stream Y by performing exposure parameter mapping, moon position adjustment, etc., before fusing it with the third preview image in data stream X and completing subsequent processing steps. For example, dynamic range correction (DRC) can be performed on the target image obtained after fusion.

[0108] In some embodiments, when performing image fusion, the electronic device can use the Laplacian pyramid algorithm to fuse different images, thereby achieving a smooth transition at the edges of the fused image. Specifically, the electronic device can use the Laplacian pyramid algorithm to fuse an S-frame with a second preset image, and it can also use the Laplacian pyramid algorithm to fuse an S-frame, an L-frame, and the second preset image, as well as it can use the Laplacian pyramid algorithm to fuse a third preview image with an updated third preview image. Of course, the electronic device can also achieve image fusion using other fusion algorithms, and this application embodiment does not impose specific limitations on this.

[0109] In some embodiments, during the process of fusing the third preview image and the updated third preview image using the Laplacian pyramid algorithm, the electronic device can also obtain a mask image corresponding to the third preview image. The mask image can be a black and white image containing a moon pattern. The mask image can help complete the fusion of the third preview image and the updated third preview image. This application embodiment does not impose specific limitations on this.

[0110] In this embodiment, since the exposure of the third preview image is less than that of the first preview image, a clear image of the moon can be obtained in the third preview image. Furthermore, since the clarity of other objects besides the moon in the second preview image is greater than that of other objects besides the moon in the third preview image, the target image obtained by processing the third preview image with the second preview image is an image with high clarity including the moon and other objects. This improves the imaging clarity of other background objects within the same frame as the moon and enhances the image shooting effect.

[0111] When other objects captured by the electronic device through the second camera are close to the electronic device, if the above is followed... Figure 4 The illustrated embodiment processes the third preview image based on the second preview image, which may result in unclear images of other objects in the fused target image. Therefore, to ensure the clarity of each object in the target image, the electronic device can also select different methods to obtain the target image based on the distance between the electronic device and other objects captured by the second camera.

[0112] Based on this, the embodiments of this application provide another possible implementation method, please refer to... Figure 7 As an example and not a limitation, this method is illustrated by its application to electronic devices and may include some or all of the following:

[0113] The operations of steps 701-703 can be referred to the operations of steps 401-403 above, and will not be described in detail in this embodiment.

[0114] Step 704: Focus on objects other than the moon within the image acquisition range of the second camera.

[0115] It should be noted that the electronic device can automatically focus on objects other than the moon, or it can focus on the object indicated by a focus operation when a focus operation is received. For example, a user can click on the location of another object in the second preview image, and in response to the user's click, the electronic device can focus on the object corresponding to the clicked location.

[0116] As an example, when the electronic device is focusing on an object other than the moon within the image acquisition range of the second camera, it can also display the location of the focus frame in the second preview image. The focus frame is used to indicate the imaging position of the currently focused object.

[0117] In some embodiments, the electronic device can focus on objects other than the moon within the image acquisition range of the second camera by means of a distance sensor or a motor corresponding to the second camera.

[0118] It should be noted that the embodiments of this application do not impose specific restrictions on the order of execution of steps 703 and 704. That is, the electronic device may execute step 704 after executing step 703, or execute step 703 after executing step 704, or execute steps 703 and 704 simultaneously.

[0119] Step 705: After focusing is complete, determine the focusing distance of the second camera.

[0120] As an example, an electronic device may have a motor corresponding to a second camera. The device can then determine the focusing distance using the code value indicating the current corresponding to the motor's stroke. Alternatively, the electronic device can use a range sensor to measure the distance between itself and other objects using Time of Flight (TOF) technology; the measured distance can then be used as the focusing distance.

[0121] It is worth noting that by using the focusing distance of the second camera, the distance between other objects outside the moon and electronic devices within the image acquisition range of the second camera can be accurately determined, thus providing data support for the subsequent determination of the target image.

[0122] Step 706: In response to the shooting operation, the third preview image is processed based on the second preview image according to the focus distance to obtain the target image.

[0123] In some embodiments, the exposure parameters include an exposure value and an exposure duration. Thus, the operation of the electronic device, in response to a shooting operation, processing a third preview image based on a second preview image according to a focusing distance to obtain a target image includes: in response to the shooting operation, acquiring an S-frame corresponding to the second preview image based on the exposure parameters of the second preview image, wherein the S-frame is a preview image captured by the second camera before capturing the second preview image, and the exposure value of the S-frame is less than the exposure value of the second preview image, and the exposure duration of the S-frame is less than the exposure duration of the second preview image; if the focusing distance is greater than a distance threshold, updating the third preview image based on the S-frame and the second preview image, and fusing the updated third preview image with the second preview image to obtain the target image; if the focusing distance is less than or equal to the distance threshold, fusing the S-frame, the second preview image, and the third preview image to obtain the target image.

[0124] It should be noted that the distance threshold can be preset according to requirements, for example, the distance threshold can be 3 meters or 3.5 meters, etc.

[0125] It is worth noting that electronic devices can select different methods to determine the target image based on different focusing distances, making the operation of determining the target image more targeted.

[0126] In one possible approach, when the focusing distance is greater than a distance threshold, the electronic device updates the third preview image based on the S-frame and the second preview image, and then fuses the updated third preview image with the second preview image to obtain the target image. This operation includes: fusing the S-frame and the second preview image to obtain a first image when the focusing distance is greater than a distance threshold; updating the exposure parameters of the third preview image according to the exposure parameters of the first image; and fusing the updated third preview image with the second preview image to obtain the target image.

[0127] As an example, the operation of updating the exposure parameters of a third preview image based on the exposure parameters of a first image may include: re-exposing the third preview image according to the exposure parameters of the first image.

[0128] It is worth noting that since the exposure of the S-frame is less than that of the second preview image, the S-frame and the second preview image are fused to obtain the first image. The clarity of the moon region in the first image is improved, while the clarity of other objects besides the moon is not affected. Thus, by updating the exposure parameters of the third preview image using the exposure parameters of the first image, the clarity of other objects in the updated third preview image is improved, thereby ensuring the clarity of each object in the target image.

[0129] As an example, the electronic device can not only acquire the S-frame corresponding to the second preview image, but also acquire the L-frame corresponding to the second preview image based on the exposure parameters of the second preview image. The L-frame is the preview image captured by the second camera after acquiring the second preview image, and the exposure value of the L-frame is greater than the exposure value of the second preview image, and the exposure duration of the L-frame is greater than the exposure duration of the second preview image. In this way, the electronic device can fuse the S-frame, the second preview image, and the L-frame to obtain the second image; update the exposure parameters of the third preview image based on the exposure parameters of the second image; and fuse the updated third preview image with the second preview image to obtain the target image.

[0130] It should be noted that the operation of the electronic device fusing the updated third preview image with the third preview image to obtain the target image can refer to the operation of the electronic device fusing the updated third preview image with the third preview image to obtain the target image in step 404 above. This application embodiment will not elaborate on this step.

[0131] It is worth noting that by acquiring the L-frame of the second preview image and fusing the L-frame, S-frame, and second preview image, the signal-to-noise ratio of the second image is improved, the noise in the second image is reduced, and thus the clarity of the target image is improved.

[0132] In another possible approach, when the focusing distance is less than or equal to a distance threshold, the electronic device performs a fusion process on the S-frame, the second preview image, and the third preview image to obtain the target image. This process includes: fusing the S-frame with the second preview image to obtain the third image when the focusing distance is less than or equal to the distance threshold; and fusing the third preview image with the third image to obtain the target image.

[0133] It is worth noting that by fusing the S-frame, the second preview image, and the third preview image, a target image with a clear moon and other clear objects can be obtained even when objects other than the moon are relatively close to the electronic device, thus improving the imaging clarity of the target image.

[0134] In some embodiments, since the electronic device can also obtain the L-frame of the second preview image based on the exposure parameters of the second preview image, when the focusing distance is less than or equal to the distance threshold, the electronic device can also fuse the S-frame, the second preview image and the L-frame to obtain the second image, and directly fuse the second image with the third preview image to obtain the target image.

[0135] It should be noted that the electronic device can also use the Laplacian pyramid algorithm to fuse the third preview image and the second image, and the electronic device can also use the Laplacian pyramid algorithm to fuse the third preview image and the third image. Of course, the electronic device can also use other methods for image fusion, and this application embodiment does not impose specific limitations on this.

[0136] As an example, when the focusing distance is less than or equal to the distance threshold, Figure 6 In the data stream Y shown, the electronic device acquires a second preview image, as well as the corresponding raw format S-frames and L-frames. This data stream Y does not contain a third preview image. Figure 6 In this context, the processing of a data stream Y by the electronic device does not include updating the exposure parameters of the third preview image.

[0137] In this embodiment, because the exposure of the third preview image is less than that of the first preview image, a clear image of the moon can be obtained in the third preview image. Furthermore, because the clarity of other objects besides the moon in the second preview image is greater than that in the third preview image, processing the third preview image using the second preview image yields a target image with high clarity including both the moon and other objects. This improves the image clarity of other background objects within the same frame as the moon and enhances the overall image capture effect. Additionally, the electronic device can select different methods to determine the target image based on the focusing distance, making the target image determination operation more targeted.

[0138] In this embodiment of the application, the electronic device can not only comply with the above... Figure 4 and Figure 7 The embodiment provides a method for fusing the updated third preview image and the original third preview image, but fusion can also be performed in other ways. For example, the display size of the moon can be adjusted during the fusion process to improve the harmony between the moon and other objects in the target image.

[0139] Based on this, the embodiments of this application provide another possible implementation method, please refer to... Figure 8 As an example and not a limitation, this method is illustrated by its application to electronic devices and may include some or all of the following:

[0140] The operations of steps 801-803 can be referred to the operations of steps 401-403 above, and will not be described in detail in this embodiment.

[0141] Step 804: If the moon is present in the first preview image, display the moon adjustment controls in the shooting interface.

[0142] As an example, the moon adjustment control is used to adjust the display size of the moon in the target image. This moon adjustment control can be composed of at least one of the following: a pattern, text, numbers, etc. Exemplarily, the application scenario of step 804 can be referred to the above. Figure 3 The application scenarios shown.

[0143] It should be noted that the embodiments of this application do not impose specific restrictions on the order of execution of steps 804 and 802. That is, the electronic device may execute step 802 after executing step 804, or execute step 804 after executing step 802, or execute steps 802 and 804 simultaneously.

[0144] Step 805: In response to user interaction with the moon adjustment control, store the target value selected by the user interaction.

[0145] It should be noted that the target value is used to indicate the size of the moon as displayed in the target image.

[0146] To improve the harmony between the moon and other objects in the current shooting scene in the target image, users can adjust the size of the moon displayed in the target image using the moon adjustment controls.

[0147] In one possible scenario, in response to user input to the moon adjustment controls, the electronic device stores the target value selected by the user, and the displayed size of the moon in the third preview image does not change. That is, after the user adjusts the moon's size in the target image using the moon adjustment controls, the user cannot see the change in the moon's size before the electronic device displays the target image.

[0148] In another possible scenario, in response to a user operation on the moon adjustment control, the electronic device, having stored the target value selected by the user operation, can adjust the displayed size of the moon in the third preview image to the size indicated by the target value. This application embodiment will be described using an example where the displayed size of the moon in the third preview image is not changed during the image acquisition phase.

[0149] It is worth noting that by adjusting the size of the moon in the target image using the moon adjustment controls, the harmony between the moon and other objects in the target image is improved, while also enhancing interactivity with the user.

[0150] Step 806: In response to the shooting operation, process the third preview image based on the second preview image to obtain the target image.

[0151] It should be noted that the operation of the electronic device in response to the shooting operation, processing the third preview image based on the second preview image to obtain the target image, can refer to step 404 above. That is, in response to the shooting operation, the electronic device can determine the target mapping parameters based on the exposure parameters of the second preview image, which are used to adjust the exposure parameters of the third preview image; update the exposure parameters of the third preview image based on the target mapping parameters; and fuse the third preview image with the updated third preview image to obtain the target image.

[0152] Alternatively, the electronic device can refer to step 706 above, and before referring to step 706, the electronic device can perform steps 704 and 705 to determine the focus distance of the second camera. In this way, in response to the shooting operation, the electronic device can obtain the S-frame corresponding to the second preview image based on the exposure parameters of the second preview image. The S-frame is a preview image captured before the second camera captures the second preview image, and the exposure value of the S-frame is less than the exposure value of the second preview image, and the exposure duration of the S-frame is less than the exposure duration of the second preview image. If the focus distance is greater than a distance threshold, the third preview image is updated based on the S-frame and the second preview image, and the updated third preview image is fused with the second preview image to obtain the target image. If the focus distance is less than or equal to the distance threshold, the S-frame, the second preview image, and the third preview image are fused to obtain the target image.

[0153] Since the user may have adjusted the display size of the moon in the target image, the electronic device can also adjust the display size of the moon in the third preview image during the fusion process of other images and the third preview image, thereby achieving the adjustment of the display size of the moon in the target image.

[0154] In some embodiments, the operation of fusing the updated third preview image with the third preview image to obtain the target image includes: determining a first focus position of the moon in the third preview image and a second focus position of the moon in the updated third preview image; if the first focus position and the second focus position are inconsistent, adjusting the focus position of the moon in the updated third preview image according to the deviation value between the first focus position and the second focus position; and fusing the third preview image with the adjusted focus position and the third preview image according to the target value to obtain the target image.

[0155] As an example, the operation of an electronic device to merge a third preview image with a third preview image after focusing and a third preview image based on a target value includes: when the target value is a preset value, merging the third preview image with a third preview image after focusing and a third preview image to obtain the target image; when the target value is the target value, adjusting the size of the moon in the third preview image to the size indicated by the target value, and merging the third preview image with the adjusted moon size and the third preview image with the adjusted focus and a third preview image to obtain the target image.

[0156] Since the user may not have adjusted the moon's display size in the target image using the moon adjustment controls, in this case, the electronic device may not need to adjust the moon's display size during the image fusion stage.

[0157] It should be noted that this preset value can be set in advance according to needs. Under normal circumstances, the preset value is 1. When the preset value is 1, the display size of the moon captured by the first camera is the same as the display size of the moon in the target image, that is, there is no need to adjust the display size of the moon.

[0158] To ensure the accuracy of the moon's displayed position and avoid ghosting in the moon area after merging, the electronic device can adjust the moon's display size in the third preview image according to the target value after adjusting the moon's focus position. For example, see... Figure 6 After determining the initial focus position of the moon, the electronic device can adjust the moon's display size in the third preview image according to the target values. Then, the third preview image with the adjusted moon size is merged with the third preview image with the adjusted focus position.

[0159] It should be noted that electronic devices can use the Laplacian pyramid algorithm to fuse the third preview image after adjusting the size of the moon display with the third preview image after adjusting the focus position.

[0160] It is worth noting that adjusting the focus position of the moon and then adjusting the size of the moon's display reduces the possibility of moon ghosting in the target image, thereby improving the clarity and display effect of the target image.

[0161] In this embodiment, because the exposure of the third preview image is less than that of the first preview image, a clear image of the moon can be obtained in the third preview image. Furthermore, because the clarity of other objects besides the moon in the second preview image is greater than that in the third preview image, processing the third preview image using the second preview image results in a target image with high clarity including both the moon and other objects. This improves the image clarity of other background objects within the same frame as the moon and enhances the overall image capture effect. Additionally, the electronic device can select different methods to determine the target image based on different focus distances, making the target image determination operation more targeted. Moreover, adjusting the moon's display size in the target image using the moon adjustment control improves the harmony between the moon and other objects in the target image and enhances user interactivity.

[0162] After a detailed explanation of the image processing method provided in the embodiments of this application, the electronic equipment involved in the embodiments of this application will be described.

[0163] As an example, this method can be applied to an electronic device equipped with multiple cameras, including a telephoto camera and a main camera. As an example and not a limitation, the electronic device can be, but is not limited to, tablet computers, desktop computers, laptop computers, handheld computers, laptops, in-vehicle devices, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), mobile phones, smartwatches, smart cameras, etc., and this application embodiment does not limit this.

[0164] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. See also... Figure 9The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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.

[0165] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0166] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0167] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0168] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0169] In some embodiments, the processor 110 may include one or more interfaces, such as 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.

[0170] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

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

[0172] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0173] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is an integer greater than 1.

[0174] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0175] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's image sensor. The light signal is converted into an electrical signal, and the image sensor transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimizations on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 193.

[0176] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is an integer greater than 1.

[0177] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP performs Fourier transforms on the frequency energy.

[0178] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0179] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0180] The external storage 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 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions, such as saving music, video, and other files on the external memory card.

[0181] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created by electronic device 100 during use (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0182] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D and application processor.

[0183] Pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch operation intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a pressure threshold is applied to the above-mentioned... Figure 2 When the shooting control shown is activated, the image capture command is executed. When a touch operation with a pressure intensity greater than or equal to the pressure threshold is applied to the above... Figure 2 When the image viewing control shown is invoked, the command to display the image is executed.

[0184] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the user presses the above... Figure 2 The shooting control shown uses a gyroscope sensor 180B to detect the angle of vibration of the electronic device 100. Based on the angle, it calculates the distance that the lens module needs to compensate for, allowing the lens to counteract the vibration of the electronic device 100 through reverse movement, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0185] A distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, during a shooting scene, the electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing. For example, the distance sensor 180F can be used to focus on objects other than the moon within the image acquisition range of the second camera, and after focusing is complete, the focusing distance of the second camera can be determined.

[0186] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0187] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch display." Touch sensor 180K detects touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0188] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, touch operations applied to different applications (such as taking photos, playing audio, etc.) can correspond to different vibration feedback effects. Touch operations applied to different areas of the display screen 194 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized. For example, the motor can also be used to determine object focusing and focusing distance.

[0189] The software system of electronic device 100 will be described next.

[0190] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered Android system as an example to illustrate the software system of electronic device 100.

[0191] Figure 10 This is a block diagram of a software system for an electronic device 100 provided in an embodiment of this application. See also... Figure 10 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system layer, and the kernel layer.

[0192] The application layer can include a series of application packages. For example... Figure 10 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0193] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 10 As shown, the application framework layer can include a window manager, content providers, a view system, a phone manager, a resource manager, and a notification manager. The window manager manages window programs. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture the screen. The content provider stores and retrieves data, making this data accessible to the application. This data can include videos, images, audio, made and received phone calls, browsing history and bookmarks, and phone books. The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build the application's display interface, which can consist of one or more views, such as a view displaying SMS notification icons, a view displaying text, and a view displaying images. The phone manager provides communication functions for the electronic device 100, such as managing call status (including connection and disconnection). The resource manager provides the application with various resources, such as localized strings, icons, images, layout files, and video files. The notification manager allows the application to display notification information in the status bar, which can be used to convey informational messages and can disappear automatically after a short pause without user interaction. For example, the notification manager is used to notify users of download completions and message alerts. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications. Furthermore, the notification manager can appear as dialog boxes on the screen, such as displaying text messages in the status bar, emitting sounds, causing electronic devices to vibrate, or flashing indicator lights.

[0194] The Android Runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries consist of two parts: one part contains the functionalities that Java needs to call, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0195] The system library can include multiple functional modules, such as a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. The media libraries support various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing libraries are used for 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.

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

[0197] The following example, using a scene of capturing a photograph, illustrates the workflow of the software and hardware of the electronic device 100.

[0198] When touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, touch operation timestamp, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the raw input event. Taking a single-click operation as an example, where the corresponding control is the camera application icon, the camera application calls the interface of the application framework layer to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 193.

[0199] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).

[0200] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.

Claims

1. An image processing method, characterized by, The method is applied to an electronic device, and the method comprises: In an image acquisition process by a first camera of the electronic device, if a zoom ratio of the first camera is greater than or equal to a first ratio threshold, a first preview image collected by the first camera is subjected to moon detection; In a case where the moon exists in the first preview image, a second preview image collected by a second camera of the electronic device is displayed in the first preview image in a picture-in-picture manner, and the second preview image and the first preview image both contain the moon; The first preview image is updated to a third preview image, the third preview image has an exposure smaller than that of the first preview image, and the clarity of objects other than the moon in the second preview image is greater than that of objects other than the moon in the third preview image; An object other than the moon in an image acquisition range of the second camera is focused; After the focusing is completed, a focusing distance of the second camera is determined; In response to a shooting operation, an S frame corresponding to the second preview image is acquired according to an exposure parameter of the second preview image, the S frame is a preview image collected by the second camera before the second preview image is collected, the exposure value of the S frame is smaller than that of the second preview image, and the exposure duration of the S frame is smaller than that of the second preview image; In a case where the focusing distance is greater than a distance threshold, the third preview image is updated based on the S frame and the second preview image, the updated third preview image is fused with the third preview image, and a target image is obtained, wherein updating the third preview image comprises updating an exposure parameter of the third preview image; In a case where the focusing distance is smaller than or equal to the distance threshold, the S frame, the second preview image and the third preview image are fused to obtain the target image.

2. The method of claim 1, wherein, The case where the focusing distance is greater than the distance threshold, the third preview image is updated based on the S frame and the second preview image, the updated third preview image is fused with the third preview image, and the target image is obtained, comprises: In a case where the focusing distance is greater than the distance threshold, the S frame and the second preview image are fused to obtain a first image; An exposure parameter of the third preview image is updated according to an exposure parameter of the first image; The updated third preview image is fused with the third preview image to obtain the target image.

3. The method of claim 1, wherein, The case where the focusing distance is greater than the distance threshold, the third preview image is updated based on the S frame and the second preview image, the updated third preview image is fused with the third preview image, and the target image is obtained, further comprises: According to the exposure parameter of the second preview image, an L frame corresponding to the second preview image is obtained, the L frame is a preview image collected after the second camera collects the second preview image, and an exposure value of the L frame is greater than an exposure value of the second preview image, and an exposure duration of the L frame is greater than an exposure duration of the second preview image; In a case where the focusing distance is greater than a distance threshold, the third preview image is updated based on the S frame and the second preview image, and the updated third preview image and the third preview image are fused to obtain the target image, including: Fusing the S frame, the second preview image and the L frame to obtain a second image; Updating the exposure parameter of the third preview image according to the exposure parameter of the second image; Fusing the updated third preview image and the third preview image to obtain the target image.

4. The method according to any one of claims 1 to 3, characterized in that, The fusing of the updated third preview image and the third preview image to obtain the target image includes: Determining a first focusing position of the moon in the third preview image and a second focusing position of the moon in the updated third preview image; In a case where the first focusing position and the second focusing position are inconsistent, adjusting the focusing position of the moon in the updated third preview image according to a deviation value of the first focusing position and the second focusing position; According to a target value, the third preview image with the adjusted focusing position and the third preview image are fused to obtain the target image, the target value being used to indicate a display size of the moon in the target image.

5. The method of claim 4, wherein, The fusing of the third preview image with the adjusted focusing position and the third preview image to obtain the target image according to the target value includes: In a case where the target value is a preset value, the third preview image with the adjusted focusing position and the third preview image are fused to obtain the target image; In a case where the target value is the target value, the display size of the moon in the third preview image is adjusted to a size indicated by the target value, and the third preview image with the adjusted moon display size and the third preview image with the adjusted focusing position are fused to obtain the target image, the target value being determined in response to a user operation of adjusting the display size of the moon received before the photographing operation.

6. The method of claim 4, wherein, In the image collection process by the first camera of the electronic device, if the zoom ratio of the first camera is greater than or equal to a first ratio threshold, after the moon detection on the first preview image collected by the first camera, the method further includes: In a case where the moon exists in the first preview image, displaying a moon adjustment control in a photographing interface, the moon adjustment control being used to adjust the display size of the moon in the target image; In response to a user operation on the moon adjustment control, a target value selected by the user operation is stored, the target value being used to indicate a display size of the moon in the target image.

7. The method of claim 1, wherein, In the case that the focus distance is less than or equal to the distance threshold, the S-frame, the second preview image and the third preview image are fused to obtain the target image, including: In the case that the focus distance is less than or equal to the distance threshold, the S-frame and the second preview image are fused to obtain a third image; The third preview image and the third image are fused to obtain the target image.

8. An electronic device, comprising: The structure of the electronic device includes a processor and a memory; The memory is configured to store a program supporting the electronic device to perform the method of any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, when the instructions are run on a computer, the computer is caused to perform the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Moon shooting method and device, storage medium and shooting equipment

    CN115379075A