Moon detection method, terminal equipment and storage medium
By integrating gravity sensors and combining brightness information in the terminal device, determining whether to perform moon detection is performed, the problem of misjudgment in the prior art moon detection is solved, and the accuracy and user experience of the detection are improved.
Patent Information
- Application Number
- CN202411998443.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
AI Technical Summary
Existing moon detection methods are prone to misjudgment and affect user experience. Especially in scenes such as street lights and false moonlights, carpets, human hair, etc. are easily identified as moons.
By integrating gravity sensors in the terminal device, determining the equipment attitude information, and combining the preset shooting mode and the brightness information of the display screen, it is determined whether to perform moon detection to avoid detection in scenes where the non-upward shooting posture and brightness are inconsistent.
It effectively avoids the false detection of the moon detection algorithm, reduces the false detection cases of the moon, improves the accuracy of the moon detection, and improves the user experience.
Smart Images

Figure CN119854624A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a moon detection method, terminal equipment and storage medium. Background Art
[0002] At present, the photography technology for the moon mainly includes early moon detection and later photography enhancement, and the photography enhancement depends on the output of the moon detection algorithm. The moon detection algorithm is usually constructed with parameters obtained from the AI algorithm training data set and integrated into related hardware to complete the corresponding moon detection function.
[0003] However, since the input images of the moon detection algorithm are often overexposed, it is difficult to identify the circle and its overexposed area information. Therefore, there are a lot of false detections in the results obtained by the moon detection algorithm alone. For example, it is easy to make misjudgments in scenes such as street lights and fake moon lights, and even carpets and human hair may be identified as the moon. In addition, most moon enhancement algorithms will significantly modify the exposure of the picture after detection and recognition, greatly reducing the exposure. Therefore, once a false detection occurs in a non-moon scene, it will interfere with the user's normal use of the camera and affect the user experience. Summary of the invention
[0004] In order to overcome the above-mentioned defects, the present application is proposed to provide a moon detection method, terminal device and storage medium that solve or at least partially solve the technical problem that the existing moon detection method is prone to misjudgment and affects the user experience.
[0005] In a first aspect, a moon detection method is provided, which is applied to a terminal device, wherein the terminal device includes a display screen, and the method includes:
[0006] In response to the user's operation of opening a shooting interface, acquiring posture information of the terminal device; the shooting interface is displayed on the display screen of the terminal device, and the posture information includes an upward shooting posture and a non-upward shooting posture;
[0007] When the posture information is the upward shooting posture, obtaining the shooting mode preset by the terminal device and the brightness information of the display screen; the shooting mode includes a normal mode and a moon mode;
[0008] When the shooting mode is the moon mode and the brightness information is greater than a first brightness threshold, moon detection is performed on the shooting interface.
[0009] In a technical solution of the above-mentioned moon detection method, the method further includes:
[0010] Acquire the result of the moon detection; the result of the moon detection includes whether the moon exists in the shooting interface and whether the moon does not exist in the shooting interface;
[0011] When the result of the moon detection is that there is a moon on the shooting interface, the brightness of the shooting interface is reduced.
[0012] In a technical solution of the above-mentioned moon detection method, the method further includes:
[0013] When the result of the moon detection is that there is a moon on the shooting interface, in response to a shooting operation of the user, acquiring a shot moon image;
[0014] Perform image enhancement processing on the moon image.
[0015] In a technical solution of the above-mentioned moon detection method, the terminal device includes a gravity sensor; and obtaining the posture information of the terminal device includes:
[0016] Acquiring gravity sensing data of the terminal device based on the gravity sensor; wherein the gravity sensing data at least includes a gravity tilt value in a thickness direction in an orthogonal coordinate system of the terminal device, and the thickness direction is perpendicular to the display screen;
[0017] Obtaining an average tilt value based on the gravity tilt values in the thickness direction obtained multiple times;
[0018] When the average tilt value is less than a preset tilt value threshold, the posture information is determined to be the upward shooting posture; otherwise, the posture information is determined to be the non-upward shooting posture.
[0019] In a technical solution of the above-mentioned moon detection method, the method further includes:
[0020] Determine whether the result of the previous moon detection of the shooting interface is obtained;
[0021] If the result of the previous moon detection is obtained, and the result of the previous moon detection is that there is a moon in the shooting interface, then the shooting mode is determined to be the moon mode.
[0022] In a technical solution of the moon detection method, if the result of the previous moon detection is obtained, and the result of the previous moon detection is that there is no moon in the shooting interface, then determining that the shooting mode is the normal mode;
[0023] Or, if the result of the previous moon detection is not obtained, the shooting mode is determined to be the normal mode.
[0024] In a technical solution of the above-mentioned moon detection method, the method further includes:
[0025] When the shooting mode is the normal mode and the brightness information is greater than a second brightness threshold, performing moon detection on the shooting interface;
[0026] The second brightness threshold is greater than the first brightness threshold.
[0027] In a technical solution of the above-mentioned moon detection method, the method further includes:
[0028] When the shooting mode is the normal mode and the brightness information is less than or equal to the second brightness threshold, moon detection is not performed on the shooting interface.
[0029] In a technical solution of the above-mentioned moon detection method, the method further includes:
[0030] When the shooting mode is the moon mode and the brightness information is less than or equal to the first brightness threshold, acquiring the brightness information multiple times at a preset time interval;
[0031] When the brightness information obtained multiple times is less than or equal to the first brightness threshold, moon detection is not performed on the shooting interface.
[0032] In a technical solution of the above-mentioned moon detection method, the method further includes:
[0033] When the posture information is the non-upward shooting posture, the moon detection is not performed on the shooting interface.
[0034] In a second aspect, a terminal device is provided, which includes a processor, a memory, a display screen and a gravity sensor, wherein the memory is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute the moon detection method described in any one of the technical solutions of the above-mentioned moon detection method.
[0035] In a third aspect, a computer-readable storage medium is provided, in which a plurality of program codes are stored, wherein the program codes are suitable for being loaded and run by a processor to execute the moon detection method described in any one of the technical solutions of the above-mentioned moon detection method.
[0036] Solution 1. A moon detection method, applied to a terminal device, characterized in that the terminal device includes a display screen, and the method includes:
[0037] In response to the user's operation of opening a shooting interface, acquiring posture information of the terminal device; the shooting interface is displayed on the display screen of the terminal device, and the posture information includes an upward shooting posture and a non-upward shooting posture;
[0038] When the posture information is the upward shooting posture, obtaining the shooting mode preset by the terminal device and the brightness information of the display screen; the shooting mode includes a normal mode and a moon mode;
[0039] When the shooting mode is the moon mode and the brightness information is greater than a first brightness threshold, moon detection is performed on the shooting interface.
[0040] Solution 2. The moon detection method according to Solution 1, characterized in that the method further comprises:
[0041] Acquire the result of the moon detection; the result of the moon detection includes whether the moon exists in the shooting interface and whether the moon does not exist in the shooting interface;
[0042] When the result of the moon detection is that there is a moon on the shooting interface, the brightness of the shooting interface is reduced.
[0043] Solution 3. The moon detection method according to Solution 2, characterized in that the method further comprises:
[0044] When the result of the moon detection is that there is a moon on the shooting interface, in response to a shooting operation of the user, acquiring a shot moon image;
[0045] Perform image enhancement processing on the moon image.
[0046] Solution 4. The moon detection method according to Solution 1 is characterized in that the terminal device includes a gravity sensor; and obtaining the posture information of the terminal device includes:
[0047] Acquiring gravity sensing data of the terminal device based on the gravity sensor; wherein the gravity sensing data at least includes a gravity tilt value in a thickness direction in an orthogonal coordinate system of the terminal device, and the thickness direction is perpendicular to the display screen;
[0048] Obtaining an average tilt value based on the gravity tilt values in the thickness direction obtained multiple times;
[0049] When the average tilt value is less than a preset tilt value threshold, the posture information is determined to be the upward shooting posture; otherwise, the posture information is determined to be the non-upward shooting posture.
[0050] Solution 5. The moon detection method according to Solution 2, characterized in that the method further comprises:
[0051] Determine whether the result of the previous moon detection of the shooting interface is obtained;
[0052] If the result of the previous moon detection is obtained, and the result of the previous moon detection is that there is a moon in the shooting interface, then the shooting mode is determined to be the moon mode.
[0053] Solution 6. The moon detection method according to Solution 5, characterized in that the method further comprises:
[0054] If the result of the previous moon detection is obtained, and the result of the previous moon detection is that there is no moon in the shooting interface, determining that the shooting mode is the normal mode;
[0055] Or, if the result of the previous moon detection is not obtained, the shooting mode is determined to be the normal mode.
[0056] Solution 7. The moon detection method according to Solution 1, characterized in that the method further comprises:
[0057] When the shooting mode is the normal mode and the brightness information is greater than a second brightness threshold, performing moon detection on the shooting interface;
[0058] The second brightness threshold is greater than the first brightness threshold.
[0059] Solution 8. The moon detection method according to Solution 7, characterized in that the method further comprises:
[0060] When the shooting mode is the normal mode and the brightness information is less than or equal to the second brightness threshold, moon detection is not performed on the shooting interface.
[0061] Solution 9. The moon detection method according to Solution 1, characterized in that the method further comprises:
[0062] When the shooting mode is the moon mode and the brightness information is less than or equal to the first brightness threshold, acquiring the brightness information multiple times at a preset time interval;
[0063] When the brightness information obtained multiple times is less than or equal to the first brightness threshold, moon detection is not performed on the shooting interface.
[0064] Solution 10. The moon detection method according to Solution 1, characterized in that the method further comprises:
[0065] When the posture information is the non-upward shooting posture, the moon detection is not performed on the shooting interface.
[0066] Scheme 11. A terminal device comprises a processor, a memory, a display screen and a gravity sensor, wherein the memory is suitable for storing multiple program codes, and is characterized in that the program codes are suitable for being loaded and run by the processor to execute the moon detection method described in any one of Schemes 1 to 10.
[0067] Scheme 12. A computer-readable storage medium storing a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the moon detection method described in any one of Schemes 1 to 10.
[0068] The above one or more technical solutions of this application have at least one or more of the following Beneficial effects:
[0069] In the technical solution of implementing the present application, when the user takes a photo, the posture information of the terminal device is first determined by the gravity accelerometer, and on the premise that the terminal device is in an upward shooting posture, whether to perform moon detection on the shooting interface is determined according to the shooting mode preset by the terminal device and the brightness information of the display screen, thereby avoiding moon detection for all scenes that are not in an upward shooting posture and whose brightness does not meet the requirements for moon shooting, avoiding a large number of false detections that exist in the detection results obtained only by the moon detection algorithm, greatly reducing the cases of false moon detection, improving the accuracy of moon detection, and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The disclosure of the present application will become easier to understand with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present application. Among them:
[0071] Figure 1 is a schematic diagram of an orthogonal coordinate system of a terminal device according to an embodiment of the present application;
[0072] Figure 2 is a flowchart of the main steps of a moon detection method according to an embodiment of the present application;
[0073] Figure 3 is a schematic diagram of a terminal device in various vertical shooting postures according to an embodiment of the present application;
[0074] Figure 4 is a schematic diagram of a terminal device in various horizontal shooting postures according to an embodiment of the present application;
[0075] Figure 5 is a flowchart of main steps of a moon detection method according to another embodiment of the present application;
[0076] Figure 6It is a schematic diagram of the main structure of a terminal device according to an embodiment of the present application.
[0077] List of reference numerals:
[0078] 601: processor; 602: memory; 603: display screen; 604: gravity sensor. DETAILED DESCRIPTION
[0079] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.
[0080] In the description of the present application, the term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one of A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include only A, only B, or A and B. The singular terms "a", "the" and "the" may also include plural forms.
[0081] The photography technology for the moon mainly includes early moon detection and later photography enhancement, and the photography enhancement depends on the output of the moon detection algorithm. The moon detection algorithm is usually constructed with parameters obtained from the AI algorithm training data set and integrated into related hardware to complete the corresponding moon detection function.
[0082] However, since the input images of the moon detection algorithm are often overexposed, it is difficult to identify the circle and its overexposed area information. Therefore, there are a lot of false detections in the results obtained by the moon detection algorithm alone. For example, it is easy to make misjudgments in scenes such as street lights and fake moon lights, and even carpets and human hair may be identified as the moon. In addition, most moon enhancement algorithms will significantly modify the exposure of the picture after detection and recognition, greatly reducing the exposure. Therefore, once a false detection occurs in a non-moon scene, it will interfere with the user's normal use of the camera and affect the user experience.
[0083] In order to solve the above problems, the present application provides a moon detection method, terminal device and storage medium.
[0084] The moon detection method is applied to terminal devices, such as mobile phones, tablet computers, personal computers (PCs), personal digital assistants (PDAs), netbooks, wearable terminal devices and other devices equipped with cameras and display screens.
[0085] Furthermore, in order to accurately describe the posture, movement and direction of various sensor data of the terminal device in three-dimensional space, an orthogonal coordinate system of the terminal device can be established. The orthogonal coordinate system of the terminal device is a relative coordinate system that uses the terminal device itself as a reference system to describe the direction and changes of various physical quantities sensed by the sensor.
[0086] See attached Figure 1 , Figure 1 is a schematic diagram of an orthogonal coordinate system of a terminal device according to an embodiment of the present application. Figure 1 As shown, Figure 1 The plane where the terminal device display screen is located shown on the left is used as a reference. In the orthogonal coordinate system of the terminal device, the x-axis is parallel to the direction from left to right of the terminal device, and the right direction is the positive direction; the y-axis is parallel to the direction from bottom to top of the terminal device, and the upward direction is the positive direction; the z-axis is perpendicular to the plane where the terminal device display screen is located, that is, parallel to the thickness direction of the terminal device, and the positive direction is outward from the display screen.
[0087] For further information, see Appendix Figure 2 , Figure 2 FIG. 1 is a flow chart of the main steps of a moon detection method according to an embodiment of the present application. Figure 2 As shown, the moon detection method in the embodiment of the present application mainly includes the following steps S201 to S203.
[0088] Step S201: in response to the user's operation of opening the shooting interface, obtaining the posture information of the terminal device;
[0089] Among them, the shooting interface is displayed on the display screen of the terminal device. Specifically, there is an event monitoring mechanism in the operating system of the terminal device. When the user opens the shooting interface to prepare to take a photo, the operating system of the terminal device will detect this operation. For example, when the user clicks the camera application icon on the display screen of the terminal device or uses a shortcut (such as sliding to open the camera on the lock screen interface) to open the camera, the underlying code of the operating system will receive this instruction and recognize it as "opening the shooting interface operation."
[0090] Furthermore, the terminal device may include a gravity sensor, such as a gravity accelerometer, an acceleration sensor, and a gyroscope sensor in a non-camera sensor (NCS) of the terminal device. When the user performs an operation to open the shooting interface on the terminal device, the system will start the corresponding process and send a request to the gravity sensor of the terminal device through the system interface to obtain the posture information of the terminal device at this time.
[0091] The posture information of the terminal device may include an upward shooting posture and a non-upward shooting posture. The upward shooting posture refers to the shooting angle of the rear camera of the terminal device facing the sky or other higher positions, such as the posture of tilting the device upward when we usually take pictures of the moon; and the non-upward shooting posture covers various other angles, such as horizontal shooting, overhead shooting, etc.
[0092] Taking the gravity accelerometer as an example, the posture information of the terminal device can be obtained through the following steps S2011 to S2013.
[0093] Step S2011: Acquire gravity sensing data of the terminal device based on the gravity sensor;
[0094] The gravity sensing data at least includes the gravity tilt value in the thickness direction in the orthogonal coordinate system of the terminal device, and the thickness direction is perpendicular to the display screen, that is, Figure 1 The z-axis is shown.
[0095] Generally, gravity sensing data includes gravity tilt values in three different directions (i.e., x-axis, y-axis, and z-axis) of the orthogonal coordinate system of the terminal device detected by the gravity accelerometer. When the terminal device is in an upward shooting posture, the gravity tilt value in the z-axis direction will have certain characteristics.
[0096] Take the gravity accelerometer of Qualcomm Snapdragon 8650 platform to detect the gravity sensing data of terminal equipment as an example, see the attached Figure 3 and Figure 4 , Figure 3 is a schematic diagram of a terminal device in various vertical shooting postures according to an embodiment of the present application; Figure 4 It is a schematic diagram of a terminal device in various horizontal shooting postures according to an embodiment of the present application.
[0097] like Figure 3 As shown, the shooting postures from left to right are, when the terminal device is placed vertically with the display screen facing forward, and then flipped downward along the lower edge, the corresponding display screen forward posture 1, display screen downward posture 2, display screen backward posture 3 and display screen upward posture 4.
[0098] Further, Figure 3 The gravity sensing data corresponding to the terminal device shown (including the gravity tilt values in the x-axis, y-axis and z-axis directions) are shown in Table 1 below.
[0099] Table 1
[0100] like Figure 4As shown, the shooting postures from left to right are, when the terminal device is placed horizontally with the display screen facing forward, the display screen is flipped downward along the lower edge, corresponding to the display screen forward posture 5, the display screen downward posture 6, the display screen backward posture 7 and the display screen upward posture 8.
[0101] Further, Figure 4 The gravity sensing data corresponding to the terminal device shown (including the gravity tilt values in the x-axis, y-axis and z-axis directions) are shown in Table 2 below.
[0102] Table 2
[0103] From Table 1 and Table 2 above, it can be seen that when the terminal device is Figure 3 The display down posture 2 and Figure 4 When the display screen is in downward posture 6, that is, upward shooting posture, the gravity tilt value of the terminal device in the z-axis direction is a negative value. Therefore, the posture information of the terminal device can be determined by the gravity tilt value.
[0104] Step S2012: obtaining an average tilt value based on the gravity tilt values in the thickness direction obtained multiple times;
[0105] When a user is using a terminal device, a single detected gravity tilt value may be inaccurate due to slight shaking of the user or other short-term interference factors. Therefore, the posture information of the terminal device can be determined by averaging multiple detected gravity tilt values, thereby reducing the influence of accidental factors to a certain extent and obtaining a value that better reflects the true posture information of the terminal device.
[0106] Specifically, the gravity sensor continuously obtains the gravity tilt value of the terminal device in the z-axis direction at a certain frequency or time interval, and the average tilt value of the terminal device in the z-axis can be obtained by obtaining the z-axis gravity tilt values multiple times (such as 3 times).
[0107] Step S2013: When the average tilt value is less than the preset tilt value threshold, the posture information is determined to be an upward shooting posture; otherwise, the posture information is determined to be a non-upward shooting posture.
[0108] It can be seen from Table 1 and Table 2 above that when the terminal device is in an upward shooting posture, the gravity tilt value of the terminal device in the z-axis direction is a negative value, so the preset tilt value threshold can be set to 0. Further, when the calculated average tilt value is less than the preset tilt value threshold, it can be determined that the terminal device is in an upward shooting posture. On the contrary, if the average tilt value is greater than or equal to the preset tilt value threshold, it can be determined that the terminal device is in a non-upward shooting posture, such as a horizontal position, a downward shooting posture, etc.
[0109] Through the above implementation, the posture information of the terminal device can be determined according to the gravity sensor data.
[0110] In addition, the posture information of the terminal device can also be obtained through acceleration sensors, gyroscope sensors, etc.
[0111] The acceleration sensor can measure the acceleration data of the terminal device in the x-axis, y-axis, and z-axis directions, so as to judge whether the terminal device is in an upward shooting state by combining the characteristics of the acceleration data in the three axes. For example, when the terminal device is placed still for upward shooting, the acceleration value of the z-axis is close to -9.8m / s 2 At the same time, the acceleration values of the x-axis and y-axis are close to 0. However, if the terminal device moves or shakes in other directions while shooting upward, the acceleration sensor can also capture the corresponding acceleration change information, thereby determining the posture information of the terminal device.
[0112] The gyroscope sensor can detect the rotation angle data of the terminal device around the x-axis, x-axis, and y-axis. When the terminal device changes from a normal posture to an upward shooting posture, a specific angular velocity change will occur. By monitoring and analyzing these angular velocity data, it can be determined whether the terminal device is in an upward shooting posture. In addition, during dynamic shooting, such as when the user moves while shooting upward, the gyroscope sensor can also provide the terminal device's posture information in real time, accurately judging and tracking the terminal device's posture.
[0113] It should be pointed out that the above examples of obtaining the posture information of the terminal device are only schematic illustrations. In actual applications, those skilled in the art can obtain the posture information of the terminal device according to specific scenarios, which is not limited here.
[0114] Further, when the posture information of the terminal device is an upward shooting posture, step S202 can be executed; when the posture information of the terminal device is a non-upward shooting posture, the moon detection is not performed on the shooting interface.
[0115] Specifically, when the terminal device is in a non-upward shooting posture, such as when the gravity tilt value of the terminal device on the z-axis is 0.9, it means that the camera of the terminal device is not facing the sky or other upward positions, but is in a horizontal shooting, downward shooting or other postures that do not conform to the conventional angles for shooting the moon. In this case, in order to save the computing resources of the terminal device and avoid unnecessary false detections, the moon detection algorithm for the shooting interface is not started to determine whether there is a moon in the picture.
[0116] The above is a further description of step S201.
[0117] Step S202: when the posture information is an upward shooting posture, obtaining the shooting mode preset by the terminal device and the brightness information of the display screen;
[0118] In some embodiments of step S202, when the posture information of the terminal device is an upward shooting posture, the shooting mode preset by the terminal device and the brightness information of the display screen can be obtained, and it can be determined whether to perform moon detection on the shooting interface based on the shooting mode preset by the terminal device and the brightness information of the display screen.
[0119] The shooting mode is usually one or more sets of shooting parameters preset in the terminal device so that the user can achieve the corresponding shooting purpose. As an example, the shooting mode may include a normal mode and a moon mode.
[0120] Normal mode is the basic shooting mode of the camera application, which is suitable for shooting a variety of daily scenes, such as people, scenery, architecture, animals, etc. Normal mode provides relatively general shooting parameter settings and can meet most ordinary shooting needs.
[0121] Moon mode is a shooting mode specially designed for photographing the moon. Due to the high brightness and long distance of the moon, the regular mode may not be able to capture the details and beauty of the moon well. Moon mode has specially optimized the shooting parameters based on these characteristics. Specifically, Moon mode usually adjusts the exposure, focus, zoom and other parameters to highlight the details of the moon and minimize the interference of the surrounding environment, thereby increasing the success rate of photographing the moon and making it easier for users to capture clear, bright and detailed images of the moon.
[0122] In addition, some terminal devices do not have a moon mode in the preset shooting modes of the camera, but have similar night scene modes and scene recognition functions.
[0123] The night scene mode of some terminal devices will automatically adjust parameters to highlight the subject when it detects a darker environment and a brighter subject. When the camera is pointed at the moon, the night scene mode may automatically optimize the exposure, focus and other parameters to make the moon appear more clearly.
[0124] Some terminal devices also have scene recognition functions, which can automatically identify whether the current shooting scene is the moon. When the moon as a specific object is identified, the detail enhancement engine is applied to the shooting, and the parameters are automatically adjusted to optimize the shooting effect of the moon, such as controlling the brightness of the display screen, adjusting the focus, etc., so that users can capture bright and clear images of the moon.
[0125] Further, in some implementations of step S202, the shooting mode of the terminal device may be determined by following steps S2021 to S2024.
[0126] Step S2021: Determine whether the result of the previous moon detection of the shooting interface is obtained;
[0127] When the terminal device is shooting, the system can check whether there are any relevant results obtained from the previous moon detection on the shooting interface. The previous moon detection here may be the process of the device detecting whether there is a moon in the picture during the last shooting operation or the previous moment. This detection result is usually obtained after running a specific moon detection algorithm inside the device, which reflects whether there is a moon in the shooting interface at that time. For example, the terminal device may have started a moon detection process a few seconds ago, so it can be determined whether the results of the previous moon detection have been saved.
[0128] The result of the moon detection includes whether the moon exists or not on the shooting interface of the terminal device display screen.
[0129] Step S2022: If the result of the previous moon detection is obtained, and the result of the previous moon detection is that there is a moon in the shooting interface, then the shooting mode is determined to be the moon mode.
[0130] Since the result of the previous moon detection indicates that there was a moon in the shooting interface at that time, based on this judgment, the terminal device will adopt the moon mode for shooting after the previous detection, so it can be determined that the shooting mode of the terminal device is the moon mode.
[0131] Step S2023: If the result of the previous moon detection is obtained, and the result of the previous moon detection is that there is no moon in the shooting interface, then the shooting mode is determined to be the normal mode.
[0132] Since the result of the previous moon detection indicates that there is no moon in the shooting interface at that time, based on this judgment, the terminal device will continue to use the normal mode for shooting after the previous detection is completed.
[0133] Step S2024: If the result of the previous moon detection is not obtained, the shooting mode is determined to be the normal mode.
[0134] If the terminal device has not obtained the result of the previous moon detection, that is, there is no relevant judgment information about whether there is a moon in the shooting interface, the terminal device will continue to shoot in normal mode.
[0135] The above is a further explanation of obtaining the shooting mode of the terminal device.
[0136] In some implementations, the brightness information of the display screen may also be obtained, such as parameters such as Lux index, nit, and Candela.
[0137] Among them, Lux index is a measure of illuminance, which is used to indicate the luminous flux of visible light received per unit area, and its unit is lux; nit is a commonly used unit to measure screen brightness, which indicates the intensity of light per unit area; Candela is the basic unit of luminous intensity in the International System of Units.
[0138] The brightness information of the display screen can reflect the current lighting conditions and the exposure settings of the terminal device to a certain extent. Different brightness conditions will affect whether it is suitable for moon detection and the effect of subsequent moon photography.
[0139] Specifically, the brightness information of the display screen can be obtained through a light sensor. Some terminal devices are equipped with a light sensor that can measure the light intensity of the surrounding environment and then determine the brightness information of the display screen. The brightness information of the display screen can also be calculated through an exposure algorithm, where the exposure is related to the luminous flux, exposure time, and aperture area. By measuring the relevant exposure parameters, the luminous flux can be calculated to obtain the brightness information of the display screen. In addition, the brightness information of the display screen can also be obtained through a brightness meter, color analyzer, etc., which is not limited here.
[0140] The above is a further description of step S202.
[0141] Step S203: When the shooting mode is the moon mode and the brightness information is greater than the first brightness threshold, perform moon detection on the shooting interface.
[0142] The brightness threshold used for comparison with the brightness information includes a first brightness threshold and a second brightness threshold. The first brightness threshold is used as a criterion for further judgment in the case of moon mode (the result of the previous moon detection is that the moon is detected); the second brightness threshold is used as a criterion for further judgment in the case of normal mode (the result of the previous moon detection is not obtained, or the result of the previous moon detection is that the moon is not detected).
[0143] Moreover, the first brightness threshold is smaller than the second brightness threshold, for example, the first brightness threshold is 330 and the second brightness threshold is 430. Because in the moon mode, the camera will lower the exposure, making the current brightness information, such as the lux index, smaller, a relatively smaller first brightness threshold is needed to adapt to the situation after the exposure is reduced, so as to make a more accurate subsequent judgment.
[0144] Specifically, when the terminal device is in an upward shooting posture, the shooting mode is the moon mode and the brightness information is greater than the first brightness threshold, the moon detection is performed on the shooting interface.
[0145] For example, when the gravity tilt value of the terminal device on the z-axis is -9.8, the shooting mode is the moon mode and the lux index is 350, the moon detection can be performed on the shooting interface based on the moon detection algorithm.
[0146] Among them, the moon detection algorithm usually uses image recognition, image processing and other related technologies to analyze the content in the shooting interface and determine whether there is a moon in the picture. For example, by analyzing the shape, brightness distribution, contrast and other features of the object in the image, objects with moon characteristics (such as round, high brightness, relative isolation, etc.) are identified, thereby determining whether there is really a moon in the shooting interface.
[0147] Furthermore, when the shooting mode is the moon mode and the brightness information is less than or equal to the first brightness threshold, the brightness information can be obtained multiple times at a preset time interval; when the brightness information obtained multiple times is less than or equal to the first brightness threshold, moon detection is not performed on the shooting interface.
[0148] When the terminal device is in an upward shooting posture and the shooting mode is the moon mode, if the brightness information is less than or equal to the first brightness threshold, it means that the lighting conditions are not ideal and do not meet the basic requirements for normal moon detection and subsequent moon shooting.
[0149] However, at this time, the terminal device will not stop the relevant operations immediately, but will continue to obtain brightness information at preset time intervals, track the dynamic changes in brightness in real time, and wait for suitable lighting conditions to appear, because the lighting conditions are easily affected by factors such as cloud movement and changes in surrounding light sources.
[0150] Therefore, only when the brightness information obtained for multiple consecutive times (such as 5 times) is less than or equal to the first brightness threshold, can it be relatively determined that the current light is poor. In this case, in order to avoid the high probability of false detection due to insufficient light and the unsatisfactory subsequent shooting effect even if the moon is detected, the moon detection is not performed on the shooting interface, which can save computing resources and ensure that the entire shooting process is more reasonable and efficient.
[0151] For example, when the gravity tilt value of the terminal device on the z-axis is -9.3, the shooting mode is the moon mode, and the lux index obtained for five consecutive times is less than 330, the moon detection is not performed on the shooting interface.
[0152] By making comprehensive judgments on multiple key factors such as the terminal device's posture information, shooting mode, and brightness information, the moon detection algorithm can be used in a targeted manner to detect the moon in appropriate scenarios, thereby improving the accuracy of moon detection, thereby improving the accuracy and practicality of moon-shooting related functions, and providing convenience and protection for users to take images of the moon.
[0153] Further, in some implementations of step S203, when the shooting mode is the normal mode and the brightness information is greater than the second brightness threshold, the moon detection can be performed on the shooting interface.
[0154] Specifically, when the terminal device is in an upward shooting posture and the shooting mode is a normal mode, although the normal mode is not a mode specifically for shooting the moon, the moon detection can be performed when the light conditions are relatively good.
[0155] For example, when the gravity tilt value of the terminal device on the z-axis is -9.12, the shooting mode is the normal mode, and the lux index is 450, the moon detection can be performed on the shooting interface based on the moon detection algorithm.
[0156] Furthermore, when the shooting mode is the normal mode and the brightness information is less than or equal to the second brightness threshold, the moon detection is not performed on the shooting interface.
[0157] When the terminal device is in an upward shooting posture and the shooting mode is normal mode, if the brightness is too dim, it is difficult to accurately detect whether there is a moon in the picture, and the possibility of misjudgment is high. Therefore, in a low-brightness environment where the brightness information is less than or equal to the second brightness threshold, the moon detection algorithm cannot accurately distinguish whether the moon is in the picture. At this time, the moon detection can be omitted in the shooting interface to avoid affecting the user experience due to invalid detection and shooting attempts in a low-brightness environment.
[0158] The above is a further description of step S203.
[0159] Based on the method described in steps S201 to S203 above, the posture information of the terminal device when the user takes a photo is first determined by a gravity accelerometer, and under the premise that the terminal device is in an upward shooting posture, whether to perform moon detection on the shooting interface is determined according to the shooting mode preset by the terminal device and the brightness information of the display screen, thereby avoiding moon detection for all scenes that are not in an upward shooting posture and whose brightness does not conform to moon shooting, avoiding a large number of false detections that exist in the detection results obtained only by the moon detection algorithm, greatly reducing the cases of false moon detection, improving the accuracy of moon detection, and enhancing the user experience.
[0160] Moreover, the above-mentioned moon detection method does not rely on the closed-source libraries of various companies in terms of software implementation. It can be integrated at any software level for judgment. It only requires the terminal device to have a similar gravity sensor and related brightness calculation algorithm.
[0161] Furthermore, after performing moon detection on the shooting interface based on the moon detection algorithm, the result of the moon detection can be obtained, including whether the moon exists on the shooting interface and whether the moon does not exist on the shooting interface.
[0162] In some embodiments, when the result of the moon detection is that there is a moon on the shooting interface, the brightness of the shooting interface can be reduced.
[0163] Specifically, when there is a moon on the shooting interface, you can enter the moon mode for shooting. By adjusting the exposure parameters, such as reducing the aperture, increasing the shutter speed, lowering the sensitivity, or adjusting the display brightness, you can reduce the brightness of the shooting interface, thereby optimizing the preview effect and improving the visual experience, making the moon displayed on the shooting interface clearer and more realistic.
[0164] In addition, in some embodiments, when the result of the moon detection is that there is a moon on the shooting interface, the terminal device can respond to the user's shooting operation, obtain the captured moon image, and perform image enhancement processing on the moon image.
[0165] Specifically, when the user presses a shooting button, such as tapping a shooting icon on a display screen or pressing a physical shutter button, the terminal device will obtain the captured image of the moon.
[0166] Since the moon images taken by terminal devices may have deficiencies in details, clarity, contrast, etc. and cannot perfectly show the reality and beauty of the moon, the moon images can be enhanced to improve the image quality, making the moon's details richer, the outline clearer, and the overall visual effect better.
[0167] In some embodiments, image enhancement processing performed on the moon image may include sharpening processing, contrast enhancement, noise reduction processing, color correction and enhancement, etc.
[0168] Among them, when sharpening the moon image, the algorithm can enhance the contrast of the edges of objects in the image, making the edges of the moon sharper, and more clearly presenting the detailed features such as mountains and craters on the surface of the moon, making it easier for the human eye to distinguish these subtle structures and improving the clarity of the image.
[0169] Contrast enhancement of the moon image can adjust the brightness differences in different areas of the image, appropriately increase the contrast between bright and dark areas, make the main body of the moon more prominent in the picture, and make it more clearly distinguishable from the darker night sky background, thereby enhancing the layering and visual impact of the picture.
[0170] Through the noise reduction processing algorithm, the noise generated in the image during the shooting process can be reduced, especially in dim light environments or when shooting with higher sensitivity, making the moon image purer and cleaner and improving the overall image quality.
[0171] Color correction and enhancement is to correct and appropriately enhance the colors in the captured images based on the actual color performance of the moon in the real environment, making the color of the moon more realistic and vivid. For example, it can restore the slightly grayish texture of the moon's surface, making its visual presentation more in line with people's cognition and aesthetic expectations of the moon.
[0172] Furthermore, the result of this moon detection can be used as input for the next moon detection method. For example, based on the result of this moon detection, it is determined whether the shooting mode of the terminal device is the moon mode when the next moon detection is performed, thereby determining whether the brightness information obtained next time is compared with the first brightness threshold or the second brightness threshold to determine whether to perform moon detection on the shooting interface based on the moon detection algorithm.
[0173] In some embodiments, see Appendix Figure 5 , Figure 5 FIG. 1 is a flow chart of the main steps of a moon detection method according to another embodiment of the present application. Figure 5 As shown, it mainly includes the following steps S501 to S5014.
[0174] Step S501: in response to the user's operation of opening the shooting interface, obtaining the posture information of the terminal device;
[0175] Step S502: determining whether the posture information is an upward shooting posture;
[0176] Further, if yes, execute step S503; otherwise, execute step S5010;
[0177] Step S503: determining whether the result of the previous moon detection of the shooting interface is obtained;
[0178] Further, if yes, execute step S504, otherwise execute step S508;
[0179] Step S504: determining whether the result of the previous moon detection is that there is a moon in the shooting interface;
[0180] Further, if yes, execute step S505, otherwise execute step S508;
[0181] Step S505: Determine that the preset shooting mode of the terminal device is the moon mode;
[0182] Step S506: determining whether the brightness information is greater than a first brightness threshold;
[0183] Further, if yes, execute step S507, otherwise execute step S5010;
[0184] Step S507: performing moon detection on the shooting interface of the terminal device;
[0185] Further, execute step S5011;
[0186] Step S508: Determine that the shooting mode preset by the terminal device is the normal mode;
[0187] Step S509: determining whether the brightness information is greater than a second brightness threshold;
[0188] Further, if yes, execute step S507, otherwise execute step S5010;
[0189] Step S5010: Do not perform moon detection on the shooting interface of the terminal device;
[0190] Step S5011: Determine whether there is a moon in the shooting interface;
[0191] Further, if yes, execute step S5012, otherwise end the process;
[0192] Step S5012: reducing the brightness of the shooting interface;
[0193] Step S5013: in response to the user's shooting operation, obtaining a captured moon image;
[0194] Step S5014: Perform image enhancement processing on the moon image.
[0195] The above is a further explanation of the moon detection method provided in this application.
[0196] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present application.
[0197] Furthermore, the present application also provides a terminal device. Figure 6 , Figure 6 FIG. 1 is a schematic diagram of the main structure of a terminal device according to an embodiment of the present application. Figure 6 As shown, the terminal device in the embodiment of the present application mainly includes a processor 601, a memory 602, a display screen 603 and a gravity sensor 604.
[0198] The processor 601 may include hardware, software or a combination of the two. The processor 601 may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two.
[0199] The memory 602 may be configured to store a program for executing the moon detection method of the above method embodiment, and the processor 601 may be configured to execute the program in the memory 602, which includes but is not limited to the program for executing the moon detection method of the above method embodiment. For ease of explanation, only the part related to the embodiment of the present application is shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application.
[0200] In some possible implementations of the present application, the terminal device may include multiple processors 601 and multiple memories 602. The program for executing the moon detection method of the above method embodiment may be divided into multiple subprograms, each of which may be loaded and run by the processor 601 to execute different steps of the moon detection method of the above method embodiment. Specifically, each subprogram may be stored in different memories 602, and each processor 601 may be configured to execute the programs in one or more memories 602 to jointly implement the moon detection method of the above method embodiment.
[0201] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium can be configured to store a program for executing the moon detection method of the above method embodiment, and the program can be loaded and run by the processor to implement the above moon detection method. The computer-readable storage medium can be a memory device formed by various terminal devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium, including any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal, and software distribution medium, etc. that can carry a computer program.
[0202] It should be noted that the relevant user personal information that may be involved in the various embodiments of the present application is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy and necessity, based on the reasonable purposes of business scenarios, to process the personal information that users actively provide during the use of products / services or generated due to the use of products / services, as well as the personal information obtained with the user's authorization.
[0203] The user personal information processed by this application will vary depending on the specific product / service scenario, and shall be based on the specific scenario in which the user uses the product / service, and may involve the user's account information, device information, driving information, vehicle information or other related information. This application will treat the user's personal information and its processing with a high degree of diligence.
[0204] This application attaches great importance to the security of user personal information and has taken reasonable and feasible security protection measures that meet industry standards to protect user information and prevent personal information from being accessed, disclosed, used, modified, damaged or lost without authorization.
[0205] So far, the technical solution of the present application has been described in conjunction with an embodiment shown in the accompanying drawings, but it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.
Claims
1. A moon detection method, applied to a terminal device, characterized in that: The terminal device includes a display screen, and the method includes: In response to the user's operation of opening a shooting interface, acquiring posture information of the terminal device; the shooting interface is displayed on the display screen of the terminal device, and the posture information includes an upward shooting posture and a non-upward shooting posture; When the posture information is the upward shooting posture, obtaining the shooting mode preset by the terminal device and the brightness information of the display screen; the shooting mode includes a normal mode and a moon mode; When the shooting mode is the moon mode and the brightness information is greater than a first brightness threshold, moon detection is performed on the shooting interface.
2. The moon detection method according to claim 1, characterized in that: The method further comprises: Acquire the result of the moon detection; the result of the moon detection includes whether the moon exists in the shooting interface and whether the moon does not exist in the shooting interface; When the result of the moon detection is that there is a moon on the shooting interface, the brightness of the shooting interface is reduced.
3. The moon detection method according to claim 2, characterized in that: The method further comprises: When the result of the moon detection is that there is a moon on the shooting interface, in response to a shooting operation of the user, acquiring a shot moon image; Perform image enhancement processing on the moon image.
4. The moon detection method according to claim 1, characterized in that: The terminal device includes a gravity sensor; and obtaining the posture information of the terminal device includes: Acquiring gravity sensing data of the terminal device based on the gravity sensor; wherein the gravity sensing data at least includes a gravity tilt value in a thickness direction in an orthogonal coordinate system of the terminal device, and the thickness direction is perpendicular to the display screen; Obtaining an average tilt value based on the gravity tilt values in the thickness direction obtained multiple times; When the average tilt value is less than a preset tilt value threshold, the posture information is determined to be the upward shooting posture; otherwise, the posture information is determined to be the non-upward shooting posture.
5. The moon detection method according to claim 2, characterized in that: The method further comprises: Determine whether the result of the previous moon detection of the shooting interface is obtained; If the result of the previous moon detection is obtained, and the result of the previous moon detection is that there is a moon in the shooting interface, then the shooting mode is determined to be the moon mode.
6. The moon detection method according to claim 5, characterized in that: The method further comprises: If the result of the previous moon detection is obtained, and the result of the previous moon detection is that there is no moon in the shooting interface, determining that the shooting mode is the normal mode; Or, if the result of the previous moon detection is not obtained, the shooting mode is determined to be the normal mode.
7. The moon detection method according to claim 1, characterized in that: The method further comprises: When the shooting mode is the normal mode and the brightness information is greater than a second brightness threshold, performing moon detection on the shooting interface; The second brightness threshold is greater than the first brightness threshold.
8. The moon detection method according to claim 7, characterized in that: The method further comprises: When the shooting mode is the normal mode and the brightness information is less than or equal to the second brightness threshold, moon detection is not performed on the shooting interface.
9. The moon detection method according to claim 1, characterized in that: The method further comprises: When the shooting mode is the moon mode and the brightness information is less than or equal to the first brightness threshold, acquiring the brightness information multiple times at a preset time interval; When the brightness information obtained multiple times is less than or equal to the first brightness threshold, moon detection is not performed on the shooting interface.
10. The moon detection method according to claim 1, characterized in that: The method further comprises: When the posture information is the non-upward shooting posture, the moon detection is not performed on the shooting interface.