A method, device and computer-readable storage medium for capturing and processing starry sky images
By using the starry sky image shooting and processing method in the AR virtual reality constellation application, combined with the integral map algorithm and star catalog data, the problem of poor star detection accuracy in the existing technology is solved, and a more accurate and user-friendly starry sky shooting experience is achieved.
Patent Information
- Application Number
- CN202111332461.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-11-11
AI Technical Summary
In existing AR virtual reality constellation applications, star detection relies on terminal sensors and GPS information. Due to environmental effects, the number of stars is limited, accuracy is poor, and the experience is poor.
The starry sky image shooting and processing method is adopted, by obtaining the mask image, using the integral map algorithm to detect the stars, calculating the average brightness ratio, filtering and arranging the stars, and combining the star catalog data for registration to complete the stars not included in the shooting.
It improves the accuracy and user experience of starry sky shooting, enables users to complete starry sky shooting according to the actual starry state, and improves the use effect of the starry sky shooting function.
Smart Images

Figure CN114040073B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile communications, and in particular to a method and device for shooting and processing starry sky images, and a computer-readable storage medium. Background Art
[0002] In the prior art, with the continuous development of smart terminal devices, users have higher and higher demands for the shooting of devices. In particular, the starry sky shooting function based on mobile devices has been widely welcomed by users. The general implementation scheme is to detect the stars to be photographed in the night sky after combining the terminal's sensor and GPS information. The above scheme has derived many related applications, such as the existing AR virtual reality constellations on the market. However, in the existing AR virtual reality constellation applications, the data obtained only comes from the terminal's sensor and GPS information.
[0003] However, in existing shooting application solutions, due to the influence of various environments, the number of stars captured is limited, and there is a large difference between the existing star map generated by AR virtual reality and the real star map, and the accuracy is poor, and the actual experience needs to be improved. Summary of the invention
[0004] In order to solve the above technical defects in the prior art, the present invention proposes a method for shooting and processing starry sky images, which comprises:
[0005] A mask image corresponding to the captured image is acquired, and a first star group in the mask image is detected according to a preset integral image algorithm.
[0006] Determine an image feature algorithm corresponding to the preset integral image algorithm, and calculate the average brightness ratio of each star in the first star group through the image feature algorithm, wherein the average brightness ratio is the ratio of the upper area integral to the lower area integral within the pixel range of each star itself.
[0007] A second star group whose average brightness ratio is less than a preset ratio threshold is obtained by screening the first star group, and the stars in the second star group are arranged from small to large according to the average brightness ratio.
[0008] The first preset number of stars in the front arrangement is registered and aligned with the preset star catalog data to fill in the captured image with the second preset number of stars not included in the arrangement.
[0009] Optionally, the acquiring a mask image corresponding to the captured image, and detecting a first star group in the mask image according to a preset integral image algorithm, includes:
[0010] A binary mask image of the captured image is obtained.
[0011] The binary mask image is eroded to expand a black area in the binary mask image to obtain the processed mask image.
[0012] Optionally, the determining of an image feature algorithm corresponding to the preset integral image algorithm, and calculating an average brightness ratio of each star in the first star group by the image feature algorithm, wherein the average brightness ratio is a ratio of an upper region integral to a lower region integral within a pixel range of each star itself, comprises:
[0013] An edge feature algorithm corresponding to the preset integral image algorithm is determined in the image feature algorithm.
[0014] The average brightness ratio of each star in the first star group is calculated according to the edge feature algorithm.
[0015] Optionally, the step of determining an image feature algorithm corresponding to the preset integral image algorithm, and calculating an average brightness ratio of each star in the first star group by the image feature algorithm, wherein the average brightness ratio is a ratio of an upper region integral to a lower region integral within a pixel range of each star, further comprises:
[0016] Within the pixel range of each star, the highlighted area is taken as the upper area, and the lower area is taken as the lower area.
[0017] An upper region integral of the upper region and a lower region integral of the lower region are obtained, and a ratio of the upper region integral to the lower region integral is used as the average brightness ratio.
[0018] Optionally, the step of screening the first star group to obtain a second star group whose average brightness ratio is less than a preset ratio threshold, and arranging the stars in the second star group from small to large according to the average brightness ratio comprises:
[0019] Background objects in the captured image are identified.
[0020] A first ratio threshold is determined according to the object type of the background object.
[0021] Optionally, the step of screening the first star group to obtain a second star group whose average brightness ratio is less than a preset ratio threshold, and arranging the stars in the second star group from small to large according to the average brightness ratio, further comprises:
[0022] A second ratio threshold value smaller than the first ratio threshold value is preset.
[0023] A second star group whose average brightness ratio is greater than the second ratio threshold and less than the first ratio threshold is obtained by screening the first star group.
[0024] Optionally, the registering and aligning the first preset number of stars arranged in front with preset star catalog data to fill in the captured image with a second preset number of stars not included in the arrangement, includes:
[0025] The star object arranged in the front is extracted and registered and aligned with the star catalog data.
[0026] The second preset number of stars to be completed is determined according to the results of the registration.
[0027] Optionally, the registering and aligning the first preset number of stars arranged in front with the preset star catalog data to fill in the captured image with a second preset number of stars not included in the arrangement, further includes:
[0028] Among the second preset number of stars, the stars to be added that are located in the sky area in the mask image are screened.
[0029] The star to be added is completed in the captured image.
[0030] The present invention also proposes a starry sky image shooting and processing device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the starry sky image shooting and processing method as described in any one of the above items.
[0031] The present invention also proposes a computer-readable storage medium, on which a starry sky image shooting and processing program is stored. When the starry sky image shooting and processing program is executed by a processor, the steps of the starry sky image shooting and processing method as described in any one of the above items are implemented.
[0032] The starry sky image shooting and processing method, device and computer-readable storage medium of the present invention are implemented, by acquiring a mask image corresponding to a shot image, and detecting a first star group in the mask image according to a preset integral image algorithm; determining an image feature algorithm corresponding to the preset integral image algorithm, and calculating the average brightness ratio of each star in the first star group by the image feature algorithm, wherein the average brightness ratio is the ratio of the upper region integral and the lower region integral within the pixel range of each star itself; screening out a second star group whose average brightness ratio is less than a preset ratio threshold value from the first star group, and arranging the stars in the second star group from small to large according to the average brightness ratio; registering and aligning the first preset number of stars arranged in front with the preset star catalog data, so as to fill in the second preset number of stars not included in the arrangement in the shot image. A humanized starry sky image shooting and processing scheme is realized, so that the user can fill in the stars according to the actual star state in the current shot image, improve the accuracy of starry sky shooting, and enhance the user's experience of the starry sky shooting function. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0034] Figure 1 It is a hardware structure diagram of a mobile terminal involved in the present invention;
[0035] Figure 2 is a communication network system architecture diagram provided by an embodiment of the present invention;
[0036] Figure 3 is a flow chart of a first embodiment of a method for photographing and processing starry sky images of the present invention;
[0037] Figure 4 is a flow chart of a second embodiment of a method for photographing and processing starry sky images according to the present invention;
[0038] Figure 5 is a flow chart of a third embodiment of a method for photographing and processing starry sky images according to the present invention;
[0039] Figure 6 is a flow chart of a fourth embodiment of a method for photographing and processing starry sky images according to the present invention;
[0040] Figure 7 is a flow chart of a fifth embodiment of a method for photographing and processing starry sky images according to the present invention;
[0041] Figure 8 is a flow chart of a sixth embodiment of a method for photographing and processing starry sky images according to the present invention;
[0042] Fig. 9is a flow chart of a seventh embodiment of a method for photographing and processing starry sky images according to the present invention;
[0043] Fig.10 is a flow chart of an eighth embodiment of the starry sky image shooting and processing method of the present invention;
[0044] Fig.11 is an integral schematic diagram of a first embodiment of a method for photographing and processing starry sky images of the present invention;
[0045] Fig.12 It is another integral schematic diagram of the first embodiment of the starry sky image shooting and processing method of the present invention. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0047] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0048] The terminal may be implemented in various forms. For example, the terminal described in the present invention may include mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.
[0049] The following description will be made by taking a mobile terminal as an example, and those skilled in the art will appreciate that, in addition to components specifically used for mobile purposes, the configuration according to the embodiments of the present invention can also be applied to fixed-type terminals.
[0050] See also Figure 1 , which is a schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit 103, A / V (audio / video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111 and other components. Those skilled in the art can understand that Figure 1 The structure of the mobile terminal shown in the figure does not constitute a limitation on the mobile terminal. The mobile terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0051] Combine the following Figure 1 The following is a detailed introduction to the various components of the mobile terminal:
[0052] The radio frequency unit 101 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving the downlink information of the base station, it is sent to the processor 110 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 101 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 101 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution), etc.
[0053] WiFi is a short-range wireless transmission technology. The mobile terminal can help users send and receive emails, browse web pages and access streaming media through the WiFi module 102. It provides users with wireless broadband Internet access. Figure 1 The WiFi module 102 is shown, but it is understandable that it is not an essential component of the mobile terminal and can be omitted as needed without changing the essence of the invention.
[0054] The audio output unit 103 can convert the audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, etc. Moreover, the audio output unit 103 can also provide audio output related to a specific function performed by the mobile terminal 100 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, etc.
[0055] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processor (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 106. The image frame processed by the graphics processor 1041 can be stored in the memory 109 (or other storage medium) or sent via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a telephone call mode, a recording mode, a voice recognition mode, and other operating modes, and can process such sound into audio data. The processed audio (voice) data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 can implement various types of noise elimination (or suppression) algorithms to eliminate (or suppress) noise or interference generated in the process of receiving and sending audio signals.
[0056] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can also be configured on the mobile phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0057] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0058] The user input unit 107 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1071 or near the touch panel 1071 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 110, and can receive and execute the command sent by the processor 110. In addition, the touch panel 1071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, etc., which are not specifically limited here.
[0059] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of the touch event. Then, the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Figure 1 In the figure, the touch panel 1071 and the display panel 1061 are used as two independent components to implement the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to implement the input and output functions of the mobile terminal, which is not limited here.
[0060] The interface unit 108 serves as an interface through which at least one external device can be connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
[0061] The memory 109 can be used to store software programs and various data. The memory 109 can mainly include a program storage area and a data storage area, wherein 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 according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 109 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0062] The processor 110 is the control center of the mobile terminal. It uses various interfaces and lines to connect various parts of the entire mobile terminal. It executes various functions of the mobile terminal and processes data by running or executing software programs and / or modules stored in the memory 109, and calling data stored in the memory 109, so as to monitor the mobile terminal as a whole. The processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 110.
[0063] The mobile terminal 100 may also include a power supply 111 (such as a battery) for supplying power to various components. Preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system.
[0064] although Figure 1 Not shown, the mobile terminal 100 may further include a Bluetooth module, etc., which will not be described in detail here.
[0065] To facilitate understanding of the embodiments of the present invention, the communication network system on which the mobile terminal of the present invention is based is described below.
[0066] See also Figure 2 , Figure 2 A communication network system architecture diagram is provided for an embodiment of the present invention. The communication network system is an LTE system of universal mobile communication technology. The LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203 and an operator's IP service 204, which are sequentially connected for communication.
[0067] Specifically, UE201 may be the above-mentioned terminal 100, which will not be described in detail here.
[0068] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 , etc. Among them, eNodeB 2021 can be connected to other eNodeBs 2022 through a backhaul (eg, an X2 interface), and eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 can provide UE 201 with access to EPC 203 .
[0069] EPC203 may include MME (Mobility Management Entity) 2031, HSS (Home Subscriber Server) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, PGW (PDN Gate Way) 2035 and PCRF (Policy and Charging Rules Function) 2036, etc. Among them, MME2031 is a control node that processes signaling between UE201 and EPC203, and provides bearer and connection management. HSS2032 is used to provide some registers to manage functions such as home location register (not shown in the figure), and save some user-specific information such as service features and data rates. All user data can be sent through SGW2034, PGW2035 can provide IP address allocation and other functions for UE 201, PCRF2036 is the policy and charging control policy decision point for service data flow and IP bearer resources, which selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).
[0070] The IP service 204 may include the Internet, an intranet, an IMS (IP Multimedia Subsystem) or other IP services.
[0071] Although the above introduction takes the LTE system as an example, those skilled in the art should know that the present invention is not only applicable to the LTE system, but also to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA and future new network systems, etc., which are not limited here.
[0072] Based on the above mobile terminal hardware structure and communication network system, various embodiments of the method of the present invention are proposed.
[0073] Embodiment 1
[0074] Figure 3 1 is a flow chart of a first embodiment of a method for shooting and processing a starry sky image according to the present invention. A method for shooting and processing a starry sky image comprises:
[0075] S1. Obtain a mask image corresponding to a captured image, and detect a first star group in the mask image according to a preset integral image algorithm.
[0076] S2. Determine an image feature algorithm corresponding to the preset integral image algorithm, and calculate the average brightness ratio of each star in the first star group through the image feature algorithm, wherein the average brightness ratio is the ratio of the upper area integral to the lower area integral within the pixel range of each star itself.
[0077] S3. Screening the first star group to obtain a second star group whose average brightness ratio is less than a preset ratio threshold, and arranging the stars in the second star group from small to large according to the average brightness ratio.
[0078] S4. Perform registration and alignment based on a first preset number of stars in the front arrangement and preset star catalog data, so as to fill in a second preset number of stars not included in the arrangement in the captured image.
[0079] In this embodiment, first, a preview image is obtained, and the sky area of the image is extracted using deep learning; then, the positions of the stars are detected in the sky area using the Haar feature; then, the brightness information of the stars is calculated using the Haar (a machine learning image processing algorithm) feature, and the brightness of the stars is sorted; finally, the detected stars are used to register and align the stars generated by the observatory star catalog, and the stars that have not been photographed are supplemented.
[0080] Optionally, in this embodiment, stars are detected by using an integral image and the above-mentioned haar features. Among them, the Haar-like feature used in this embodiment is a commonly used feature description operator in the field of computer vision. Specifically, the haar feature can be customized according to needs, and common ones include edge haar features, line haar features, center point haar features, etc. Optionally, this embodiment uses edge haar features, and the calculation of the haar features of this embodiment is based on the integral image. For example, please refer to Fig.11 The integral schematic diagram is shown. In this integral diagram, the integral of point 1 SAT1 = Sum(Ra) SAT1 = Sum(Ra), the integral of point 2 SAT2 = Sum(Ra) + Sum(Rb) SAT2 = Sum(Ra) + Sum(Rb), the integral of point 3 SAT3 = Sum(Ra) + Sum(Rc) SAT3 = Sum(Ra) + Sum(Rc), the integral of point 4 SAT4 = Sum(Ra) + Sum(Rb) + Sum(Rc) + Sum(Rd) SAT4 = Sum(Ra) + Sum(Rb) + Sum(Rc) + Sum(Rd). In this embodiment, based on the above-mentioned integral calculation method, in order to calculate the sum of the rectangular pixels in the area where the star is located, for example, the sum (integral) of the pixel values of all points in area Rd can be expressed as: Sum(Rd) = SAT1 + SAT4-SAT2-SAT3. Similarly, please refer to Fig.12 The integral schematic diagram is shown, where, based on the haar feature, the Sum_A area and the Sum_B area can also use the above formula. In particular, in this embodiment, a T value is defined, T = Sum_A / Sum_B, where the T value is the average brightness ratio of the upper and lower areas of the haar feature. It can be seen that the larger the T, the brighter the relative brightness of Sum_A.
[0081] The beneficial effect of this embodiment is that, by acquiring the mask image corresponding to the captured image, and detecting and obtaining the first star group in the mask image according to the preset integral image algorithm; determining the image feature algorithm corresponding to the preset integral image algorithm, and calculating the average brightness ratio of each star in the first star group by the image feature algorithm, wherein the average brightness ratio is the ratio of the upper region integral and the lower region integral within the pixel range of each star itself; screening out the second star group whose average brightness ratio is less than the preset ratio threshold value in the first star group, and arranging the stars in the second star group from small to large according to the average brightness ratio; registering and aligning the first preset number of stars arranged in front with the preset star catalog data, so as to fill in the captured image with the second preset number of stars not included in the arrangement. A humanized starry sky image shooting and processing scheme is realized, so that the user can fill in the stars according to the actual star state in the current captured image, improve the accuracy of starry sky shooting, and enhance the user's experience of the starry sky shooting function.
[0082] Embodiment 2
[0083] Figure 4 : is a flow chart of a second embodiment of the method for shooting and processing starry sky images of the present invention. Based on the above embodiment, the step of obtaining a mask image corresponding to the shot image and detecting a first star group in the mask image according to a preset integral image algorithm includes:
[0084] S11. Obtain a binary mask image of the captured image.
[0085] S12, performing corrosion processing on the binary mask image to expand the black area in the binary mask image to obtain the processed mask image.
[0086] Optionally, in this embodiment, an erosion processing method of erode (an image processing method) is used to perform morphological erosion processing on the binary mask image to expand the black area in the binary mask image to obtain the processed mask image, thereby avoiding identifying non-sky areas as sky areas.
[0087] The beneficial effect of this embodiment is that by acquiring the binary mask image of the captured image and performing corrosion processing on the binary mask image to expand the black area in the binary mask image, a processed mask image is obtained. A humanized starry sky image capture and processing solution is implemented, so that the user can fill in the stars according to the actual star state in the current captured image, thereby improving the accuracy of starry sky capture and enhancing the user's experience of the starry sky capture function.
[0088] Embodiment 3
[0089] Figure 5 : is a flow chart of a third embodiment of the starry sky image shooting and processing method of the present invention. Based on the above embodiment, the image feature algorithm corresponding to the preset integral image algorithm is determined, and the average brightness ratio of each star in the first star group is calculated by the image feature algorithm, wherein the average brightness ratio is the ratio of the upper region integral to the lower region integral within the pixel range of each star itself, including:
[0090] S21. Determine an edge feature algorithm corresponding to the preset integral image algorithm in the image feature algorithm.
[0091] S22. Calculate the average brightness ratio of each star in the first star group according to the edge feature algorithm.
[0092] The beneficial effect of this embodiment is that, by determining the edge feature algorithm corresponding to the preset integral graph algorithm in the image feature algorithm; and calculating the average brightness ratio of each star in the first star group according to the edge feature algorithm, a humanized starry sky image shooting and processing solution is realized, so that the user can fill in the stars according to the actual star state in the current shot image, thereby improving the accuracy of starry sky shooting and enhancing the user's experience of the starry sky shooting function.
[0093] Embodiment 4
[0094] Figure 6 4 is a flow chart of a fourth embodiment of the method for shooting and processing starry sky images of the present invention. Based on the above embodiment, the image feature algorithm corresponding to the preset integral image algorithm is determined, and the average brightness ratio of each star in the first star group is calculated by the image feature algorithm, wherein the average brightness ratio is the ratio of the upper region integral to the lower region integral within the pixel range of each star itself, and further includes:
[0095] S23. Within the pixel range of each star, the highlighted pixel is taken as the upper region, and the dim pixel is taken as the lower region.
[0096] S24, obtaining an upper region integral of the upper region and a lower region integral of the lower region, and taking a ratio of the upper region integral to the lower region integral as the average brightness ratio.
[0097] The beneficial effect of this embodiment is that, within the pixel range of each star, the highlighted one is taken as the upper area and the dim one is taken as the lower area; the upper area integral of the upper area and the lower area integral of the lower area are obtained, and the ratio of the upper area integral to the lower area integral is used as the average brightness ratio. A humanized starry sky image shooting and processing solution is realized, so that the user can fill in the stars according to the actual star state in the current shot image, improve the accuracy of starry sky shooting, and enhance the user's experience of the starry sky shooting function.
[0098] Embodiment 5
[0099] Figure 7 : is a flowchart of a fifth embodiment of the method for shooting and processing starry sky images of the present invention. Based on the above embodiment, the second star group whose average brightness ratio is less than a preset ratio threshold is obtained by screening out from the first star group, and the stars in the second star group are arranged from small to large according to the average brightness ratio, including:
[0100] S31: Identify background objects in the captured image.
[0101] S32: Determine a first ratio threshold according to the object type of the background object.
[0102] Optionally, in this embodiment, when the T value is greater than a certain value, it is considered that the star here may be a street lamp. Therefore, in order to improve the accuracy of star detection, this embodiment will determine the first ratio threshold according to the object type of the background object.
[0103] Optionally, in this embodiment, the object types include light-emitting lamps such as street lamps, vehicle lamps, and signal lamps.
[0104] The beneficial effect of this embodiment is that by identifying the background object in the captured image and determining the first ratio threshold according to the object type of the background object, a humanized starry sky image shooting processing solution is implemented, so that the user can fill in the stars according to the actual star state in the current captured image, thereby improving the accuracy of starry sky shooting and enhancing the user's experience of the starry sky shooting function.
[0105] Embodiment 6
[0106] Figure 8 is a flow chart of a sixth embodiment of the method for shooting and processing starry sky images of the present invention. Based on the above embodiment, the second star group whose average brightness ratio is less than a preset ratio threshold is obtained by screening out from the first star group, and the stars in the second star group are arranged from small to large according to the average brightness ratio, and further includes:
[0107] S33. Preset a second ratio threshold that is smaller than the first ratio threshold.
[0108] S34. Screening the first star group to obtain a second star group whose average brightness ratio is greater than the second ratio threshold and less than the first ratio threshold.
[0109] Optionally, in this embodiment, in order to prevent users from being unable to identify stars with too low brightness with the naked eye and to avoid additional meaningless processing, in this step, a second ratio threshold value that is smaller than the first ratio threshold value is pre-set for screening low-brightness stars.
[0110] The beneficial effect of this embodiment is that by presetting a second ratio threshold value that is smaller than the first ratio threshold value, a second star group whose average brightness ratio is greater than the second ratio threshold value and smaller than the first ratio threshold value is screened out from the first star group. A humanized starry sky image shooting and processing solution is implemented, so that the user can fill in the stars according to the actual star state in the current shot image, thereby improving the accuracy of starry sky shooting and enhancing the user's experience of the starry sky shooting function.
[0111] Embodiment 7
[0112] Fig. 9 : is a flow chart of the seventh embodiment of the method for shooting and processing starry sky images of the present invention. Based on the above embodiment, the first preset number of stars arranged in front are registered and aligned with the preset star catalog data to fill in the captured image with the second preset number of stars not included in the arrangement, including:
[0113] S41, extracting the star arranged in the front, and registering and aligning it with the star catalog data.
[0114] S42, determining a second preset number of stars to be completed according to the registration and the result thereof.
[0115] The beneficial effect of this embodiment is that by extracting the stars arranged in the front and registering and aligning them with the star catalog data, and determining the second preset number of stars to be completed according to the registration and the results thereof, a humanized starry sky image shooting and processing solution is realized, so that the user can complete the stars according to the actual star state in the current shot image, thereby improving the accuracy of starry sky shooting and enhancing the user's experience of the starry sky shooting function.
[0116] Embodiment 8
[0117] Fig.10: is a flow chart of an eighth embodiment of the method for shooting and processing starry sky images of the present invention. Based on the above embodiment, the first preset number of stars arranged in front are registered and aligned with the preset star catalog data to fill in the captured image with the second preset number of stars not included in the arrangement, and further includes:
[0118] S43: Screening out the stars to be added that are in the sky area in the mask image from the second preset number of stars.
[0119] S44, completing the star objects to be added in the captured image.
[0120] Optionally, in this embodiment, the number of stars filled in the current image and the number of stars contained in the original image are displayed in the captured image.
[0121] Optionally, in this embodiment, a user's selection instruction is received to determine whether to retain the completed stars and the original stars in the captured image, or to retain only the original stars; or, alternatively, a list of completed stars and original stars is generated for the user to select the stars to be displayed in the captured image.
[0122] The beneficial effect of this embodiment is that by screening the stars to be added in the sky area in the mask image from the second preset number of stars, the stars to be added are filled in the captured image. A humanized starry sky image capture and processing solution is implemented, so that the user can fill in the stars according to the actual star state in the current captured image, thereby improving the accuracy of starry sky capture and enhancing the user's experience of the starry sky capture function.
[0123] Embodiment 9
[0124] Based on the above embodiments, the present invention also proposes a starry sky image shooting and processing device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the starry sky image shooting and processing method as described in any one of the above items are implemented.
[0125] It should be noted that the above-mentioned device embodiment and method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, and the technical features in the method embodiment are correspondingly applicable in the device embodiment, which will not be repeated here.
[0126] Embodiment 10
[0127] Based on the above embodiments, the present invention also proposes a computer-readable storage medium, on which a starry sky image shooting and processing program is stored. When the starry sky image shooting and processing program is executed by a processor, the steps of the starry sky image shooting and processing method as described in any one of the above items are implemented.
[0128] It should be noted that the above-mentioned medium embodiment and method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, and the technical features in the method embodiment are correspondingly applicable in the medium embodiment, which will not be repeated here.
[0129] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0130] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0131] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0132] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A method for shooting and processing starry sky images, characterized in that: The method comprises: Acquire a mask image corresponding to the captured image, and detect a first star group in the mask image according to a preset integral image algorithm; Determine an image feature algorithm corresponding to the preset integral map algorithm, and calculate the average brightness ratio of each star in the first star group by using the image feature algorithm, wherein the average brightness ratio is the ratio of the upper region integral to the lower region integral within the pixel range of each star itself; wherein, within the pixel range of each star itself, the highlighted one is taken as the upper region, and the lower region integral is taken as the lower region; obtain the upper region integral of the upper region, and the lower region integral of the lower region, and use the ratio of the upper region integral to the lower region integral as the average brightness ratio; A second star group whose average brightness ratio is less than a preset ratio threshold is obtained by screening out the first star group, and the stars in the second star group are arranged from small to large according to the average brightness ratio, wherein background objects in the captured image are identified; a first ratio threshold is determined according to the object type of the background object; a second ratio threshold that is less than the first ratio threshold is preset; a second star group whose average brightness ratio is greater than the second ratio threshold and less than the first ratio threshold is obtained by screening out the first star group; The first preset number of stars in the front arrangement is registered and aligned with the preset star catalog data to fill in the captured image with the second preset number of stars not included in the arrangement.
2. The method for capturing and processing starry sky images according to claim 1, characterized in that: The step of acquiring a mask image corresponding to the captured image and detecting a first star group in the mask image according to a preset integral image algorithm includes: Acquire a binary mask image of the captured image; The binary mask image is eroded to expand a black area in the binary mask image to obtain the processed mask image.
3. The method for capturing and processing starry sky images according to claim 2, wherein: The step of determining an image feature algorithm corresponding to the preset integral image algorithm, and calculating an average brightness ratio of each star in the first star group by the image feature algorithm, wherein the average brightness ratio is a ratio of an upper region integral to a lower region integral within a pixel range of each star, comprises: Determining an edge feature algorithm corresponding to the preset integral image algorithm in the image feature algorithm; The average brightness ratio of each star in the first star group is calculated according to the edge feature algorithm.
4. The method for capturing and processing starry sky images according to claim 3, characterized in that: The registering and aligning the first preset number of stars arranged in front with the preset star catalog data to fill in the captured image with the second preset number of stars not included in the arrangement, comprises: Extracting the star that is arranged in the front, and registering and aligning it with the star catalog data; A second preset number of stars to be completed is determined according to the results of the registration.
5. The method for capturing and processing starry sky images according to claim 4, characterized in that: The registering and aligning the first preset number of stars arranged in front with the preset star catalog data to fill in the captured image with the second preset number of stars not included in the arrangement, further includes: Screening out the stars to be added that are in the sky area in the mask image from the second preset number of stars; The star to be added is completed in the captured image.
6. A starry sky image shooting and processing device, characterized in that: The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the starry sky image shooting and processing method as described in any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a starry sky image shooting and processing program, and when the starry sky image shooting and processing program is executed by a processor, the steps of the starry sky image shooting and processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Image processing method and device, computer readable storage medium and electronic equipment
CN112802033A
Orientation deciding device for artificial satellite
JP2003285798A
