Method for realizing two-in-one of starry sky lamp based on projector
By receiving the user-selected starry sky screensaver mode on the projector, reading the video file and applying a sine function to generate a fluctuation effect, combining the image processing library to synthesize the aurora effect, the problem of inaccurate starry sky light effects in the existing technology is solved, and projection is realized The instrument itself independently generates dynamic starlight effects, improving the convenience and visual experience of the equipment.
Patent Information
- Application Number
- CN202411337966.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The prior art cannot achieve the starlight effect based on the projector itself, and relies on external optical accessories, resulting in the light and shadow effects not realistic enough and cannot be synthesized in real time, limiting the convenience and scope of application of the equipment.
By receiving the starry sky screensaver mode selected by the user, reading pre-stored pictures or video files, applying a sine function to generate fluctuations, adjusting the brightness of the RGB channel, synthesize the aurora effect using the image processing library, and adjusting the imaging distance of the projector motor lens to achieve dynamic changes starlight effect.
Eliminates the dependence on external optical accessories and provides realistic and dynamic starlight effects, allowing each device to present a ever-changing visual experience at different time points, enhancing the user's visual experience.
Smart Images

Figure CN119182891A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of optical accessories, and in particular to a method for realizing a two-in-one starry sky lamp based on a projector. Background Art
[0002] Star lights and projectors currently on the market usually achieve their respective functions through specially designed equipment. Even if there are some two-in-one solutions, these solutions also require the help of external optical accessories to achieve the desired effect. For example, combining a star light and a projector together requires additional lenses, filters and other auxiliary equipment to achieve specific light and shadow effects.
[0003] However, the existing technology has some defects: Reliance on external optical accessories: These devices are unable to achieve complex light and shadow effects independently, which greatly limits their convenience and scope of application.
[0004] Lack of a two-in-one solution for projector-based starry sky lights: There is currently no solution that uses the optical system of the projector itself to directly achieve the starry sky light effect.
[0005] 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.
[0006] 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
[0007] 1. Technical issues to be resolved The present invention mainly aims at the above problems and proposes a method of 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.
[0008] (II) Technical solution To achieve the above object, the present invention provides a method for realizing a two-in-one starry sky light based on a projector, comprising the following steps: Receive the starry sky screen saver mode selected by the user; Read pre-stored pictures or video files to obtain video frame information; Apply the wave function to generate a wave effect through the sine function; Use the fluctuation value to adjust the brightness of the RGB channels to simulate the aurora effect; Use the image processing library to combine the aurora effect with the original image or video frame and adjust the intensity of the combination; Loop through each frame of the video, apply the algorithm, and display the processed frame; Adjust the imaging distance of the projector motor lens to achieve the best starry sky light imaging effect.
[0009] Furthermore, the aurora effect is synthesized with the original image or video frame through the addWeighted function in the OpenCV library.
[0010] Furthermore, the wave effect is generated by the following formula: And adjust the brightness of the RGB channels by the following formula: Where wave is the wave coefficient, x is [0, cols], cols represents the image or video frame length, y is [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 point of the processed image frame.
[0011] Furthermore, before the step of looping and processing 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 with the center point as the center.
[0012] Furthermore, the method further comprises the following steps: 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 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; Represents the conversion of color values into a format suitable for image library processing; Indicates that the circle should be completely filled.
[0013] Furthermore, the method further comprises the following steps: When looping and reading each frame of the image, the meteor effect is synthesized and the meteor is generated by 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; It is a tuple representing the coordinates of the starting point of the line; Is a tuple, indicating the end point coordinates of the line. From the starting point Increase in horizontal direction ) unit’s location.
[0014] Furthermore, the method further comprises the following steps: When looping and reading each frame of the image, the V-mirror effect is synthesized and the V-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 coordinates 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.
[0015] 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.
[0016] Furthermore, the aurora effect is synthesized on the original image through the following formula: in, Represents each video picture frame, 0.7, 0.3 coefficients are image mixing weights, the mixing 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.
[0017] (III) Beneficial effects Compared with the prior art, the method provided by the present invention realizes 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 a single and unrealistic picture, and enables each device to present an ever-changing starry sky light effect at different time points, thereby providing users with a more realistic and rich visual experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flow chart of a method for realizing a two-in-one starry sky light based on a projector disclosed in this application.
[0019] 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
[0020] The specific implementation of the present invention is further described in detail below in conjunction with 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.
[0021] 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: Step S100, receiving a starry sky screen saver mode selected by a user; In this step, the system interface provides multiple starry sky screen saver options for users to choose from. When the user selects a specific starry sky screen saver mode through the interface by clicking or other input methods, the system will record the selection for subsequent processing. For example, if the user selects "Aurora Mode" through a smartphone application or a projector remote control, the system will receive this instruction.
[0022] Step S200: reading a pre-stored picture or video file to obtain information of a video frame; Once the user selects the starry sky screen saver mode, the system will access the internal storage or cloud storage location to read the picture or video file related to the selected mode. Then, the system will parse the video file frame by frame and extract the image data of each frame. These frame information will serve 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.
[0023] Step S300, applying a wave function to generate a wave effect through a sine function; In this step, the system uses the sine function to generate a dynamic wave effect, which simulates the changes of 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: For example, for each pixel point (x, y), the current fluctuation value is calculated according to the time variable time, thus forming a dynamic change effect.
[0024] Step S400, using the fluctuation value to adjust the brightness of the RGB channels to simulate the aurora effect; 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: Where wave is the wave coefficient, x is [0, cols], cols represents the image or video frame length, y is [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 point of the processed image frame.
[0025] 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.
[0026] Step S500, synthesizing the aurora effect with the original image or video frame through the image processing library, and adjusting the intensity of the synthesis; 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: in, Represents each video picture frame, 0.7, 0.3 coefficients are image mixing weights, the mixing 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.
[0027] In this example, the original image accounts for 70% of the weight, and the newly generated aurora effect accounts for 30% of the weight. The synthesized image retains the original details and adds the aurora effect. At the same time, Gaussian blur can be applied to make the effect more natural.
[0028] 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.
[0029] Step S600, loop through each frame of the video, apply the algorithm, and display the processed frame; The system enters loop mode and performs the above processing on each frame in the video, including fluctuation value generation, RGB adjustment and synthesis operation. After the processing is completed, each frame of the image is displayed in sequence to form a continuous dynamic effect.
[0030] Step S700, adjusting the imaging distance of the projector motor lens to enable the projector to achieve the best starry sky light imaging effect.
[0031] Finally, the system adjusts the projector's motor and lens, changing its imaging distance and focal length to ensure that the projected image can achieve the best effect in a specific environment. This adjustment may be made automatically based on specific parameters such as room size and wall distance. Users can fine-tune the projection effect through simple interface control to make it more in line with actual needs. Finally, the projector displays the most optimized starry sky light effect to achieve a realistic visual experience.
[0032] In this embodiment, the aurora effect is synthesized with the original image or video frame through the addWeighted function in the OpenCV library.
[0033] Main formulas used by other effects: 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 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; Represents the conversion of color values into a format suitable for image library processing; Indicates that the circle should be completely filled.
[0034] When looping and reading each frame of the image, the meteor effect is synthesized and the meteor is generated by 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; It is a tuple, indicating the coordinates of the starting point of the line; Is a tuple, indicating the coordinates of the end point of the line, From the starting point Increase in horizontal direction ) unit’s location.
[0035] When looping and reading each frame of the image, the V-mirror effect is synthesized and the V-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 coordinates 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.
[0036] 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.
[0037] This solution combines a projector with a dynamic starry sky light effect to achieve a two-in-one solution. The principle is to read the pre-stored picture or video file based on the starry sky screen saver mode selected by the user, and then apply the sine function to generate a wave effect to simulate 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. The synthesis process adjusts the effect according to the set intensity parameters, so that each frame of the image presents a dynamically changing starry sky visual experience. Finally, by looping each frame of the video and displaying it in real time, as well as adjusting the lens and imaging distance of the projector, it is ensured that the output picture can achieve the best starry sky light effect in different environments, thereby providing users with a realistic and rich visual experience.
[0038] 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: Collect data on relevant aurora pictures or videos and analyze their characteristics such as frequency, color distribution, and brightness changes.
[0039] Determine the subjective experience at different frequencies and amplitudes through visual perception experiments (such as user testing).
[0040] Based on the above data, determine the initial range of the sine function frequency parameter and amplitude parameter. 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).
[0041] Use an interactive tuning interface that allows users to adjust frequency and amplitude in real time and observe the resulting aurora effects. Record user feedback to determine which parameter combinations produce the best visual effects.
[0042] 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.
[0043] Test under different ambient light conditions to verify whether the selected parameters can maintain good visual effects in various scenes.
[0044] If there is a significant difference, consider introducing an ambient light sensor to dynamically adjust the frequency and amplitude based on the ambient light intensity detected in real time.
[0045] Determine a set of globally optimal parameters by synthesizing all test results, or define parameter sets for different usage scenarios. These parameters can be pre-stored in the system, allowing users to manually select or automatically switch. Regularly collect user feedback and new aurora data to continuously optimize parameters. Develop a self-learning mechanism to continuously improve the intelligent level of parameter selection through machine learning models.
[0046] Specific steps of projector lens adjustment mechanism: When installing the projector, perform an initial calibration. Measure the distance and angle from the projector to the projection surface. Determine the size and location of the projection area and record the initial imaging distance.
[0047] Use ultrasonic sensors or laser distance sensors to measure the distance from the projector to the projection surface in real time. Input the measured distance data into the control system to adjust the lens focus.
[0048] Equipped with a precision stepper motor to drive the lens adjustment mechanism, ensuring that the tiny steps of adjustment can achieve high accuracy. The number of steps required is calculated based on the measured distance and the focal length relationship of the lens (for example, using the formula: focal length = fixed focal length factor * projection distance).
[0049] A closed-loop control system is implemented, and the current focus state is fed back in real time through the sensor. If the image is detected to be unclear or deviated from the target focus, the system automatically adjusts the motor to achieve the expected focus.
[0050] Combined with image processing technology, the clarity of the projected image is monitored in real time (for example, using edge detection algorithms). When blurry images are detected, the autofocus function is triggered to ensure a clear image even if the external distance measurement is wrong.
[0051] Provide a user interface to allow users to manually fine-tune the focus. If the user feels that the automatic adjustment is not ideal, the user can fine-tune the focus through the interface buttons. Save the user's manual adjustment records to improve the automatic focus algorithm.
[0052] During system operation, self-check and recalibration are performed regularly to compensate for errors caused by mechanical wear and environmental changes. Users are reminded to regularly check and maintain the equipment to ensure long-term stable operation.
[0053] By implementing these steps, appropriate fluctuation parameters can be effectively selected and precise lens adjustment can be achieved, thus improving the overall system performance and user experience.
[0054] 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 pictures or video files to obtain video frame information; Apply the wave function to generate a wave effect through the sine function; Use the fluctuation value to adjust the brightness of the RGB channels to simulate the aurora effect; Use the image processing library to combine the aurora effect with the original image or video frame and adjust the intensity of the combination; Loop through each frame of the video, apply the algorithm, and display the processed frame; Adjust the imaging distance of the projector motor lens to 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 aurora effect is synthesized with the original image or video frame through the addWeighted function in the OpenCV library.
3. A method for realizing a two-in-one starry sky light based on a projector as claimed in claim 1, characterized in that: The wave effect is generated by the following formula: And adjust the brightness of the RGB channels by the following formula: Where wave is the wave coefficient, x is [0, cols], cols represents the image or video frame length, y is [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 point of the processed image frame.
4. A method for realizing a two-in-one starry sky light based on a projector as claimed in claim 1, 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 with the center point as the center.
5. 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, the star effect is synthesized and the stars are generated using the following formula: 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; Represents the conversion of color values into a format suitable for image library processing; Indicates that the circle should be completely filled.
6. 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 and reading each frame of the image, the meteor effect is synthesized and the meteor is generated by 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; It is a tuple representing the coordinates of the starting point of the line; Is a tuple, indicating the coordinates of the end point of the line, From the starting point Increase in horizontal direction ) unit’s location.
7. 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 and reading each frame of the image, the V-mirror effect is synthesized and the V-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 coordinates 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.
8. The method for realizing two-in-one starry sky lamp based on projector as claimed in claim 1, characterized in that: After the user selects the starry sky screensaver, a randomly changing starry sky effect is dynamically generated in real time based on pictures and videos.
9. A method for realizing a two-in-one starry sky light based on a projector as claimed in claim 1, characterized in that: The aurora effect is synthesized on the original image using the following formula: in, Represents each video picture frame, 0.7, 0.3 coefficients are image mixing weights, the mixing 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.
Citation Information
Patent Citations
Aurora animation generation method and device, storage medium and electronic device
CN116778047A
Artistic atmosphere lamp for simulating starry sky scene
CN116906847A
Starry sky projector
CN217113025U
Virtual aurora illumination system
JP2008052963A
Video projection system
JP2008288714A
