Image processing method, electronic equipment and readable storage medium

By detecting the moon when the camera zoom ratio is high and adjusting the exposure according to the system time and the moon phase, the image processing error caused by the electronic device's misdetection of the moon is solved, and the accuracy and clarity of image processing are improved.

CN120751235APending Publication Date: 2025-10-03HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411098911.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

Electronic devices are prone to misdetection when identifying the moon, leading to image processing errors.

Method used

By detecting the moon when the camera zoom ratio is greater than or equal to a preset threshold, the moon phase is determined, and the exposure is adjusted according to the system time and the moon phase angle to improve the accuracy of image processing.

Benefits of technology

The accuracy of image processing is improved, ensuring the clarity of moon images and reducing the possibility of false detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120751235A_ABST
    Figure CN120751235A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method, electronic equipment and a readable storage medium, and belongs to the technical field of terminals. The method is applied to an electronic device, and comprises the following steps: in a process of collecting an image through a camera, if the zoom ratio of the camera is greater than or equal to a preset ratio threshold, carrying out moon detection on a first preview image collected by the camera; under the condition that the moon exists in the first preview image, determining a first moon phase state of the moon in the first preview image; under the condition that the first lunar phase state and the second lunar phase state are the same, the first preview image is updated to be a second preview image, the exposure degree of the second preview image is smaller than that of the first preview image, and the second lunar phase state is the lunar phase state corresponding to the system time of the electronic equipment. According to the method, the moon phase of the moon in the collected preview image is compared with the moon phase of the moon in actual life, so that whether the moon exists in the preview image or not can be further determined, and the accuracy of image processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an image processing method, an electronic device, and a readable storage medium. Background Art

[0002] With the development of terminal technology, electronic devices are becoming increasingly versatile in terms of camera functionality. For example, electronic devices can now include multiple camera modes, including full-moon shooting mode, portrait mode, and sunrise / sunset mode. In full-moon shooting mode, electronic devices can capture clear images of the moon through their cameras.

[0003] However, the electronic device may enter the moon-viewing shooting mode when it recognizes that there is a moon in the captured image, but the electronic device may misdetect the moon, resulting in image processing errors. Summary of the Invention

[0004] This application provides an image processing method, electronic device, and readable storage medium, which can reduce the possibility of image processing errors caused by moon recognition errors in related technologies. The technical solution is as follows:

[0005] In a first aspect, a method for processing an image is provided, which is applied to an electronic device. The method includes:

[0006] During the process of capturing images through a camera, if the zoom ratio of the camera is greater than or equal to a preset ratio threshold, moon detection is performed on the first preview image captured by the camera; when there is a moon in the first preview image, the first lunar phase state of the moon in the first preview image is determined; when the first lunar phase state and the second lunar phase state are the same, the first preview image is updated to a second preview image, the exposure of the second preview image is less than the exposure of the first preview image, and the second lunar phase state is the lunar phase state corresponding to the system time of the electronic device.

[0007] In this way, since the phase of the moon changes with time, by comparing the phase of the moon in the collected preview image with the phase of the moon in real life, it is possible to further determine whether there is a moon in the preview image, thereby improving the accuracy of image processing.

[0008] As an example of the present application, when there is a moon in the first preview image, the operation of determining a first lunar phase state of the moon in the first preview image includes:

[0009] When there is a moon in the first preview image, the first preview image is input into a moon phase recognition model, which is used to identify the moon phase state of the moon in the image; the moon in the first preview image is recognized by the moon phase recognition model to obtain the first moon phase state.

[0010] As an example of the present application, when the moon exists in the first preview image, the operation of inputting the first preview image into the moon phase recognition model includes:

[0011] When there is a moon in the first preview image, the rotation angle of the electronic device is obtained; the imaging image corresponding to the first preview image is rotated according to the rotation angle to obtain a third preview image, where the imaging image is the image formed when the first preview image is stored; and the third preview image is input into the moon phase recognition model.

[0012] In this way, by rotating the image of the first preview image, the moon phase state in the first preview image can be accurately identified.

[0013] As an example of the present application, when the first moon phase state and the second moon phase state are the same, the electronic device can also obtain the system time of the electronic device before updating the first preview image to the second preview image; and determine the second moon phase state of the moon corresponding to the system time based on the system time.

[0014] In this way, the lunar phase state of the moon in real life can be accurately determined through the system time.

[0015] As an example of the present application, the electronic device determines, based on the system time, the second lunar phase state of the moon corresponding to the system time, including:

[0016] From the correspondence between the time range and the moon phase state, the moon phase state corresponding to the time range of the system time is obtained to obtain the second moon phase state.

[0017] In this way, through the pre-stored correspondence between the time range and the moon phase state, the electronic device can quickly determine the moon phase state of the moon under the current system time, thereby improving the efficiency of determining the second moon phase state.

[0018] As an example of the present application, the electronic device determines, based on the system time, the second lunar phase state of the moon corresponding to the system time, including:

[0019] Determine the first coordinate position of the earth relative to the sun and the second coordinate position of the moon relative to the sun according to the system time;

[0020] The moon phase angle is determined based on the first coordinate position and the second coordinate position. The moon phase angle is the angle between the first ray and the second ray. The first ray is a ray with the earth as the endpoint and extending to the moon, and the second ray is a ray with the earth as the endpoint and extending to the sun. Based on the moon phase angle, the corresponding second moon phase state is determined.

[0021] In this way, the second lunar phase state of the moon is determined by the lunar phase angle, thereby improving the accuracy of determining the second lunar phase state.

[0022] As an example of the present application, when the first moon phase state and the second moon phase state are the same, the operation of the electronic device updating the first preview image to the second preview image includes:

[0023] A super-resolution model corresponding to the first lunar phase state or the second lunar phase state is obtained, where the super-resolution model is used to improve the resolution of the image; and the first preview image is processed by the super-resolution model to obtain a second preview image.

[0024] In this way, the first preview image is processed by the super-resolution model corresponding to the current moon phase state, thereby improving the image resolution in a more targeted manner, ensuring not only the clarity of the moon in the image, but also the clarity of other objects in the image.

[0025] As an example of the present application, when the first moon phase state and the second moon phase state are the same, the operation of updating the first preview image to the second preview image includes:

[0026] When the first moon phase state and the second moon phase state are the same, the exposure degree and / or exposure duration of the first preview image is reduced to obtain a second preview image.

[0027] In this way, by reducing the exposure level and / or exposure duration of the first preview image, no other operations need to be performed, thereby improving the efficiency of obtaining the second preview image.

[0028] In a second aspect, an image processing device is provided, wherein the image processing device has the function of implementing the image processing method described in the first aspect. The image processing device includes at least one module configured to implement the image processing method described in the first aspect. The device is applied to an electronic device and includes:

[0029] a detection module configured to perform moon detection on a first preview image captured by the camera if a zoom ratio of the camera is greater than or equal to a preset ratio threshold during image capture by the camera;

[0030] a determination module, configured to determine a first lunar phase state of the moon in the first preview image when the moon exists in the first preview image;

[0031] An update module is used to update the first preview image to a second preview image when the first lunar phase state and the second lunar phase state are the same, wherein the exposure of the second preview image is less than the exposure of the first preview image, and the second lunar phase state is the lunar phase state corresponding to the system time of the electronic device.

[0032] In a third aspect, an electronic device is provided. The electronic device includes a processor and a memory, wherein the memory is configured to store a program that supports the electronic device in executing the image processing method provided in the first aspect, as well as data used to implement 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 also include a communication bus that establishes a connection between the processor and the memory.

[0033] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the image processing method described in the first aspect.

[0034] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the image processing method described in the first aspect.

[0035] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0037] Figure 2 This is a block diagram of a software system of an electronic device provided in an embodiment of the present application;

[0038] Figure 3 This is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0039] Figure 4 is a schematic diagram of another application scenario provided by an embodiment of the present application;

[0040] Figure 5 This is a schematic diagram of the phases of the moon provided in an embodiment of the present application;

[0041] Figure 6 This is a flowchart of an image processing method provided by an embodiment of the present application;

[0042] Figure 7 This is a schematic diagram of a shooting scene provided by an embodiment of the present application;

[0043] Figure 8 This is a schematic diagram of the relationship between the moon phase angle and the moon phase provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0045] It should be understood that the “multiple” mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, words such as “first” and “second” are used to distinguish between identical or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and execution order, and words such as “first” and “second” do not necessarily limit them to be different.

[0046] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in 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 "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0047] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0048] With technological advancements, the use cases for camera functions in electronic devices, such as mobile phones, are becoming increasingly diverse. For example, users can use these devices to photograph celestial bodies, such as the moon and the sun. When photographing the moon, these devices are prone to overexposing and out-of-focus images of the moon (the image containing the moon as the subject). Therefore, to ensure clear images of the moon, electronic devices offer a moon-viewing shooting mode.

[0049] Among them, the full moon shooting mode is a shooting mode used by electronic devices such as mobile phones when shooting the moon. It can also be called moon mode, moon viewing mode, moon shooting mode, full moon mode, etc. In the full moon shooting mode, the mobile phone can capture a clear image of the moon. During the process of image acquisition by the camera, the electronic device can automatically enter the full moon shooting mode when it detects that there is a moon in the preview image captured by the camera; or, the electronic device can enter the full moon shooting mode when it receives the shooting mode selected by the user's mode selection operation as the full moon shooting mode. Alternatively, the electronic device can automatically enter the full moon shooting mode when it detects that there is a moon in the preview image captured by the camera and the zoom ratio of the camera is greater than a certain threshold.

[0050] However, when electronic devices identify the moon in an image, they may mistakenly identify a light source such as a street lamp as the moon, that is, misdetect the moon, which may lead to image processing errors.

[0051] To improve the accuracy of image processing, an embodiment of the present application provides an image processing method. In this method, when an electronic device is capturing an image through a camera, if the camera's zoom ratio is greater than or equal to a preset ratio threshold, the electronic device may perform moon detection on a first preview image captured by the camera. If the moon is present in the first preview image, the first lunar phase of the moon in the first preview image is determined. If the first lunar phase is the same as the second lunar phase of the moon according to the electronic device's system time, the first preview image is updated to a second preview image, and the exposure of the second preview image is lower than that of the first preview image. In this way, since the phase of the moon changes over time, by comparing the phase of the moon in the captured preview image with the phase of the moon in real life, it is possible to further determine whether the moon is present in the preview image, thereby improving the accuracy of image processing.

[0052] Before explaining in detail the image processing method provided in the embodiment of the present application, the electronic device involved in the embodiment of the present application is first described.

[0053] As an example, the method can be applied to an electronic device with a camera. By way of example and not limitation, the electronic device may be, but is not limited to, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an in-vehicle device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a mobile phone, a smartwatch, etc., and the embodiments of the present application are not limited thereto.

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

[0055] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

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

[0057] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0058] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0059] 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.

[0060] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

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

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

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

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

[0065] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

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

[0067] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0068] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0069] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, voice recognition, and text comprehension.

[0070] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

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

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

[0073] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0074] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0075] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. Accelerometer 180E can also be used to identify the posture of electronic device 100, enabling applications such as switching between landscape and portrait modes and pedometers.

[0076] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, in a shooting scenario, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

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

[0078] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor 180K can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a location different from that of the display screen 194.

[0079] Next, the software system of the electronic device 100 will be described.

[0080] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the present application, the software system of the electronic device 100 is exemplarily described by taking the Android system of the layered architecture as an example.

[0081] Figure 2 This is a block diagram of a software system of an electronic device 100 provided in an embodiment of the present application. Figure 2 The layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime layer, the system layer, and the kernel layer.

[0082] The application layer can include a series of application packages. Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0083] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2As shown, the application framework layer may include a window manager, content provider, view system, telephony manager, resource manager, notification manager, and so on. The window manager is used to manage window programs. It can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, and so on. The content provider is used to store and retrieve data and make this data accessible to applications. This data may include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and the phone book. The view system includes visual controls, such as those for displaying text and images. The view system can be used to construct the application's display interface, which may consist of one or more views, such as a view that displays a text message notification icon, a view that displays text, and a view that displays images. The telephony manager is used to provide communication functions for electronic device 100, such as managing call status (including connected and ended calls). The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, and video files. The notification manager enables applications to display notification information in the status bar. This information can be used to convey notification messages and can be displayed briefly and then disappear automatically without user interaction. For example, a notification manager is used to notify users of completed downloads, message alerts, and more. A notification manager can also appear as an icon or scrolling text bar in the system's top status bar, such as notifications from background applications. A notification manager can also appear as a dialog window on the screen, such as a text message in the status bar, a beep, a vibration on an electronic device, or a flashing indicator light.

[0084] The Android Runtime consists of core libraries and a virtual machine (VM). The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one for Java-based functions and the other for the Android core library. The application layer and application framework layer run in the VM. The VM executes Java files from the application layer and application framework layer as binary files. The VM is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0085] The system library can include multiple functional modules, such as: surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc. The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.

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

[0087] The following describes the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.

[0088] When touch sensor 180K receives a touch operation, a 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, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the raw input event. For example, if the touch operation is a single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then calls the kernel layer to start the camera driver to capture a still image or video through the camera 193.

[0089] Next, the application scenarios involved in the embodiments of the present application are explained by taking a mobile phone as an example of an electronic device.

[0090] Please refer to Figure 3 , Figure 3 A schematic diagram of an application scenario provided by an embodiment of the present application. In one application scenario, a user may take a photo through a camera of an electronic device while using the electronic device. After the electronic device starts the camera, the following may be displayed on the display screen: Figure 3 The shooting interface shown in Figure (a) shows a preview image A captured by the camera. When shooting with an electronic device, the user can adjust the zoom ratio of the current camera. For example, the user can click the zoom control to change the zoom ratio from 1× to 10×. In response to the adjustment operation of the zoom ratio of the camera, the electronic device captures an image according to the adjusted zoom ratio through the camera, and obtains the following image: Figure 3 In the preview image B shown in FIG. (b), the electronic device can detect whether the preview image B contains the moon. When the preview image B is detected to contain the moon, the moon phase of the moon in the preview image B is determined to obtain a first moon phase state; when the first moon phase state and the second moon phase state are the same, the electronic device reduces the exposure of the preview image B to obtain the following. Figure 3 In the preview image C shown in FIG. (c), the second moon phase state is the second moon phase state of the current moon determined according to the system time of the electronic device. If the user clicks the shooting control P1 in this case, the electronic device responds to the click operation of the shooting control P1 and performs image exposure based on the preview image C. If the user needs to view the captured image, see Figure 3 In the figure (d), the user can click the image viewing control P2 in the shooting interface. In response to the click operation on the image viewing control P2, the electronic device can display the following Figure 3 The target image E is shown in Figure (e).

[0091] In another possible scenario, the electronic device responds to the adjustment operation of the zoom ratio of the camera S1 and acquires an image according to the adjusted zoom ratio through the camera S1, and obtains the following image: Figure 4 After the preview image B shown in FIG. (a) is displayed, when the first moon phase state and the second moon phase state are the same, the electronic device reduces the exposure of the preview image B, and obtains the following Figure 4 The preview image C shown in FIG (b) is displayed, and the preview image D captured by another camera S2 of the electronic device is displayed in the preview image C in a picture-in-picture manner. If the user clicks the shooting control P1 in this case, the mobile phone responds to the click operation of the shooting control P1 and performs image exposure based on the preview image D and the preview image C. If the user needs to view the captured image, see Figure 4 In Figure (c), the user can click on the image viewing control P2 in the shooting interface. In response to the click operation on the image viewing control P2, the mobile phone can display the following Figure 4 The target image E is shown in Figure (d).

[0092] It should be noted that the camera S1 for capturing the preview image C may be a telephoto camera of the electronic device, and the camera S2 for capturing the preview image D may be a main camera of the electronic device.

[0093] It should also be noted that the lunar phase refers to the different states of the moon at different times, including: new moon (new moon), crescent moon (crescent moon), waning moon, full moon (full moon), first quarter moon, last quarter moon, waxing gibbous moon, and waning gibbous moon. Figure 5On the first day of each lunar month, when the moon passes between the sun and the Earth, this phase is called the "new moon" or "new moon." After the new moon, the moon gradually moves out of the area between the Earth and the Sun, and this phase is called the "crescent moon." Around the eighth day of the lunar month, the moon has moved 90 degrees east of the sun, and this phase is called the "first quarter moon." After the first quarter moon, the moon gradually becomes fuller, and this phase is called the "waxing gibbous moon." On the fifteenth or sixteenth day of the lunar month, when the Earth is between the sun and the moon, this phase is called the "full moon" or "full moon." After the full moon, as the sun and moon gradually approach each other, the moon gradually "wanes," passing through the stages of waning gibbous, last quarter, and waning, before finally returning to the position of a new moon.

[0094] It should be noted that the embodiments of this application are only based on the above Figure 3-Figure 5 The application scenarios shown are provided as examples for illustration and do not limit the embodiments of the present application.

[0095] Based on the execution application scenario provided by the above embodiment, the image processing method provided by the embodiment of this application is introduced below. Figure 6 , Figure 6 This is a flowchart of an exemplary method for processing an image. As an example and not a limitation, the method is described by taking an electronic device as an example. The method may include some or all of the following contents:

[0096] Step 601: Capture a fourth preview image through a camera of an electronic device.

[0097] It should be noted that the fourth preview image is a preview image captured by the camera before adjusting the zoom magnification of the camera. For example, the fourth preview image can be an image captured when the camera is just started, or an image captured by the camera before the zoom magnification is greater than a preset magnification threshold. For example, the fourth preview image can be the above Figure 3 The preview image A is shown in Figure (a).

[0098] Step 602: During image acquisition by a camera of an electronic device, a zoom factor of the camera is obtained.

[0099] During image acquisition by a camera of an electronic device, a user may adjust the camera's zoom ratio to obtain a desired image. Therefore, the camera's zoom ratio may change. For example, the camera's zoom ratio may change from a first zoom ratio to a second zoom ratio. The electronic device may operate differently when the camera is at different zoom ratios. Therefore, the electronic device can obtain the camera's zoom ratio.

[0100] As an example, the electronic device can obtain the zoom ratio of the camera when receiving a touch operation on the zoom control, and the zoom control is used to trigger the change of the zoom ratio of the camera. Of course, the electronic device can also obtain the zoom ratio of the camera at other times. For example, when the electronic device switches to certain shooting modes, it will automatically increase the zoom ratio of the camera. For example, when the electronic device receives a shooting mode switching instruction, the electronic device can adjust the zoom ratio of the camera from the first zoom ratio to the third zoom ratio. In this case, the electronic device can obtain the zoom ratio of the camera when receiving the mode switching instruction. The embodiments of the present application do not impose specific restrictions on this.

[0101] It should be noted that, as can be seen from the above, an electronic device may acquire images through multiple cameras. In this case, adjusting the zoom ratio refers to adjusting the zoom ratio of the telephoto camera in the electronic device.

[0102] Step 603: Determine whether the zoom ratio of the camera is greater than or equal to a preset ratio threshold, if so, perform the operations of the following steps 604 and 608 respectively. If not, perform image acquisition according to the adjusted zoom ratio.

[0103] It should be noted that the preset magnification threshold can be pre-set according to needs. For example, the preset magnification threshold can be 10 times (or written as 10X), 15 times, 20 times or 30 times, etc.

[0104] As an example, when the zoom ratio of the camera is less than a preset ratio threshold, the electronic device can capture images according to the adjusted zoom ratio and will not enter the moon-gazing shooting mode.

[0105] Step 604: In response to the adjustment operation of the zoom ratio of the camera, image capture is performed according to the adjusted zoom ratio to obtain a first preview image.

[0106] Step 605: Detect whether there is a moon in the first preview image; if there is a moon, perform the operation of the following step 606; if there is no moon, image acquisition can be performed according to the adjusted zoom ratio, and the moon-viewing shooting mode will not be entered.

[0107] Since the electronic device may enter the full moon shooting mode when the zoom ratio of the camera is greater than or equal to the preset ratio threshold, in order to determine whether to enter the full moon shooting mode, the electronic device can perform moon detection on the first preview image captured by the camera.

[0108] In some embodiments, the electronic device can detect the moon in the first preview image captured by the camera in a variety of ways. For example, a neural network model can be set in the electronic device, and the neural network model can perform object recognition. In this way, the electronic device can identify each object in the first preview image through the set neural network model, and detect whether the moon exists by identifying each object. Alternatively, the electronic device can have an AI (artificial intelligence) recognition function. In this way, the electronic device can identify each object in the first preview image through the AI ​​recognition function to detect whether the moon exists in the first preview image. The embodiments of the present application do not impose specific restrictions on this.

[0109] Step 606: Detect the rotation state of the electronic device.

[0110] When there is a moon in the first preview image, the moon in the first preview image can be identified as a moon phase. However, since the first preview image is an image preview schematic interface and not a real imaging image, when performing subsequent operations to identify the moon's phase, the imaging image of the first preview image needs to be used for moon phase identification. In addition, since the user may control the electronic device to rotate when using the electronic device's camera to shoot, and after the electronic device rotates, the imaging image of the first preview image may change due to the rotation of the electronic device, if the imaging image of the first preview image is used for moon phase identification, then the moon phase identification may be inaccurate. Therefore, in order to accurately identify the moon's phase in the first preview image, the electronic device can detect the rotation state of the electronic device.

[0111] For example, when the top of the electronic device is facing upward (almost toward the sky), the first preview image captured by the electronic device may be Figure 7 As shown in Figure (a), the imaging image of the first preview image is as follows Figure 7 As shown in Figure (b); if the top of the electronic device is facing up, rotate it 90 degrees clockwise, then see Figure 7 In FIG. (c), the viewing range of the first preview image captured by the electronic device changes as the electronic device rotates, and the imaging image of the first preview image is as shown in FIG. Figure 7 As shown in Figure (d) in FIG; If the electronic device continues to rotate 90 degrees clockwise, the first preview image can be as follows Figure 7 As shown in Figure (e), the corresponding imaging image is Figure 7 As shown in Figure (f) in the figure; continue to rotate 90 degrees clockwise, the first preview image can be as Figure 7 As shown in Figure (g), the corresponding imaging image is as follows Figure 7As shown in Figure (h) of the figure, it can be seen that after the electronic device is rotated, the image corresponding to the first preview image will also rotate. Subsequent moon phase recognition is based on the image, which may lead to moon phase recognition errors, such as misidentifying the first quarter moon and the last quarter moon. Therefore, to ensure the accuracy of subsequent moon phase recognition, the rotation state of the electronic device can be detected.

[0112] It should be noted that the above Figure 7 The first preview image and the imaged image of the first preview image are only examples, and there may be other situations, which are not specifically limited in the embodiments of the present application.

[0113] As an example, the rotation state of the electronic device includes a rotation angle of the electronic device, or includes a rotation angle and a rotation direction of the electronic device.

[0114] In some embodiments, the electronic device may determine the rotation angle and rotation direction of the electronic device based on a gravity sensor.

[0115] Step 607: Determine a first moon phase state of the moon in the first preview image according to the rotation angle of the electronic device.

[0116] As can be seen from the above, the rotation of the electronic device may affect the accuracy of moon phase recognition of the moon in the first preview image. Therefore, the electronic device can determine the first moon phase state of the moon in the first preview image according to the rotation angle.

[0117] In some embodiments, the operation of the electronic device determining the first lunar state of the moon in the first preview image based on the rotation angle includes: rotating the imaged image corresponding to the first preview image according to the rotation angle to obtain a third preview image, where the imaged image is the image imaged when the first preview image is stored; and performing lunar phase recognition on the moon in the third preview image through a lunar phase recognition model to obtain the first lunar phase state.

[0118] It should be noted that the display direction of the third preview image is the same as the display direction of the first preview image when the top of the electronic device is facing upward.

[0119] In some embodiments, if the imaged image of the first preview image is not rotated before being input into the moon phase recognition model regardless of whether the electronic device is rotated, then the electronic device can directly input the imaged image of the first preview image (not rotated, that is, the display direction of the imaged image is the same as the display direction of the first preview image) into the moon phase recognition model without rotating the imaged image of the first preview image.

[0120] It should be noted that the lunar phase recognition model may be a pre-trained model for recognizing the lunar phase of the moon.

[0121] Step 608: Determine the second phase of the moon according to the system time of the electronic device.

[0122] In some embodiments, the operation of an electronic device determining the second lunar phase state of the moon based on the system time of the electronic device includes: obtaining the lunar phase state corresponding to the time range of the system time from the correspondence between the time range and the lunar phase state, and obtaining the second lunar phase state.

[0123] Since both the Earth and the Moon move periodically, the time of occurrence of each lunar phase is roughly fixed. Therefore, the electronic device can pre-store the correspondence between the time range and the lunar phase, so that the corresponding lunar phase can be obtained according to the system time.

[0124] From the above, we can see that the different phases of the moon are related to the lunar phase angle. The lunar phase angle is the angle between the first ray and the second ray. The first ray is the ray that ends at the earth and extends to the moon, and the second ray is the ray that ends at the earth and extends to the sun. In other words, the lunar phase angle is the angle between the line connecting the moon and the earth and the sun directly hitting the earth. For example, see Figure 8 Therefore, electronic devices can also determine the moon phase state of the moon at the current system time through the moon phase angle.

[0125] In some embodiments, the electronic device can determine the first coordinate position of the earth relative to the sun and the second coordinate position of the moon relative to the sun based on the system time; determine the moon phase angle based on the first coordinate position and the second coordinate position; and determine the corresponding second moon phase state based on the moon phase angle.

[0126] As an example, the electronic device determines the angle range of the moon phase angle based on the moon phase angle, and determines the corresponding second moon phase state from the corresponding relationship between the angle range and the moon phase state.

[0127] Because both the Earth and the Moon move periodically, the coordinate positions of the Earth and Moon relative to the Sun can be determined based on the system time. Based on these coordinate positions, the corresponding lunar phase angle can be determined. For example, the correspondence between the angle range and the lunar phase state can be shown in Table 1 below. If the electronic device detects a lunar phase angle of 180 degrees, it can determine that the corresponding second lunar phase state is a full moon.

[0128] Table 1

[0129] Angle range Moon phase status [0,45) New Moon [45,90) Crescent Moon [90,135) First quarter moon [135,180) waxing gibbous moon [180,225) Full Moon [225,270) waning gibbous moon [270,315) waning moon [315,360) waning moon

[0130] It should be noted that the embodiments of the present application are merely illustrated by taking the correspondence between the angle ranges and the moon phases shown in Table 1 above as an example, and do not constitute a limitation to the embodiments of the present application.

[0131] In some embodiments, the electronic device may first determine whether to detect the second lunar phase based on the system time. The system time includes year, month, day, hour, minute, and second. If the hour, minute, and second in the system time indicates that the current time period is not within a preset time period, it is determined that there is no need to detect the second lunar phase, that is, it is determined that the moon is not currently present, the moon identified in the first preview image is a false detection, and the electronic device will not enter the full moon shooting mode. If the hour, minute, and second in the system time indicates that the current time period is within a preset time period, the second lunar phase of the moon is determined based on the year, month, and day in the system time of the electronic device.

[0132] It should be noted that the preset time period refers to the time period when the moon can be photographed in the sky, and the preset time period can change dynamically according to different dates. For example, the preset time period in winter is longer than the preset time period in summer.

[0133] Step 609: Determine whether the first moon phase state and the second moon phase state are the same. If so, execute the operation of step 610 below. If not, continue to capture images according to the adjusted zoom ratio without entering the moon-viewing shooting mode.

[0134] Since false detection may occur during the detection of the moon in the first preview image, for example, a lighting object such as a street lamp in the first preview image may be detected as the moon, to avoid false detection of the moon, the electronic device can compare the first moon phase state and the second moon phase state to determine whether the first moon phase state and the second moon phase state are the same. If the first moon phase state is different from the second moon phase state, it is likely that a false detection occurred in the first preview image, that is, there is no moon in the first preview image. Therefore, image acquisition can be performed according to the adjusted zoom ratio, and the full moon shooting mode will not be entered. If the first moon phase state and the second moon phase state are the same, it means that there is indeed a moon in the first preview image. Therefore, the electronic device can perform the operation of step 610 below.

[0135] That is, when the first and second moon phases are the same, the electronic device can enter the full moon shooting mode. In the full moon shooting mode, the electronic device can improve the clarity of the moon in the first preview image. This operation can refer to the operations of steps 610 and 611 below.

[0136] Step 610: Obtain a super-resolution model corresponding to the first lunar phase state or the second lunar phase state.

[0137] It should be noted that the super-resolution model can improve the resolution of the image and restore the detailed texture of the image. Therefore, electronic devices can obtain the super-resolution model.

[0138] Of course, in order to improve the efficiency of image processing and the quality of the processed image, different super-resolution models can be corresponding to different moon phase images. Therefore, the electronic device can obtain the super-resolution model corresponding to the first moon phase state or the second moon phase state.

[0139] Step 611: Process the first preview image using a super-resolution model to obtain a second preview image.

[0140] It should be noted that after the first preview image is processed by the super-resolution model, the resolution of the second preview image is greater than that of the first preview image.

[0141] In some embodiments, the super-resolution model can process the entire image of the first preview image to improve the overall resolution of the first preview image. Of course, the super-resolution model can also process the area where the moon is located in the first preview image to improve the resolution of the moon area in the first preview image.

[0142] For example, when the first lunar phase is a crescent, the electronic device can obtain a super-resolution model corresponding to the crescent image. The super-resolution model of the crescent image can be used to improve the resolution of the area where the moon is located in the crescent image, that is, to improve the resolution of the area where the moon is located in the first preview image. When the first lunar phase is a crescent, the electronic device can also obtain a super-resolution model corresponding to the crescent image.

[0143] In an embodiment of the present application, since the phase of the moon changes with time, by comparing the phase of the moon in the captured preview image with the phase of the moon in real life, it is possible to further determine whether there is a moon in the preview image, thereby improving the accuracy of image processing.

[0144] Next, to further understand the embodiments of the present application, a flowchart of another image processing method is shown in the embodiments of the present application. As an example and not a limitation, the method may include some or all of the following:

[0145] Step 901: During the process of capturing an image through a camera, if the zoom ratio of the camera is greater than or equal to a preset ratio threshold, moon detection is performed on the first preview image captured by the camera.

[0146] When a user uses a camera of an electronic device to capture an image, they may adjust the camera's zoom ratio. When the camera's zoom ratio is greater than or equal to a preset zoom ratio threshold, the electronic device may perform moon detection on a first preview image captured by the camera. For example, the first preview image may be a preview image captured by the camera after the camera's zoom ratio has been adjusted.

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

[0148] For example, when the electronic device switches to certain shooting modes, it automatically increases the zoom factor of the camera. For example, when the electronic device switches to the full moon shooting mode, in order to obtain a clear image of the moon, the electronic device may adjust the zoom factor of the camera to a second zoom factor that is greater than or equal to a preset zoom factor threshold.

[0149] In some embodiments, when the electronic device enters the moon-gazing shooting mode, a prompt message can be provided in the shooting interface to remind the user of the current shooting mode. The prompt message can be in the form of at least one of text, pattern, control, etc.

[0150] In some embodiments, the electronic device can detect the moon in the first preview image captured by the camera in a variety of ways. For example, a neural network model can be set in the electronic device, and the neural network model can perform object recognition. In this way, the electronic device can identify each object in the first preview image through the set neural network model, and detect whether the moon exists by identifying each object. Alternatively, the electronic device can have an AI (artificial intelligence) recognition function. In this way, the electronic device can identify each object in the first preview image through the AI ​​recognition function to detect whether the moon exists in the first preview image. The embodiments of the present application do not impose specific restrictions on this.

[0151] Step 902: When there is a moon in the first preview image, determine a first moon phase state of the moon in the first preview image.

[0152] In some embodiments, when there is a moon in the first preview image, the electronic device determines the first lunar phase state of the moon in the first preview image by: when there is a moon in the first preview image, inputting the first preview image into a lunar phase recognition model, which is used to identify the lunar phase state of the moon in the image; and performing lunar phase recognition on the moon in the first preview image through the lunar phase recognition model to obtain the first lunar phase state.

[0153] Alternatively, when the electronic device performs object recognition through a neural network model, the neural network model may also have a moon phase recognition function. In this way, when the electronic device recognizes the presence of a moon in the first preview image through the neural network model, it may continue to recognize the moon phase state of the moon in the first preview image through the neural network model to obtain the first moon phase state.

[0154] Alternatively, when the electronic device recognizes the moon in the first preview image using the AI ​​recognition function, the electronic device may also use the AI ​​recognition function to identify the moon phase. That is, when the electronic device recognizes the presence of the moon in the first preview image using the AI ​​recognition function, it continues to use the AI ​​recognition function to identify the moon phase state of the moon in the first preview image to obtain the first moon phase state.

[0155] In some embodiments, a user may rotate an electronic device while using it. After the electronic device is rotated, although the display orientation of the first preview image does not change, the display orientation of the imaged image will change after the first preview image is formed. The image used for moon phase recognition may be the imaged image of the first preview image. Therefore, after the electronic device is rotated, the moon phase recognition of the moon in the first preview image may be inaccurate. Therefore, if the moon is present in the first preview image, the electronic device can obtain the rotation angle of the electronic device; rotate the imaged image corresponding to the first preview image according to the rotation angle to obtain a third preview image, which is the imaged image when the first preview image is stored; and input the third preview image into the moon phase recognition model.

[0156] It is worth noting that by rotating the imaging image of the first preview image, the moon phase state in the first preview image can be accurately identified.

[0157] Step 903: Determine the second lunar phase state of the moon.

[0158] In some embodiments, in order to accurately determine whether there is a moon in the first preview image, the electronic device may further determine a second moon phase state, wherein the second moon phase state refers to the actual moon phase state at the current time.

[0159] In some embodiments, the electronic device may obtain the system time; and determine the second lunar phase state of the moon corresponding to the system time based on the system time.

[0160] It should be noted that the system time includes year, month, day, hour, minute, second, etc.

[0161] It is worth mentioning that the moon phase in real life can be accurately determined through the system time.

[0162] In some embodiments, the electronic device can pre-store the correspondence between the time range and the moon phase state. In this way, the electronic device can obtain the moon phase state corresponding to the time range of the system time from the correspondence between the time range and the moon phase state to obtain the second moon phase state.

[0163] It is worth noting that, through the pre-stored correspondence between the time range and the moon phase state, the electronic device can quickly determine the moon phase state of the moon under the current system time, thereby improving the efficiency of determining the second moon phase state.

[0164] In some embodiments, the electronic device may also determine the second lunar phase of the moon through other methods. For example, the electronic device may determine a first coordinate position of the Earth relative to the Sun and a second coordinate position of the Moon relative to the Sun based on the system time; determine the lunar phase angle based on the first coordinate position and the second coordinate position, where the lunar phase angle is the angle between a first ray and a second ray, where the first ray is a ray that ends at the Earth and extends to the Moon, and the second ray is a ray that ends at the Earth and extends to the Sun; and determine the corresponding second lunar phase based on the lunar phase angle.

[0165] It is worth noting that the second lunar phase state of the moon is determined by the lunar phase angle, thereby improving the accuracy of determining the second lunar phase state.

[0166] Step 904: When the first moon phase state and the second moon phase state are the same, update the first preview image to the second preview image.

[0167] It should be noted that the resolution of the second preview image is greater than that of the first preview image, or the exposure of the second preview image is less than that of the first preview image.

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

[0169] Because the moon's brightness is high when the electronic device's camera captures the first preview image, the moon region in the captured first preview image appears blurry. Typically, images with lower exposure and / or shorter exposure times tend to display brighter areas more clearly. Therefore, to obtain a clear moon image, the electronic device can reduce the exposure and / or exposure time of the first preview image to obtain a second preview image.

[0170] Because the moon is brighter in the first preview image than other objects, the moon's clarity in the second preview image is very high after reducing the exposure and / or exposure duration of the first preview image. However, other objects may be lost or blurred. Therefore, the electronic device can further reduce the exposure and / or exposure duration of the moon region in the first preview image to ensure clarity in the second preview image.

[0171] It should be noted that the moon area refers to the area where the moon is displayed in the first preview image.

[0172] In some embodiments, the electronic device can update the first preview image to the second preview image not only in the above-described manner but also in other manners. For example, the electronic device can obtain a super-resolution model corresponding to the first lunar phase state or the second lunar phase state, the super-resolution model being used to improve the image resolution; and process the first preview image using the super-resolution model to obtain the second preview image.

[0173] It is worth noting that the first preview image is processed by the super-resolution model corresponding to the current moon phase state, so as to improve the resolution of the image in a more targeted manner, which not only ensures the clarity of the moon in the image, but also ensures the clarity of other objects in the image.

[0174] In some embodiments, when the second preview image is displayed, if the electronic device receives a shooting operation, the electronic device exposes the second preview image in response to the shooting operation to obtain a target image, which is an imaged image of the second preview image.

[0175] If the user is satisfied with the currently captured image, the user can trigger a capture operation. This capture operation can be performed by the user clicking a capture control in photo mode or a record control in video mode. Thus, upon receiving the capture operation, the electronic device can expose the second preview image to obtain the target image.

[0176] As can be seen from the above, after the electronic device enters the moon-viewing shooting mode, it can also display the fifth preview image in the second preview image in a picture-in-picture manner. The fifth preview image can be acquired by other cameras of the electronic device. For example, the fifth preview image can be the above Figure 4 In this case, in order to obtain a clear image of the moon and clear images of other objects other than the moon, the electronic device can process the second preview image based on the fifth preview image in response to the shooting operation to obtain the target image.

[0177] It should be noted that, in the embodiment of the present application, the camera that captures the first preview image may be referred to as the first camera, and the camera that captures the fifth preview image may be referred to as the second camera.

[0178] As an example, the electronic device processes the second preview image based on the fifth preview image in response to a shooting operation to obtain a target image, including: determining target mapping parameters based on the exposure parameters of the fifth preview image in response to the shooting operation, and the target mapping parameters are used to adjust the exposure parameters of the second preview image; updating the exposure parameters of the second preview image according to the target mapping parameters; and fusing the fifth preview image with the updated third preview image to obtain the target image.

[0179] In some embodiments, the exposure parameters include an exposure value and an exposure duration. Thus, the electronic device determines the target mapping parameters in response to a shooting operation based on the exposure parameters of the fifth preview image, including: in response to the shooting operation, obtaining an S frame (also called a short frame) corresponding to the fifth preview image based on the exposure parameters of the fifth preview image, where the S frame is a preview image captured by the second camera before the fifth preview image is captured, and the exposure value of the S frame is less than the exposure value of the fifth preview image, and the exposure duration of the S frame is less than the exposure duration of the fifth preview image; fusing the S frame with the fifth preview image to obtain a sixth preview image; and determining the exposure parameters of the sixth preview image as the target exposure parameters.

[0180] It is worth noting that since the exposure of the S frame is less than that of the fifth preview image, after the S frame is fused with the fifth preview image to obtain the sixth preview image, the clarity of the moon area in the sixth preview image is improved, and at the same time, the clarity of other objects except the moon is not affected.

[0181] In some embodiments, the electronic device can not only obtain the S frame corresponding to the fifth preview image, but also obtain the L frame (also called long frame) corresponding to the fifth preview image, wherein the L frame is a preview image captured after the second camera captures the fifth preview image, the exposure value of the L frame is greater than the exposure value of the fifth preview image, and the exposure duration of the L frame is greater than the exposure duration of the fifth preview image; thereafter, the S frame, the fifth preview image and the L frame can be fused to obtain the seventh preview image; and the exposure parameters of the seventh preview image are determined as the target exposure parameters.

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

[0183] In some embodiments, when performing image fusion, the electronic device may fuse different images using a Laplacian pyramid algorithm, thereby achieving a smooth transition between edges of the fused image. That is, the electronic device may use the Laplacian pyramid algorithm to fuse the S frame with the fifth preview image, the electronic device may use the Laplacian pyramid algorithm to fuse the S frame, the L frame, and the fifth preview image, and the electronic device may use the Laplacian pyramid algorithm to fuse the second preview image with the updated second preview image. Of course, the electronic device may also use other fusion algorithms to achieve image fusion, and this embodiment of the present application does not impose specific limitations on this.

[0184] In the embodiment of the present application, since the exposure of the second preview image is lower than that of the first preview image, a clear image of the moon can be obtained in the second preview image; and since the clarity of objects other than the moon in the fifth preview image is higher than the clarity of objects other than the moon in the second preview image, the target image obtained by processing the second preview image using the fifth preview image is an image with higher clarity including the moon and other objects, thereby improving the imaging clarity of other background objects in the same viewfinder as the moon and improving the image shooting effect.

[0185] In an embodiment of the present application, since the phase of the moon changes with time, by comparing the phase of the moon in the captured preview image with the phase of the moon in real life, it is possible to further determine whether there is a moon in the preview image, thereby improving the accuracy of image processing.

[0186] The embodiment of the present application provides an image processing device, which can be implemented as part or all of an electronic device by software, hardware, or a combination of both. The electronic device can be Figure 1 The electronic device shown in the figure includes: a detection module, a determination module and an update module.

[0187] a detection module configured to perform moon detection on a first preview image captured by the camera if a zoom ratio of the camera is greater than or equal to a preset ratio threshold during image capture by the camera;

[0188] a determination module, configured to determine a first lunar phase state of the moon in the first preview image when the moon exists in the first preview image;

[0189] An update module is used to update the first preview image to a second preview image when the first lunar phase state and the second lunar phase state are the same, wherein the exposure of the second preview image is less than the exposure of the first preview image, and the second lunar phase state is the lunar phase state corresponding to the system time of the electronic device.

[0190] In an embodiment of the present application, since the phase of the moon changes with time, by comparing the phase of the moon in the captured preview image with the phase of the moon in real life, it is possible to further determine whether there is a moon in the preview image, thereby improving the accuracy of image processing.

[0191] It should be noted that: when the image processing device provided in the above embodiment performs image processing, the division of the above-mentioned functional modules is only used as an example to illustrate. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0192] The functional units and modules in the above embodiments may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The above integrated units may be implemented in the form of hardware or software functional units. In addition, the specific names of the functional units and modules are only for the purpose of distinguishing them from each other and are not intended to limit the scope of protection of the embodiments of this application.

[0193] The image processing device and the image processing method provided in the above embodiments belong to the same concept. The specific working process of the units and modules in the above embodiments and the technical effects brought about can be found in the method embodiment part and will not be repeated here.

[0194] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of 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, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (such as a coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

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

Claims

1. A method for processing an image, characterized in that: Applied to electronic equipment, the method includes: In the process of capturing an image through a camera, if the zoom ratio of the camera is greater than or equal to a preset ratio threshold, performing moon detection on a first preview image captured by the camera; When the moon exists in the first preview image, determining a first lunar phase state of the moon in the first preview image; When the first moon phase state and the second moon phase state are the same, the first preview image is updated to a second preview image, the exposure of the second preview image is less than the exposure of the first preview image, and the second moon phase state is the moon phase state corresponding to the system time of the electronic device.

2. The method according to claim 1, wherein The step of determining a first lunar phase state of the moon in the first preview image when the moon exists in the first preview image includes: In a case where the moon exists in the first preview image, inputting the first preview image into a moon phase recognition model, wherein the moon phase recognition model is used to recognize the moon phase state in the image; The moon phase recognition model is used to recognize the moon in the first preview image to obtain the first moon phase state.

3. The method according to claim 2, wherein In a case where the moon exists in the first preview image, inputting the first preview image into a moon phase recognition model includes: When the moon exists in the first preview image, obtaining a rotation angle of the electronic device; Rotating the image corresponding to the first preview image according to the rotation angle to obtain a third preview image, where the image is the image generated when the first preview image is stored; The third preview image is input into the moon phase recognition model.

4. The method according to claim 1, wherein Before updating the first preview image to the second preview image when the first moon phase state and the second moon phase state are the same, the method further includes: Obtaining the system time of the electronic device; According to the system time, a second lunar phase state of the moon corresponding to the system time is determined.

5. The method according to claim 4, wherein Determining, based on the system time, the second lunar phase state of the moon corresponding to the system time includes: From the correspondence between the time range and the moon phase state, the moon phase state corresponding to the time range where the system time is located is obtained to obtain the second moon phase state.

6. The method according to claim 4, wherein Determining, based on the system time, the second lunar phase state of the moon corresponding to the system time includes: Determining a first coordinate position of the Earth relative to the Sun and a second coordinate position of the Moon relative to the Sun based on the system time; Determine a moon phase angle based on the first coordinate position and the second coordinate position, where the moon phase angle is the angle between a first ray and a second ray, where the first ray is a ray that ends at the earth and extends toward the moon, and the second ray is a ray that ends at the earth and extends toward the sun; The corresponding second moon phase state is determined according to the moon phase angle.

7. The method according to claim 1, wherein The updating of the first preview image to the second preview image when the first moon phase state and the second moon phase state are the same includes: Obtaining a super-resolution model corresponding to the first lunar phase state or the second lunar phase state, wherein the super-resolution model is used to improve the resolution of the image; The first preview image is processed by the super-resolution model to obtain the second preview image.

8. The method according to claim 1, wherein The updating of the first preview image to the second preview image when the first moon phase state and the second moon phase state are the same includes: When the first moon phase state and the second moon phase state are the same, the exposure degree and / or exposure duration of the first preview image is reduced to obtain the second preview image.

9. An electronic device, characterized in that: The structure of the electronic device includes a processor and a memory; The memory is used to store a program that supports the electronic device to execute the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Moon recognition method and electronic equipment

    CN110807411A

  • Space telescope point source stray light determination method, optical equipment and medium

    CN115753017A

  • Method for shooting moon and electronic equipment

    CN117956299A

  • Shooting control method and device, computer readable storage medium and electronic equipment

    CN118283405A

  • Method for obtaining image of the moon, electronic device and storage medium

    US20220046174A1