A method for realizing two-in-one starry sky lamp based on projector

By applying fluctuation functions and image processing library to synthesize aurora effects in the projector, combined with projector lens adjustment, the projector independently generates realistic dynamic starlight effects, solving the problem of dependence on external optical accessories in the existing technology, and providing a rich visual experience.

CN119182891BActive Publication Date: 2025-08-22深セン雅博創新有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411337966.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-08-22
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

The existing technology cannot use the optical system of the projector itself to achieve the effect of the starlight lamp, and rely on external optical accessories, resulting in limited convenience and scope of application. The pictures and videos projected by the starlight appear single and not realistic enough, and cannot be synthesized dynamically in real time.

Method used

By receiving the starry sky screensaver mode selected by the user, reading pre-stored pictures or video files, applying a fluctuation function to generate an aurora effect, adjusting the brightness of the RGB channel, and using the image processing library to synthesize aurora and original image or video frames, and adjusting the imaging distance with the projector motor lens to achieve dynamic starry sky light effect.

Benefits of technology

The projector independently generates realistic and dynamically changing starlight effects, eliminating the dependence on external optical accessories and providing a rich visual experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182891B_ABST
    Figure CN119182891B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of optical accessories, and specifically to a method for realizing a two-in-one starry sky lamp based on a projector, comprising the following steps: receiving a starry sky screen saver mode selected by a user; reading a pre-stored picture or video file to obtain information of a video frame; applying a wave function to generate a wave effect through a sine function; using the wave value to adjust the brightness of the RGB channel to simulate the aurora effect; synthesizing the aurora effect with the original image or video frame through an image processing library, and adjusting the intensity of the synthesis; looping through each frame of the video, applying an algorithm, and displaying the processed frame; adjusting the imaging distance of the projector motor lens so that the projector achieves the best starry sky lamp imaging effect. This method eliminates the dependence on external optical accessories, realizes the effect of the projector independently generating a starry sky lamp, provides a realistic and dynamically changing starry sky lamp effect, and enables each device to present an ever-changing visual experience at different time points.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of optical accessories, and specifically to a method for realizing a two-in-one starry sky lamp based on a projector. Background Art

[0002] Starlight lamps and projectors currently on the market typically utilize specialized devices to achieve their respective functions. Even when some two-in-one solutions exist, these still require external optical components to achieve the desired effect. For example, combining a starlight lamp with a projector requires additional lenses, filters, and other auxiliary equipment to achieve specific lighting effects.

[0003] However, the existing technology has some defects:

[0004] Dependence on external optical accessories: These devices are unable to independently achieve complex light and shadow effects, which greatly limits their convenience and scope of application.

[0005] Lack of a two-in-one projector-based starry sky light solution: There is currently no solution that uses the projector's own optical system to directly achieve the starry sky light effect.

[0006] The images and videos are single and not realistic: The images and videos projected by existing star lights often appear single and not realistic enough.

[0007] Unable to achieve real-time dynamic synthesis: Existing technology cannot achieve real-time dynamic synthesis, resulting in the deficiency that each device can present an ever-changing starry sky light effect at different time points. Summary of the Invention

[0008] (1) Technical issues to be resolved

[0009] The present invention mainly addresses the above problems and proposes a method for realizing a two-in-one starry sky light based on a projector. Its purpose is to eliminate the dependence on external optical accessories, enable the projector to independently generate starry sky light effects, provide realistic and dynamically changing starry sky light effects, and enable each device to present an ever-changing visual experience at different time points.

[0010] (2) Technical solution

[0011] To achieve the above objectives, the present invention provides a method for realizing a two-in-one starry sky light based on a projector, comprising the following steps:

[0012] Receive the starry sky screen saver mode selected by the user;

[0013] Read pre-stored pictures or video files to obtain video frame information;

[0014] Apply the wave function to generate a wave effect through the sine function;

[0015] Use the fluctuation value to adjust the brightness of the RGB channels to simulate the aurora effect;

[0016] Use the image processing library to combine the aurora effect with the original image or video frame and adjust the intensity of the combination;

[0017] Loop through each frame of the video, apply the algorithm, and display the processed frame;

[0018] Adjust the imaging distance of the projector motor lens to achieve the best starry sky light imaging effect.

[0019] Furthermore, the aurora effect is synthesized with the original image or video frame through the addWeighted function in the OpenCV library.

[0020] Furthermore, the wave effect is generated by the following formula:

[0021]

[0022] And adjust the brightness of RGB channels by the following formula:

[0023]

[0024]

[0025]

[0026]

[0027] Where wave is the fluctuation coefficient, x is in the range [0, cols], cols represents the image or video frame length, y is in the range [0, rows], cows represents the image or video frame width, the time variable is used to dynamically change the aurora effect to simulate the movement of the aurora, and aurora[y,x] represents the RGB value of the pixel in the processed image frame.

[0028] Furthermore, before looping through each frame of the video, Gaussian blur processing is also applied. When applying the following Gaussian blur processing formula, the convolution kernel size used is (5, 5):

[0029]

[0030] Among them, (5,5) is the convolution kernel size, that is, the neighborhood size, and the operation is performed on the 5 * 5 neighborhood with the center point as the center.

[0031] Furthermore, the method further comprises the following steps:

[0032] When looping through each frame of the image, the star effect is synthesized and the stars are generated using the following formula:

[0033]

[0034] in, is the name of the function used to draw a circle on the image; an image matrix representing a starry sky or other background; represents the coordinates of the center of the circle; Represents the radius of the circle, used to generate a random integer between 1 and 3; An object representing a color; Indicates converting color values ​​into a format suitable for image library processing; Indicates that the circle should be completely filled.

[0035] Furthermore, the method further comprises the following steps:

[0036] When looping through each frame of the image, a meteor effect is synthesized and the meteor is generated using the following formula:

[0037] in, is the function name used to draw lines on the image. Represents the image layer used to draw the meteor effect; Is a tuple representing the coordinates of the starting point of the line; Is a tuple representing the end point coordinates of the line. Refers to the starting point Increase in horizontal direction ) unit's location.

[0038] Furthermore, the method further comprises the following steps:

[0039] When looping and reading each frame of the image, the Variant Mirror effect is synthesized and the Variant Mirror is generated by the following formula:

[0040] in, is the name of a function that recalculates the position of each pixel in the image according to the given mapping function; Represents the original image to be processed; Is a mapping array that specifies the horizontal coordinate of each output pixel in the original image; Is a mapping array that specifies the vertical coordinate of each output pixel in the original image; Specify the interpolation method used during image remapping; Defines how to handle images outside the bounds.

[0041] Furthermore, after the user selects a starry sky screensaver, a randomly changing starry sky effect is dynamically generated in real time based on pictures and videos.

[0042] Furthermore, the aurora effect is synthesized on the original image using the following formula:

[0043]

[0044] in, Represents each video frame, 0.7, 0.3 coefficients are image blending weights, the blending weights depend on the original image, the projector screen PQ effect, and the lens effect to take the optimal parameters, To process the synthesized frame image.

[0045] (3) Beneficial effects

[0046] Compared with the existing technology, the present invention provides a method for realizing a two-in-one starry sky light based on a projector. By utilizing software algorithms to generate dynamically changing aurora and starry sky effects, and synthesizing and processing video frames in real time, it eliminates the dependence on external optical accessories, solves the problem of single and unrealistic pictures, and enables each device to present ever-changing starry sky light effects at different time points, thereby providing users with a more realistic and rich visual experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 This is a flow chart of a method for realizing a two-in-one starry sky lamp based on a projector disclosed in this application.

[0048] Figure 2 This is a timing diagram of a method for realizing a two-in-one starry sky light based on a projector disclosed in this application. DETAILED DESCRIPTION

[0049] The following embodiments of the present invention are described in further detail with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.

[0050] like Figure 1-Figure 2 The present invention provides a method for realizing a two-in-one starry sky lamp based on a projector, comprising the following steps:

[0051] Step S100: receiving a starry sky screen saver mode selected by a user;

[0052] In this step, the system interface provides multiple starry sky screensaver options for the user to choose from. When the user selects a specific starry sky screensaver mode through a click or other input method through the interface, the system will record the selection for subsequent processing. For example, if the user selects "Aurora Mode" through a smartphone app or a projector remote control, the system will receive this instruction.

[0053] Step S200: Reading a pre-stored image or video file to obtain video frame information;

[0054] Once the user selects the starry sky screensaver mode, the system accesses internal or cloud storage to retrieve the image or video file associated with the selected mode. The system then parses the video file frame by frame, extracting the image data for each frame. This frame information serves as the basic input for subsequent image processing. For example, the system reads a video containing a night sky scene and prepares to process each frame.

[0055] Step S300: Apply the wave function to generate a wave effect through a sine function;

[0056] In this step, the system uses a sine function to generate a dynamic wave effect, which simulates the changes in natural phenomena such as the aurora. By adjusting the parameters of the sine function, waves of different frequencies and amplitudes can be generated. The specific formula is as follows:

[0057]

[0058] For example, for each pixel point (x, y), the current fluctuation value is calculated based on the time variable time, thus forming a dynamic change effect.

[0059] Step S400: using the fluctuation value to adjust the brightness of the RGB channels to simulate the aurora effect;

[0060] Based on the fluctuation value generated in the previous step, the system adjusts the brightness of the RGB color channels of each pixel to simulate the gradient effect of the aurora. Specifically, the fluctuation value wave is used to adjust the brightness of each RGB channel:

[0061]

[0062]

[0063]

[0064]

[0065] Where wave is the fluctuation coefficient, x is in the range [0, cols], cols represents the image or video frame length, y is in the range [0, rows], cows represents the image or video frame width, the time variable is used to dynamically change the aurora effect to simulate the movement of the aurora, and aurora[y,x] represents the RGB value of the pixel in the processed image frame.

[0066] In this way, the color value of each pixel in the generated new image is adjusted accordingly according to the fluctuation value, forming a dynamic aurora effect.

[0067] Step S500: synthesize the aurora effect with the original image or video frame through the image processing library, and adjust the intensity of the synthesis;

[0068] Use image processing libraries such as OpenCV to synthesize the generated aurora effect with the original image or video frame. By adjusting the synthesis weight, different degrees of fusion effect can be achieved:

[0069]

[0070] in, Represents each video frame, 0.7, 0.3 coefficients are image blending weights, the blending weights depend on the original image, the projector screen PQ effect, and the lens effect to take the optimal parameters, To process the synthesized frame image.

[0071] In this example, the original image accounts for 70% of the weight, and the newly generated aurora effect accounts for 30%. The resulting image retains the original details while adding the aurora effect. At the same time, Gaussian blur can be applied to make the effect more natural.

[0072]

[0073] Among them, (5,5) is the convolution kernel size, that is, the neighborhood size, and the operation is performed on the 5 * 5 neighborhood with the center point as the center.

[0074] Step S600: loop through each frame of the video, apply the algorithm, and display the processed frame;

[0075] The system enters loop mode and performs the aforementioned processing on each frame of the video, including fluctuation value generation, RGB adjustment, and synthesis operations. After processing is completed, each frame is displayed in sequence, creating a continuous dynamic effect.

[0076] Step S700: Adjust the imaging distance of the projector motor lens to enable the projector to achieve the best starry sky light imaging effect.

[0077] Finally, the system adjusts the projector's motor and lens, altering its imaging distance and focal length to ensure the projected image is optimal for the specific environment. This adjustment can occur automatically based on parameters such as room size and distance from the wall. Users can fine-tune the projection effect through simple interface controls to best suit their needs. Ultimately, the projector displays the optimal starry sky light effect, delivering a realistic visual experience.

[0078] In this embodiment, the aurora effect is synthesized with the original image or video frame through the addWeighted function in the OpenCV library.

[0079] Main formulas used by other effects:

[0080] When looping through each frame of the image, the star effect is synthesized and the stars are generated using the following formula:

[0081]

[0082] in, is the function name used to draw a circle on the image; an image matrix representing a starry sky or other background; represents the coordinates of the center of the circle; Represents the radius of the circle, used to generate a random integer between 1 and 3; An object representing a color; Indicates converting color values ​​into a format suitable for image library processing; Indicates that the circle should be completely filled.

[0083] When looping through each frame of the image, a meteor effect is synthesized and the meteor is generated using the following formula:

[0084] in, is the function name used to draw lines on the image. Represents the image layer used to draw the meteor effect; Is a tuple representing the coordinates of the starting point of the line; Is a tuple representing the end point coordinates of the line. Refers to the starting point Increase in horizontal direction ) unit's location.

[0085] When looping and reading each frame of the image, the Variant Mirror effect is synthesized and the Variant Mirror is generated by the following formula:

[0086] in, is the name of a function that recalculates the position of each pixel in the image according to the given mapping function; Represents the original image to be processed; Is a mapping array that specifies the horizontal coordinate of each output pixel in the original image; Is a mapping array that specifies the vertical coordinate of each output pixel in the original image; Specify the interpolation method used during image remapping; Defines how to handle images outside the bounds.

[0087] Preferably, after the user selects the starry sky screensaver, a randomly changing starry sky effect is dynamically generated in real time based on the pictures and videos.

[0088] This solution combines a projector with a dynamic starry sky light effect to create a two-in-one solution. It works by reading pre-stored images or video files based on the user's selected starry sky screen saver mode, then applying a sine function to generate a wave effect, simulating natural phenomena such as the aurora. The system changes the brightness of the RGB channels by adjusting the wave value, and uses the image processing library to synthesize the generated aurora effect with the original image or video frame. This synthesis process adjusts the effect based on the set intensity parameters, so that each frame presents a dynamically changing starry sky visual experience. Finally, by looping through each frame of the video and displaying it in real time, as well as adjusting the projector's lens and imaging distance, the output image ensures that the optimal starry sky light effect is achieved in different environments, providing users with a realistic and rich visual experience.

[0089] The sine function parameters (such as frequency and amplitude) used to generate the aurora effect need to be adjusted according to the actual situation. The specific adjustment steps are as follows:

[0090] Collect data on relevant aurora images or videos and analyze their characteristics such as frequency, color distribution, and brightness changes.

[0091] Determine the subjective experience at different frequencies and amplitudes through visual perception experiments (such as user testing).

[0092] Based on the above data, determine the initial ranges for the frequency and amplitude parameters of the sine function. For example, the frequency can be set to 0.1 to 10 Hz, and the amplitude can be set to 0 to 255 (for 8-bit RGB channels).

[0093] An interactive tuning interface allows users to adjust frequency and amplitude in real time and observe the resulting aurora effects. User feedback is recorded to determine which parameter combinations produce the best visual effects.

[0094] Implement automated parameter tuning algorithms, such as particle swarm optimization (PSO) or genetic algorithms (GA), to quickly find the optimal solution in a large parameter space.

[0095] Test under different ambient light conditions to verify whether the selected parameters can maintain good visual effects in various scenes.

[0096] If there is a significant difference, consider introducing an ambient light sensor to dynamically adjust the frequency and amplitude based on the real-time detected ambient light intensity.

[0097] By synthesizing all test results, a set of globally optimal parameters can be determined, or parameter sets can be defined for different usage scenarios. These parameters can be pre-stored in the system, allowing users to manually select or automatically switch between them. User feedback and new aurora data are regularly collected to continuously optimize the parameters. A self-learning mechanism is developed to continuously improve the intelligence of parameter selection through machine learning models.

[0098] Specific steps of the projector lens adjustment mechanism:

[0099] When installing a projector, perform an initial calibration. Measure the distance and angle between the projector and the projection surface. Determine the size and position of the projection area, and record the initial imaging distance.

[0100] Use ultrasonic sensors or laser rangefinders to measure the distance between the projector and the projection surface in real time. The measured distance data is input into the control system for adjusting the lens focus.

[0101] A precision stepper motor drives the lens adjustment mechanism, ensuring high precision in minute adjustments. The required number of steps is calculated based on the measured distance and the focal length of the lens (for example, using the formula: focal length = fixed focal length factor * projection distance).

[0102] A closed-loop control system is implemented, with sensors providing real-time feedback on the current focus state. If the image is detected to be unclear or off-focus, the system automatically adjusts the motor to achieve the desired focus.

[0103] Incorporating image processing technology, the projected image clarity is monitored in real time (e.g. using edge detection algorithms). When blur is detected, the autofocus function is triggered, ensuring a clear image even if external distance measurement errors occur.

[0104] Provide a user interface that allows users to manually fine-tune focus. If the user feels that the automatic adjustment is not ideal, they can fine-tune the focus using the buttons on the interface. Save the user's manual adjustment history to improve the autofocus algorithm.

[0105] During system operation, self-tests and recalibration are performed regularly to compensate for errors caused by mechanical wear and environmental changes. Users are reminded to regularly inspect and maintain the equipment to ensure long-term stable operation.

[0106] By implementing these steps, appropriate fluctuation parameters can be effectively selected and precise lens adjustment can be achieved, thereby improving the overall system performance and user experience.

[0107] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for realizing a two-in-one starry sky light based on a projector, characterized in that: The following steps are involved: Receive the starry sky screen saver mode selected by the user; Read pre-stored image or video files to obtain image or video frame information; The following formula is used to adjust the wave effect: ; Use the fluctuation coefficient to adjust the brightness of the RGB channels to simulate the aurora effect; and adjust the brightness of the RGB channels using the following formula: Where wave is the fluctuation coefficient, x is in the range [0, cols], where cols represents the image or video frame length, and y is in the range [0, rows], where rows represents the image or video frame width. The time variable is used to dynamically change the aurora effect to simulate the movement of the aurora. That is, for each pixel (x, y), the current fluctuation coefficient is calculated based on the time variable time, thereby creating a dynamic effect. aurora[y,x] represents the RGB value of the pixel in the processed image frame. Use the image processing library to combine the aurora effect with pictures or video frames and adjust the intensity of the combination; The aurora effect is synthesized with the picture or video frame through the addWeighted function in the OpenCV library; The aurora effect is synthesized on the picture using the following formula: in, Represents each video frame, 0.7, 0.3 coefficients are image blending weights, which are optimized based on the original image, projector image quality parameters, and lens effects to determine the optimal parameters. To process the synthesized frame image; Loop through each frame of an image or video, apply the algorithm, and display the processed image or video frame; Adjust the projector motor to adjust the lens imaging distance so that the projector can achieve the best starry sky light imaging effect.

2. A method for realizing a two-in-one starry sky light based on a projector as claimed in claim 1, characterized in that: The following steps are also included: When looping through each frame of the image, a meteor effect is synthesized and the meteor is generated using the following formula: in, is the function name used to draw lines on the image. Represents the image layer used to draw the meteor effect; Is a tuple representing the coordinates of the starting point of the line; Is a tuple representing the end point coordinates of the line. Refers to the starting point Increase in horizontal direction The location of the unit.

3. The method for realizing a two-in-one starry sky light based on a projector according to claim 1, characterized in that: The following steps are also included: When looping through each frame of the image, the star effect is synthesized and the stars are generated using the following formula: in, is the name of the function used to draw a circle on the image; an image matrix representing a starry sky or other background; represents the coordinates of the center of the circle; Represents the radius of the circle, used to generate a random integer between 1 and 3; An object representing a color; Indicates converting color values ​​into a format suitable for image library processing; Indicates that the circle should be completely filled.

4. A method for realizing a two-in-one starry sky light based on a projector as claimed in claim 3, characterized in that: Before looping through each frame of the video, Gaussian blur processing is also applied. When applying the following Gaussian blur processing formula, the convolution kernel size used is (5, 5): Among them, (5,5) is the convolution kernel size, that is, the neighborhood size, and the operation is performed on the 5 * 5 neighborhood centered on the center point.

5. The method for realizing a two-in-one starry sky light based on a projector according to claim 1, characterized in that: The following steps are also included: When looping and reading each frame of the image, the Variant Mirror effect is synthesized and the Variant Mirror is generated by the following formula: in, is the name of a function that recalculates the position of each pixel in the image according to the given mapping function; Represents the original image to be processed; Is a mapping array that specifies the horizontal coordinate of each output pixel in the original image; Is a mapping array that specifies the vertical coordinate of each output pixel in the original image; Specify the interpolation method used during image remapping; Defines how to handle images outside the bounds.

6. The method for realizing a two-in-one starry sky light based on a projector according to claim 1, characterized in that: After the user selects the starry sky screensaver, a randomly changing starry sky effect is generated in real time based on pictures and videos.

Citation Information

Patent Citations

  • Aurora animation generation method and device, storage medium and electronic device

    CN116778047A

  • Starry sky projector

    CN217113025U