Projector automatic focusing method based on spectrum sensor and related equipment

By using spectral sensors and inertial measurement units in the projection equipment, combined with the adaptive step size control strategy, high-precision automatic focus of the projector is achieved, solving the problem of decreasing focus accuracy in the existing technology, and improving the clarity of the projected picture .

CN119484789AActive Publication Date: 2025-02-18SHENZHEN EFERCRO ELECTRONIC TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411553328.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-18
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

In the case of dark ambient light or irregular projection surfaces, existing projection equipment is difficult to accurately obtain image contrast information, resulting in a decrease in focus accuracy and reducing the clarity of the projected image.

Method used

Using the automatic focus method of the projector based on the spectral sensor, the reflected light signal of the projection surface is collected through the spectral sensor and wavelength decomposed. Combined with the data of the inertial measurement unit, the actual projection distance between the projector and the projection surface is calculated, and through adaptation The step length control strategy realizes closed-loop iterative focus.

Benefits of technology

It improves the accuracy of the projector's automatic focus, enhances the focus speed, ensures the clarity of the projected image, and maintains a stable focus effect even in the case of ambient light changes or irregular projection surfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484789A_ABST
    Figure CN119484789A_ABST
Patent Text Reader

Abstract

The invention discloses a projector automatic focusing method based on a spectrum sensor and related equipment, and the method comprises the steps: carrying out the wavelength decomposition of a reflected light signal, and obtaining a light intensity value; calculating an initial distance value between the projector and the projection surface; carrying out integral operation on the acceleration data and the angular velocity data to obtain a position offset and an attitude angle offset; determining a compensation distance, and calculating an actual projection distance; controlling a stepping motor to drive a lens assembly to move to a focusing position corresponding to the target focal length value; controlling a stepping motor to drive a lens assembly to reciprocate; a new reflected light signal is collected again after each reciprocating motion; processing the new reflected light signal based on a preset mapping model to obtain a current measurement distance; and when the deviation value between the current measurement distance and the preset optimal imaging distance is smaller than a preset threshold value for the first time, determining the focusing position corresponding to the final measurement distance as a final focusing position. The automatic focusing precision of the projector is improved, and the definition of a projection picture is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of autofocus, and in particular to a projector autofocus method based on a spectral sensor and related equipment. Background Art

[0002] A projection device is a display device that converts electronic signals into visual images and projects them onto a projection surface. Existing projection devices require focusing the projected image during use to obtain a clear display effect. The traditional focusing method mainly uses a manual adjustment of the focus ring, which is not only cumbersome to operate, but also difficult to achieve accurate focusing.

[0003] In the related art, an automatic focusing solution for projection equipment based on image contrast can be used. This solution is achieved by setting an image sensor in the projection equipment to capture the projection screen, and performing edge detection on the captured image to obtain the image contrast value. The stepper motor is then controlled to move the lens assembly, and the change in the image contrast value is calculated in real time during the movement. When it is detected that the image contrast value reaches the maximum, the current lens position is determined to be the optimal focus position, thereby completing the automatic focusing process.

[0004] However, in the case of dim ambient light or an irregular projection surface, this solution will cause a decrease in focusing accuracy due to the difficulty in accurately obtaining image contrast information, thereby reducing the clarity of the projected image. Summary of the invention

[0005] The present application provides a projector autofocus method based on a spectral sensor and related equipment, which are used to improve the accuracy of the projector autofocus and thus improve the clarity of the projected image.

[0006] In the first aspect, the present application provides a projector autofocus method based on a spectral sensor. After controlling the light source module to emit a light signal of a preset wavelength band to a projection surface, a spectral sensor disposed at a projector lens assembly collects a reflected light signal of the projection surface, and decomposes the reflected light signal by wavelength to obtain light intensity values ​​of different wavelengths. Based on the preset mapping model, the initial distance value between the projector and the projection surface is calculated according to the light intensity values ​​of different wavelengths; Acquire acceleration data and angular velocity data collected by an inertial measurement unit disposed in the projector within a preset sampling period, and perform integration operation on the acceleration data and the angular velocity data to obtain a position offset and an attitude angle offset of the projector in three-dimensional space; The initial distance value is used as the reference value, and the compensation distance of the projector's spatial posture change is determined in combination with the position offset and the attitude angle offset, and the actual projection distance of the projector relative to the projection surface is calculated based on the compensation distance; Determine a target focal length value that matches the actual projection distance, and control the stepper motor to drive the lens assembly to move to a focus position corresponding to the target focal length value; Controlling the stepper motor to drive the lens assembly to reciprocate according to an adaptive step value, wherein the adaptive step value is determined according to a deviation between a current position and a focus position; After each reciprocating movement, the light source module is triggered to re-emit a light signal of a preset wavelength band and a new reflected light signal is collected through a spectrum sensor; Process the new reflected light signal based on the preset mapping model to obtain the current measured distance; When the deviation value between the current measurement distance and the preset optimal imaging distance is less than the preset threshold value for the first time, the corresponding current measurement distance is determined as the final measurement distance; The focus position corresponding to the final measured distance is determined as the final focus position, and the stepper motor is controlled to drive the lens assembly to move to the final focus position.

[0007] By adopting the above technical solution, the spectral sensor collects the reflected light signal of the projection surface and performs wavelength decomposition to obtain the light intensity values ​​of different wavelengths. The initial distance value is calculated using the preset mapping model, which can reduce the influence of ambient light interference. The acceleration data and angular velocity data are collected in real time by the inertial measurement unit and integrated to obtain the position offset and attitude angle offset of the projector in three-dimensional space. The compensation distance is calculated in combination with the initial distance value, which can accurately track the spatial posture change of the projector. The adaptive step control strategy is used to drive the lens assembly to move back and forth, and the reflected light signal is re-collected and the measured distance is updated by continuously triggering the light source module until the preset optimal imaging distance is reached. This closed-loop iterative focusing method can reduce the over-adjustment and under-adjustment problems that are prone to occur in traditional fixed step focusing methods, and improve the focusing accuracy and focusing speed. The dual distance measurement mechanism of spectral sensing and inertial measurement can verify and compensate each other, improve the reliability of the distance measurement results, and maintain a stable focusing effect even when the projector shakes. The present application improves the accuracy of the projector's automatic focus, thereby improving the clarity of the projected image.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, before performing wavelength decomposition on the reflected light signal, the method further includes: Calculating the signal-to-noise ratio of the acquired reflected light signal; When the signal-to-noise ratio is less than a preset signal-to-noise ratio threshold, the light power of the light source module is increased, and the reflected light signal is collected again; Digitally filtering the recollected reflected light signal to obtain a filtered reflected light signal; The filtered reflected light signal is decomposed by wavelength.

[0009] By adopting the above technical solution, the signal-to-noise ratio of the reflected light signal is calculated and compared with the preset signal-to-noise ratio threshold. When the signal-to-noise ratio is low, the signal quality is improved by increasing the luminous power of the light source module. This adaptive light source control method can ensure that effective reflected light signals can be obtained under different ambient light interference conditions. Digital filtering of the re-collected reflected light signal can further suppress the influence of random noise, improve the signal-to-noise ratio of the signal, and improve the measurement accuracy of light intensity values ​​of different wavelengths. Since the accuracy of spectral ranging directly affects the calculation result of the initial distance value, and the initial distance value is the basis for subsequent compensation distance calculation, the reliability of the entire autofocus process can be improved. By adaptively adjusting the light source power, power consumption can be reduced as much as possible while ensuring measurement accuracy, thereby improving the energy efficiency of the system.

[0010] In combination with some embodiments of the first aspect, in some embodiments, based on a preset mapping model, calculating the initial distance value between the projector and the projection surface according to light intensity values ​​of different wavelengths specifically includes: Normalizing the light intensity values ​​of different wavelengths to obtain normalized light intensity values; Constructing a feature vector, the feature vector includes a normalized light intensity value, a light intensity difference value of adjacent wavelengths, and a kurtosis value of a spectrum curve; The feature vector is input into the preset mapping model to obtain the distance value, and the distance value is smoothed based on the Kalman filter algorithm to obtain the initial distance value.

[0011] By adopting the above technical solution, the light intensity values ​​of different wavelengths are normalized, which can eliminate the absolute value influence caused by the fluctuation of light source intensity and the change of ambient light intensity, and improve the stability of measurement. By constructing a feature vector containing the normalized light intensity value, the difference of light intensity of adjacent wavelengths and the peak value of the spectral curve, the multi-dimensional feature information of the spectral data is fully utilized. This multi-feature fusion method can improve the robustness of distance calculation. The feature vector is input into the preset mapping model to realize the rapid mapping from spectral features to distance values, avoiding the complex theoretical calculation process. The Kalman filtering algorithm is used to smooth the distance value, which can effectively suppress the random fluctuations in the measurement process and obtain a smoother and more stable initial distance value. This distance calculation method based on multi-dimensional features and filtering algorithms not only ensures the calculation efficiency, but also improves the reliability of the calculation results, and provides an accurate reference value for the subsequent compensation distance calculation.

[0012] In combination with some embodiments of the first aspect, in some embodiments, after acquiring the acceleration data and angular velocity data collected by the inertial measurement unit disposed in the projector within a preset sampling period, the method further includes: Detecting an average temperature value, an average humidity value, and an average atmospheric pressure value of the inertial measurement unit within a preset time period; Establish an environmental parameter impact model based on average temperature, average humidity and average atmospheric pressure values; Determine the acceleration compensation matrix and the angular velocity compensation matrix according to the environmental parameter influence model; Correcting the acceleration data and the angular velocity data using the acceleration compensation matrix and the angular velocity compensation matrix; The zero bias estimation and scale factor correction are performed on the corrected acceleration data and angular velocity data.

[0013] By adopting the above technical solution, detecting parameters such as temperature, humidity and atmospheric pressure of the environment in which the inertial measurement unit is located, and establishing an environmental parameter influence model, the influence of environmental factors on the measurement accuracy of the inertial sensor can be quantitatively analyzed. Based on the environmental parameter influence model, the acceleration compensation matrix and angular velocity compensation matrix are determined, and the original measurement data is corrected. This environmental adaptability compensation mechanism can reduce the measurement errors caused by environmental factors such as temperature drift and humidity changes. By performing zero bias estimation and scale factor correction on the corrected data, the system error of the sensor itself is further eliminated. This multi-level data correction mechanism enables subsequent integral operations to be performed based on more accurate acceleration data and angular velocity data, thereby improving the calculation accuracy of position offset and attitude angle offset.

[0014] In combination with some embodiments of the first aspect, in some embodiments, the acceleration data and the angular velocity data are integrated to obtain the position offset and attitude angle offset of the projector in the three-dimensional space, specifically including: The corrected acceleration data and angular velocity data are respectively input into the convolutional neural network for feature extraction to obtain corresponding acceleration data features and angular velocity data features; Establish state observation equations and state transfer equations based on acceleration data characteristics and angular velocity data characteristics; The unscented Kalman filter algorithm is used to solve the state observation equation and the state transfer equation to obtain the preliminary pose estimation value; Performing gravity compensation on the preliminary pose estimation value in combination with a preset acceleration reference value to obtain a compensated pose estimation value; The acceleration component in the compensated pose estimation value is double integrated to obtain the initial position offset; the angular velocity component in the compensated pose estimation value is integrated to obtain the initial attitude angle offset; Based on the complementary filtering algorithm, the initial position offset and the initial attitude angle offset are fused and corrected to obtain the position offset and attitude angle offset respectively.

[0015] By adopting the above technical solution, the corrected acceleration data and angular velocity data are input into the convolutional neural network for feature extraction, which can extract more representative feature information from the original data and effectively reduce the influence of data noise. Based on the extracted features, the state observation equation and the state transfer equation are established, and the unscented Kalman filter algorithm is used to solve them. This processing method based on the state space model can effectively fuse multi-source data and improve the accuracy of posture estimation. By introducing a preset acceleration reference value for gravity compensation, the influence of gravity acceleration on the measurement results can be eliminated. The compensated posture estimation values ​​are integrated separately, where the acceleration component uses double integration to obtain the position offset, and the angular velocity component uses a single integration to obtain the attitude angle offset. This separate processing method can reduce the cumulative effect of the integral error. Finally, the initial offset is fused and corrected by the complementary filtering algorithm, which can make full use of the complementary characteristics of the two data, maintain the long-term stability of the acceleration data, and retain the fast response characteristics of the angular velocity data, so as to obtain more accurate position offset and attitude angle offset.

[0016] In combination with some embodiments of the first aspect, in some embodiments, the initial distance value is used as a reference value, and the compensation distance of the projector spatial posture change is determined in combination with the position offset and the posture angle offset, specifically including: Construct a projection geometry transformation matrix, which includes a translation matrix corresponding to the position offset and a rotation matrix corresponding to the attitude angle offset; Get the optical axis vector and projection surface normal vector of the projector; Calculate the spatial transformation result of the optical axis vector under the projection geometric transformation matrix based on the quaternion algorithm; According to the angle between the spatial transformation result and the normal vector of the projection surface, the deflection angle of the projection light path is calculated; Use ray tracing algorithm to simulate the optical path difference corresponding to the deflection angle; The optical path difference is vector-superimposed with the initial distance value to obtain the compensation distance.

[0017] By adopting the above technical solution, a projection geometric transformation matrix including a translation matrix and a rotation matrix is ​​constructed, which can accurately describe the position and posture changes of the projector in three-dimensional space. The spatial transformation result is calculated using the quaternion algorithm in combination with the optical axis vector of the projector and the normal vector of the projection surface. This quaternion-based calculation method can avoid the gimbal lock problem in the traditional Euler angle representation method and improve the stability of posture calculation. By calculating the angle between the transformed optical axis vector and the normal vector of the projection surface, the deflection angle of the projection light path can be accurately obtained. The ray tracing algorithm is used to simulate the optical path difference corresponding to the deflection angle. This simulation method based on the principle of physical optics can accurately reflect the impact of the change in the projector's posture on the projection distance. The simulated optical path difference is vector-superimposed with the initial distance value to obtain the compensated distance. This vector operation method takes into account the spatial directionality and can more accurately reflect the changes in the actual projection distance, providing a reliable distance reference for subsequent focus control.

[0018] In combination with some embodiments of the first aspect, in some embodiments, calculating the spatial transformation result of the optical axis vector under the action of the projection geometric transformation matrix based on the quaternion algorithm specifically includes: Convert the optical axis vector to a unit quaternion representation; Construct a rotation quaternion according to the attitude angle offset, and the rotation quaternion includes quaternion components corresponding to the roll angle, pitch angle and yaw angle; Calculate the product of the rotation quaternion and the quaternion of the optical axis vector to obtain the optical axis vector after rotation transformation; Construct a translation transformation matrix based on the position offset; The translation transformation matrix is ​​applied to the optical axis vector after the rotation transformation to obtain the spatial transformation result.

[0019] By adopting the above technical solution, the optical axis vector is converted into a unit quaternion representation, which can unify the mathematical expression of the vector and facilitate subsequent quaternion operations. According to the attitude angle offset, a rotation quaternion containing roll angle, pitch angle and yaw angle components is constructed. This attitude representation method based on quaternions has the advantages of high computational efficiency and small storage space. By calculating the quaternion product of the rotation quaternion and the optical axis vector, the optical axis vector after the rotation transformation can be directly obtained, avoiding multiple matrix multiplication operations and improving the computational efficiency. Based on the position offset, a translation transformation matrix is ​​constructed and applied to the optical axis vector after the rotation transformation. This transformation order of first rotating and then translating conforms to the physical essence of spatial geometric transformation and can accurately reflect the actual motion process of the projector. The entire quaternion-based spatial transformation calculation process not only ensures the stability of numerical calculations, but also improves the execution efficiency of the algorithm, providing reliable attitude calculation support for real-time control systems.

[0020] An embodiment of the present application provides a projector auto-focus related device based on a spectral sensor, and the related device includes a system, a computer-readable storage medium, and a computer program product.

[0021] In a second aspect, an embodiment of the present application provides a projector autofocus system based on a spectral sensor, and the projector autofocus system based on a spectral sensor includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and one or more processors call the computer instructions to enable the system to execute the method described in the first aspect and any possible implementation method of the first aspect.

[0022] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a system, causes the system to execute the method described in the first aspect and any possible implementation of the first aspect.

[0023] In a fourth aspect, an embodiment of the present application provides a computer program product, characterized in that when the computer program product runs on a system, the system executes the method described in any possible implementation manner in the first aspect.

[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. The present application provides a projector autofocus method based on a spectral sensor. The spectral sensor collects the reflected light signal of the projection surface and performs wavelength decomposition to obtain the light intensity values ​​of different wavelengths. The initial distance value is calculated using a preset mapping model, which can reduce the influence of ambient light interference. The acceleration data and angular velocity data are collected in real time by the inertial measurement unit and integrated to obtain the position offset and attitude angle offset of the projector in three-dimensional space. The compensation distance is calculated in combination with the initial distance value, and the spatial posture change of the projector can be accurately tracked. The lens assembly is driven to move back and forth by an adaptive step control strategy, and the reflected light signal is recollected and the measured distance is updated by continuously triggering the light source module until the preset optimal imaging distance is reached. This closed-loop iterative focusing method can reduce the over-adjustment and under-adjustment problems that are prone to occur in traditional fixed step focusing methods, and improve the focusing accuracy and focusing speed. The dual distance measurement mechanism of spectral sensing and inertial measurement can verify and compensate each other, improve the reliability of the distance measurement results, and maintain a stable focusing effect even when the projector shakes. The present application improves the accuracy of the projector autofocus, thereby improving the clarity of the projected image.

[0025] 2. The present application provides a projector autofocus method based on a spectral sensor, which calculates the signal-to-noise ratio of the reflected light signal and compares it with a preset signal-to-noise ratio threshold. When the signal-to-noise ratio is low, the signal quality is improved by increasing the luminous power of the light source module. This adaptive light source control method can ensure that effective reflected light signals can be obtained under different ambient light interference conditions. Digital filtering of the re-collected reflected light signal can further suppress the influence of random noise, improve the signal-to-noise ratio of the signal, and improve the measurement accuracy of light intensity values ​​of different wavelengths. Since the accuracy of spectral ranging directly affects the calculation result of the initial distance value, and the initial distance value is the basis for subsequent compensation distance calculation, the reliability of the entire autofocus process can be improved. By adaptively adjusting the light source power, power consumption can be reduced as much as possible while ensuring measurement accuracy, thereby improving the energy efficiency of the system.

[0026] 3. The present application provides a projector autofocus method based on a spectral sensor, which detects parameters such as the temperature, humidity, and atmospheric pressure of the environment in which the inertial measurement unit is located, establishes an environmental parameter influence model, and can quantitatively analyze the impact of environmental factors on the measurement accuracy of the inertial sensor. Based on the environmental parameter influence model, the acceleration compensation matrix and the angular velocity compensation matrix are determined, and the original measurement data is corrected. This environmental adaptability compensation mechanism can reduce the measurement errors caused by environmental factors such as temperature drift and humidity changes. By performing zero bias estimation and scale factor correction on the corrected data, the system error of the sensor itself is further eliminated. This multi-level data correction mechanism enables subsequent integral operations to be performed based on more accurate acceleration data and angular velocity data, thereby improving the calculation accuracy of position offset and attitude angle offset. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a flow chart of a projector autofocus method based on a spectral sensor in an embodiment of the present application.

[0028] Figure 2 This is another flowchart of a projector autofocus method based on a spectral sensor in an embodiment of the present application.

[0029] Figure 3 This is a schematic diagram of the physical device structure of a projector autofocus system based on a spectral sensor provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more listed items.

[0031] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0032] Combine the following Figure 1 , a projector auto-focusing method based on a spectral sensor in an embodiment of the present application is described: See also Figure 1 , which is a flow chart of a projector autofocus method based on a spectral sensor in an embodiment of the present application.

[0033] S101, after controlling the light source module to emit a light signal of a preset wavelength band to the projection surface, collecting the reflected light signal of the projection surface through a spectrum sensor arranged at the projector lens assembly, and performing wavelength decomposition on the reflected light signal to obtain light intensity values ​​of different wavelengths; After controlling the light source module to emit a light signal of a preset wavelength band to the projection surface, the system collects the reflected light signal of the projection surface through a spectral sensor arranged at the projector lens assembly, and calculates the signal-to-noise ratio of the obtained reflected light signal. When the signal-to-noise ratio is less than the preset signal-to-noise ratio threshold, the system increases the luminous power of the light source module, collects the reflected light signal again, performs digital filtering on the recollected reflected light signal to obtain a filtered reflected light signal, decomposes the filtered reflected light signal by wavelength, and obtains light intensity values ​​of different wavelengths.

[0034] This step is a process of collecting reflected light signals and performing wavelength decomposition through a spectral sensor. The system first controls the light source module to emit light signals of specific preset bands to the projection surface. These preset bands can include multiple band combinations within the visible spectrum. The spectral sensor is set at a specific position of the projector lens assembly, which can ensure that it does not affect the projection light path and can accurately collect reflected light signals. After the light signal is emitted, the spectral sensor collects the light signal reflected from the projection surface. The system calculates the signal-to-noise ratio of the collected reflected light signal, and dynamically adjusts the luminous power of the light source module by comparing the calculated signal-to-noise ratio with the preset signal-to-noise ratio threshold. When it is detected that the signal-to-noise ratio is lower than the preset threshold, the system automatically increases the luminous power of the light source module and re-collects the reflected light signal. In order to improve the quality of the signal, the system applies digital filtering algorithms to the re-collected reflected light signals, including but not limited to Butterworth filtering, Chebyshev filtering, etc. After filtering, the system uses spectral analysis technology to decompose the reflected light signal by wavelength to obtain light intensity values ​​corresponding to different wavelengths. In the process of obtaining the light intensity value, the system decomposes the mixed light signal into monochromatic light of different wavelengths through the dispersion element of the spectrometer, and accurately measures the light intensity of each wavelength through the photodetector array. The system compensates the reflected light signal according to the collected ambient light intensity, eliminates the influence of ambient light on the measurement results, and thus obtains more accurate light intensity value data.

[0035] S102, calculating an initial distance value between the projector and the projection surface according to light intensity values ​​of different wavelengths based on a preset mapping model; Based on the preset mapping model, the system calculates the initial distance value between the projector and the projection surface according to the light intensity values ​​of different wavelengths. Specifically: the light intensity values ​​of different wavelengths are normalized to obtain the normalized light intensity value; Constructing a feature vector, the feature vector includes a normalized light intensity value, a light intensity difference value of adjacent wavelengths, and a kurtosis value of a spectrum curve; The feature vector is input into the preset mapping model to obtain the distance value, and the distance value is smoothed based on the Kalman filter algorithm to obtain the initial distance value.

[0036] This step is the process of calculating the initial distance value between the projector and the projection surface based on the preset mapping model. The system first normalizes the acquired light intensity values ​​of different wavelengths, maps all light intensity values ​​to the interval [0, 1], and eliminates the dimensional differences between the light intensity values ​​of different wavelengths. The normalization process uses the maximum and minimum value normalization method to ensure the consistency of data distribution. In the process of constructing the feature vector, the system uses the normalized light intensity value as the basic feature, calculates the light intensity difference between adjacent wavelengths as the differential feature, and calculates the kurtosis value of the spectrum curve as the statistical feature. The construction of the feature vector takes into account multiple statistical features of the spectral data, including the shape feature and change feature of the spectrum curve. The system inputs the constructed feature vector into the preset mapping model, which can use machine learning algorithms such as support vector regression and neural network to establish a mapping relationship from feature vector to distance value through training data. In order to improve the stability of distance estimation, the system uses the Kalman filter algorithm to smooth the distance value output by the mapping model. Through the two stages of prediction and update, combined with historical data and current measurement values, a more stable initial distance value is obtained.

[0037] S103, acquiring acceleration data and angular velocity data collected by an inertial measurement unit disposed in the projector within a preset sampling period, and integrating the acceleration data and the angular velocity data to obtain a position offset and an attitude angle offset of the projector in three-dimensional space; The system obtains acceleration data and angular velocity data collected by an inertial measurement unit set in the projector within a preset sampling period, detects the average temperature value, average humidity value and average atmospheric pressure value of the inertial measurement unit within a preset time period, establishes an environmental parameter influence model based on the average temperature value, average humidity value and average atmospheric pressure value, determines the acceleration compensation matrix and the angular velocity compensation matrix according to the environmental parameter influence model, corrects the acceleration data and the angular velocity data using the acceleration compensation matrix and the angular velocity compensation matrix, performs zero bias estimation and scale factor correction on the corrected acceleration data and angular velocity data, and inputs the corrected acceleration data and angular velocity data into a convolutional neural network for feature extraction to obtain the corresponding acceleration data and angular velocity data. The acceleration data features and angular velocity data features are used, state observation equations and state transfer equations are established based on the acceleration data features and angular velocity data features, the unscented Kalman filter algorithm is used to solve the state observation equations and the state transfer equations to obtain a preliminary pose estimate, the preliminary pose estimate is gravity compensated in combination with a preset acceleration reference value to obtain a compensated pose estimate, the acceleration component in the compensated pose estimate is double integrated to obtain an initial position offset, the angular velocity component in the compensated pose estimate is integrated to obtain an initial attitude angle offset, the initial position offset and the initial attitude angle offset are fused and corrected based on the complementary filtering algorithm to obtain a position offset and an attitude angle offset, respectively.

[0038] This step is the process of obtaining the motion parameters of the projector through the inertial measurement unit and performing data processing. The system continuously collects acceleration data and angular velocity data within a preset sampling period through the inertial measurement unit set in the projector. The system detects and records parameters such as temperature, humidity and atmospheric pressure in the environment where the inertial measurement unit is located, and calculates the average value of these parameters within a preset time period. Based on the average values ​​of these environmental parameters, the system establishes an environmental parameter influence model, which is used to analyze the influence of environmental factors on the measurement accuracy of the sensor. The system generates an acceleration compensation matrix and an angular velocity compensation matrix based on the environmental parameter influence model to compensate the original measurement data for environmental factors. The compensated data also needs to be zero-biased and scaled to eliminate the inherent measurement error of the sensor. The system inputs the corrected acceleration data and angular velocity data into the pre-trained convolutional neural network respectively to extract time domain and frequency domain features. Based on the extracted features, the system establishes the state observation equation and the state transfer equation, and uses the unscented Kalman filter algorithm for state estimation. The system combines the gravity acceleration reference value to perform gravity compensation on the estimation result, and obtains the position offset and attitude angle offset by double integration of the compensated acceleration component and single integration of the angular velocity component. Finally, the system uses a complementary filtering algorithm to fuse and correct the two sets of data to improve the accuracy of posture estimation.

[0039] S104, using the initial distance value as a reference value, combining the position offset and the attitude angle offset to determine the compensation distance of the projector's spatial posture change, and calculating the actual projection distance of the projector relative to the projection surface according to the compensation distance; The system uses the initial distance value measured by the spectral sensor as the reference value, and combines the position offset and attitude angle offset obtained by the inertial measurement unit to build a compensation model for the spatial posture change of the projector. In the compensation model, the system uses quaternion representation to describe the rotational posture of the projector, and calculates the attitude transformation matrix through quaternion multiplication. The system converts the position offset into a three-dimensional displacement vector in the world coordinate system, and calculates the projection distance change in the direction of the projector optical axis in combination with the attitude transformation matrix. For the attitude angle offset, the system calculates the projection distance change caused by rotation through the cosine theorem. The system establishes a spatial geometric model, and vector superimposes the component of the position offset in the projection direction with the distance change caused by the attitude to obtain the comprehensive compensation distance. When calculating the actual projection distance, the system considers the inclination angle of the projection surface, and maps the compensation distance to the normal direction of the projection surface through the projection theorem, thereby obtaining an accurate actual projection distance.

[0040] S105, determining a target focal length value that matches the actual projection distance, and controlling the stepper motor to drive the lens assembly to move to a focus position corresponding to the target focal length value; The system maps the calculated actual projection distance to the target focal length value by establishing a corresponding relationship model between projection distance and focal length. In the corresponding relationship model, the system considers optical parameters such as the focal length range of the lens and the size of the projection screen to establish a nonlinear mapping function. The system converts the target focal length value into the control parameters of the stepper motor, including the number of revolutions and pulses of the stepper motor. During the conversion process, the system considers mechanical parameters such as the reduction ratio and lead of the screw to ensure control accuracy. The system adopts a position-speed dual closed-loop control strategy to monitor the position information of the lens assembly in real time during the motor driving process, and adjusts the motor speed and acceleration through the PID control algorithm to ensure that the lens assembly moves smoothly to the target position. During the movement process, the system obtains real-time position feedback of the lens assembly through a Hall sensor or a photoelectric encoder to achieve closed-loop control.

[0041] S106, controlling the stepping motor to drive the lens assembly to move back and forth according to the adaptive step value; The system controls the stepper motor to drive the lens assembly to move back and forth according to an adaptive step value, and the adaptive step value is determined according to the deviation between the current position and the focus position.

[0042] The system dynamically calculates the control step size of the stepper motor based on the deviation between the current position and the target focus position. In the adaptive step size calculation, the system uses a nonlinear function to map the position deviation to a suitable step size value. When the deviation is large, a larger step size is used to increase the adjustment speed. When the deviation is small, a smaller step size is used to improve the accuracy. The system uses a fuzzy control algorithm to adjust the step size value in real time and establishes a fuzzy rule base between the position deviation, the deviation change rate and the step size value. During the reciprocating movement, the system monitors the vibration state of the lens assembly in real time, collects vibration signals through acceleration sensors, performs spectrum analysis on the signals, identifies the resonant frequency, adjusts the drive frequency of the motor, and avoids the resonant area. The system uses an adaptive predictive control algorithm to predict the optimal control sequence based on historical adjustment data to achieve smooth reciprocating motion of the lens assembly.

[0043] S107, triggering the light source module to re-emit a light signal of a preset wavelength band after each reciprocating movement and collecting a new reflected light signal through a spectrum sensor; After the lens assembly completes a reciprocating movement, the system immediately triggers the light source module to emit a new round of preset band light signals. The system synchronizes the light source emission and data collection through a timer or position sensor trigger signal to ensure the accuracy of the measurement timing. During the light signal transmission process, the system dynamically adjusts the emission power and wavelength combination of the light source to adapt to the characteristics of different reflective surfaces. When the spectral sensor collects new reflected light signals, the system adjusts the sensitivity of the sensor through an automatic gain control circuit to ensure signal quality. The system performs real-time preprocessing on the collected spectral data, including dark current correction, nonlinear correction, etc., to improve the reliability of the data.

[0044] S108, processing the new reflected light signal based on the preset mapping model to obtain the current measured distance; The system uses the same preset mapping model as the initial distance measurement to process the newly collected reflected light signal. During the signal processing, the system first normalizes and extracts features from the spectral data to construct a feature vector. The system uses a deep learning model to reduce the dimension of the feature vector and extract key feature components. In the mapping model, the system uses a kernel function to map the feature space to the distance space to achieve nonlinear regression. The system updates the parameters of the mapping model through an online learning algorithm to adapt to environmental changes. The system uses an ensemble learning method to integrate the prediction results of multiple sub-models to improve the robustness of distance estimation.

[0045] S109, when the deviation value between the current measurement distance and the preset optimal imaging distance is less than the preset threshold value for the first time, the corresponding current measurement distance is determined as the final measurement distance; The system compares the current measurement distance with the pre-calibrated optimal imaging distance and calculates the deviation value. In the deviation calculation, the system considers the statistical distribution of the measurement error and uses the sliding window method to analyze the results of multiple consecutive measurements. The system dynamically adjusts the preset threshold through an adaptive threshold algorithm and determines the appropriate judgment standard based on environmental conditions and measurement accuracy requirements. The system uses a state machine to manage the focusing process and record historical measurement results to prevent misjudgments caused by instantaneous fluctuations.

[0046] S110, determining a focus position corresponding to the final measured distance as a final focus position, and controlling the stepping motor to drive the lens assembly to move to the final focus position.

[0047] The system converts the final measured distance into the corresponding final focus position through the optical transfer function. During the position conversion process, the system considers the optical distortion and mechanical error of the lens and makes compensation corrections. The system uses an adaptive control algorithm to drive the stepper motor to achieve precise positioning of the lens assembly. In motion control, the system uses a trapezoidal speed curve to ensure a smooth motion process. The system monitors the actual position of the lens assembly in real time through a position feedback loop to ensure that the final focus position is reached.

[0048] In the above embodiment, the spectral sensor collects the reflected light signal of the projection surface and performs wavelength decomposition to obtain the light intensity values ​​of different wavelengths. The initial distance value is calculated using a preset mapping model, which can reduce the influence of ambient light interference. The acceleration data and angular velocity data are collected in real time by the inertial measurement unit and integrated to obtain the position offset and attitude angle offset of the projector in three-dimensional space. The compensation distance is calculated in combination with the initial distance value, and the spatial posture change of the projector can be accurately tracked. The lens assembly is driven to move back and forth by an adaptive step control strategy, and the reflected light signal is recollected and the measured distance is updated by continuously triggering the light source module until the preset optimal imaging distance is reached. This closed-loop iterative focusing method can reduce the over-adjustment and under-adjustment problems that are prone to occur in traditional fixed step focusing methods, and improve the focusing accuracy and focusing speed. The dual distance measurement mechanism of spectral sensing and inertial measurement can verify and compensate each other, improve the reliability of the distance measurement results, and maintain a stable focusing effect even when the projector shakes. The present application improves the accuracy of the projector's automatic focus, thereby improving the clarity of the projected image.

[0049] In step S104 of the above embodiment, the initial distance value is used as the reference value, and the compensation distance of the projector spatial posture change is determined in combination with the position offset and the posture angle offset. The following is a detailed description of how to implement this step in combination with another embodiment. Figure 2 , another projector autofocus method based on a spectral sensor in an embodiment of the present application is described: See also Figure 2 , is another flow chart of a projector autofocus method based on a spectral sensor in an embodiment of the present application.

[0050] S201, constructing a projection geometry transformation matrix; The system constructs a projection geometry transformation matrix, which includes a translation matrix corresponding to the position offset and a rotation matrix corresponding to the attitude angle offset.

[0051] This step describes the spatial motion of the projector by constructing a transformation matrix containing position and attitude information. The system uses a homogeneous coordinate system to represent the projection geometry transformation matrix, unifying the transformation of the three-dimensional space into a four-dimensional matrix operation. During the construction process, the system first establishes the world coordinate system and the local coordinate system of the projector, and defines the transformation relationship between the coordinate systems. The translation matrix corresponding to the position offset is in the form of a 4×4 homogeneous matrix, in which the 3×3 submatrix is ​​the unit matrix, and the last column contains the translation components in the x, y, and z directions. The rotation matrix corresponding to the attitude angle offset is also in the form of a 4×4 homogeneous matrix, and the complete rotation transformation matrix is ​​constructed by transforming the Euler angle sequence. The system uses a matrix exponential mapping method based on Lie groups to map continuous rotational motion to the rotation matrix space to ensure the continuity and accuracy of the rotation transformation. The system establishes a covariance matrix to describe the uncertainty of the transformation parameters for subsequent error propagation analysis.

[0052] S202, obtaining the optical axis vector and the projection surface normal vector of the projector; The system calculates the optical axis vector through the optical system parameters of the projector, including the optical center position of the lens and the direction of the main light. The calculation of the optical axis vector takes into account the distortion parameters and optical center offset of the lens. The system uses a multi-point calibration method to determine the normal vector of the projection surface. By collecting the three-dimensional coordinates of multiple control points on the projection surface, the least squares method is used to fit the plane equation to obtain an accurate normal vector. The system normalizes the acquired vector to ensure the numerical stability of subsequent calculations. In the process of acquiring the optical axis vector, the system collects the light intensity distribution through the optical sensor array and extracts the optical axis direction in combination with the image processing algorithm. For the projection surface normal vector, the system obtains the depth information of the projection surface through structured light projection technology to achieve real-time update of the normal vector.

[0053] S203, converting the optical axis vector into a unit quaternion representation, and constructing a rotation quaternion according to the attitude angle offset; The system converts the optical axis vector into a unit quaternion representation and constructs a rotation quaternion based on the attitude angle offset. The rotation quaternion includes the quaternion components corresponding to the roll angle, pitch angle, and yaw angle.

[0054] The system uses the Rodrigues rotation formula to convert the optical axis vector into a unit quaternion. The conversion process includes calculating the rotation axis and the rotation angle. When constructing the rotation quaternion, the system decomposes the attitude angle offset into three basic rotations in orthogonal directions and calculates the corresponding quaternion components respectively. The system uses the quaternion interpolation algorithm to achieve smooth attitude transformation and avoid the gimbal lock problem. In quaternion operations, the system uses double coverage technology to handle the periodicity of quaternions to ensure the shortest path for rotation interpolation. The system establishes a quaternion error model to describe the uncertainty of attitude measurement and performs error analysis through covariance propagation. For continuous attitude changes, the system uses the quaternion spline interpolation method to achieve smooth attitude transition.

[0055] S204, calculating the product of the rotation quaternion and the quaternion of the optical axis vector to obtain the optical axis vector after the rotation transformation; The system represents the optical axis vector as a pure quaternion and performs quaternion multiplication with the rotation quaternion. During the operation, the system uses the property of quaternion conjugation to keep the length of the vector unchanged. The system combines multiple rotation transformations into a single quaternion transformation through the chain rule of quaternion operation. During the implementation process, the system uses the SIMD instruction set to optimize quaternion multiplication operations and improve computational efficiency. The system establishes a numerical stability check mechanism for quaternion operations and maintains the unit property of quaternions through the renormalization method. For high-speed rotation scenarios, the system uses the angular velocity integration method to update the quaternion to ensure the accuracy of the rotation transformation. The system describes continuous rotational motion through quaternion differential equations and uses numerical integration methods to solve the rotation trajectory.

[0056] S205, constructing a translation transformation matrix based on the position offset, and applying the translation transformation matrix to the optical axis vector after the rotation transformation to obtain a spatial transformation result; The system constructs a 4×4 homogeneous transformation matrix based on the position offset, and the matrix elements contain translation vectors and rotation matrices. During the transformation process, the system uses matrix decomposition technology to decompose complex spatial transformations into basic transformation sequences. The system ensures the orthogonality of the transformation matrix and maintains the spatial metric relationship through eigenvalue analysis. When applying the transformation, the system uses a block algorithm of matrix multiplication to improve the computational efficiency of large-scale transformations. The system establishes a transformation error propagation model to analyze the impact of cumulative errors on the final result. For continuous spatial motion, the system uses Lie algebra method to describe velocity spinors to achieve smooth motion trajectory generation.

[0057] S206, calculating the deflection angle of the projection light path according to the angle between the spatial transformation result and the normal vector of the projection surface; The system calculates the angle between two vectors through vector dot product operation and uses the arc cosine function to get the radian value. During the calculation process, the system considers the normalization of the vector to ensure the stability of the numerical calculation. The system establishes a projection surface coordinate system, projects the space vector onto the projection surface, and calculates the deviation between the projection direction and the normal vector. For non-ideal planes, the system uses the surface fitting method to describe the local geometric characteristics of the projection surface and calculate the surface normal vector. The system analyzes the propagation characteristics of the projection light path on the surface through differential geometry methods and establishes an optical path calculation model.

[0058] S207, simulating the optical path difference corresponding to the deflection angle using a ray tracing algorithm; The system establishes a light propagation model, including the geometric relationship between the light source position, lens system and projection surface. During the ray tracing process, the system considers optical parameters such as refractive index and dispersion to accurately calculate the light path. The system uses a recursive ray tracing algorithm to handle complex light paths with multiple reflections and refractions. For light of different wavelengths, the system establishes a dispersion model to calculate the optical path differences caused by chromatic aberration. The system simulates the statistical distribution of light through the Monte Carlo method to evaluate the uncertainty of the optical path calculation. During the ray tracing process, the system uses hierarchical bounding box technology to accelerate the orthogonal operation of light and objects.

[0059] S208, performing vector superposition of the optical path difference and the initial distance value to obtain a compensation distance.

[0060] The system uses vector operation method to decompose the optical path difference in the projection direction to obtain the equivalent distance change. In the process of vector superposition, the system considers the sign and direction of each component to ensure the correctness of the synthesis result. The system establishes an error propagation model to analyze the impact of the measurement error of the initial distance value and the optical path difference on the compensation distance. For dynamically changing scenes, the system uses the Kalman filter algorithm to fuse multiple measurement results to improve the accuracy of the compensation distance. The system dynamically adjusts the contribution of each component according to the reliability of the measurement through the adaptive weight method. In the compensation calculation, the system establishes a nonlinear optimization model to solve the optimal compensation distance.

[0061] In the above embodiment, a projection geometric transformation matrix including a translation matrix and a rotation matrix is ​​constructed to accurately describe the position and posture changes of the projector in three-dimensional space. The spatial transformation result is calculated using a quaternion algorithm in combination with the optical axis vector and the normal vector of the projection surface of the projector. This quaternion-based calculation method can avoid the universal joint lock problem in the traditional Euler angle representation method and improve the stability of the posture calculation. By calculating the angle between the transformed optical axis vector and the normal vector of the projection surface, the deflection angle of the projection light path can be accurately obtained. The ray tracing algorithm is used to simulate the optical path difference corresponding to the deflection angle. This simulation method based on the principle of physical optics can accurately reflect the impact of the change in the position and posture of the projector on the projection distance. The simulated optical path difference is vector-superimposed with the initial distance value to obtain the compensation distance. This vector operation method takes into account the spatial directionality and can more accurately reflect the change in the actual projection distance, providing a reliable distance reference for subsequent focus control.

[0062] The following describes the system in the embodiment of the present invention from the perspective of hardware processing. Figure 3 , which is a schematic diagram of the physical device structure of a projector autofocus system based on a spectral sensor provided in an embodiment of the present application.

[0063] It should be noted that Figure 3 The structure of the system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0064] like Figure 3 As shown, the system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method in the above embodiment. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through a bus 304. Input / output (I / O) interface 305 is also connected to bus 304.

[0065] The following components are connected to the I / O interface 305: an input section 306 including a camera, an infrared sensor, etc.; an output section 307 including a liquid crystal display (LCD) and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.

[0066] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 309, and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present invention are performed.

[0067] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.

[0068] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Among them, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0069] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the system described in the above embodiment; or may exist independently without being assembled into the system. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of a system, the system implements the method provided in the above embodiment.

[0070] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0071] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.

[0072] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0073] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Claims

1. A projector auto-focus method based on a spectral sensor, characterized in that: include: After controlling the light source module to emit a light signal of a preset wavelength band to the projection surface, a spectrum sensor arranged at the projector lens assembly collects the reflected light signal of the projection surface, and decomposes the reflected light signal by wavelength to obtain light intensity values ​​of different wavelengths; Based on a preset mapping model, calculating an initial distance value between the projector and the projection surface according to the light intensity values ​​of the different wavelengths; Acquire acceleration data and angular velocity data collected by an inertial measurement unit disposed in the projector within a preset sampling period, and perform integration operation on the acceleration data and the angular velocity data to obtain a position offset and an attitude angle offset of the projector in three-dimensional space; Taking the initial distance value as a reference value, determining a compensation distance of the spatial posture change of the projector in combination with the position offset and the posture angle offset, and calculating an actual projection distance of the projector relative to the projection surface according to the compensation distance; Determine a target focal length value that matches the actual projection distance, and control a stepper motor to drive the lens assembly to move to a focusing position corresponding to the target focal length value; Controlling the stepper motor to drive the lens assembly to reciprocate according to an adaptive step value, wherein the adaptive step value is determined according to a deviation between a current position and the focus position; After each reciprocating movement, trigger the light source module to re-emit the light signal of the preset wavelength band and collect new reflected light signals through the spectrum sensor; Processing the new reflected light signal based on the preset mapping model to obtain a current measured distance; When the deviation value between the current measurement distance and the preset optimal imaging distance is less than a preset threshold value for the first time, the corresponding current measurement distance is determined as the final measurement distance; The focus position corresponding to the final measured distance is determined as the final focus position, and the stepping motor is controlled to drive the lens assembly to move to the final focus position.

2. The method according to claim 1, characterized in that Before performing wavelength decomposition on the reflected light signal, the method further comprises: Calculating the signal-to-noise ratio of the acquired reflected light signal; When the signal-to-noise ratio is less than a preset signal-to-noise ratio threshold, increasing the light power of the light source module and recollecting the reflected light signal; Digitally filtering the recollected reflected light signal to obtain a filtered reflected light signal; The filtered reflected light signal is subjected to wavelength decomposition.

3. The method according to claim 1, characterized in that: The calculating the initial distance value between the projector and the projection surface according to the light intensity values ​​of the different wavelengths based on the preset mapping model specifically includes: Normalizing the light intensity values ​​of the different wavelengths to obtain normalized light intensity values; Constructing a feature vector, wherein the feature vector includes the normalized light intensity value, the light intensity difference value of adjacent wavelengths, and the kurtosis value of the spectrum curve; The feature vector is input into the preset mapping model to obtain a distance value, and the distance value is smoothed based on a Kalman filter algorithm to obtain an initial distance value.

4. The method according to claim 1, characterized in that: After acquiring the acceleration data and angular velocity data collected by the inertial measurement unit disposed in the projector within a preset sampling period, the method further includes: Detecting an average temperature value, an average humidity value, and an average atmospheric pressure value of the inertial measurement unit within a preset time period; Establishing an environmental parameter influence model based on the average temperature value, the average humidity value and the average atmospheric pressure value; Determining an acceleration compensation matrix and an angular velocity compensation matrix according to the environmental parameter impact model; Correcting the acceleration data and the angular velocity data using the acceleration compensation matrix and the angular velocity compensation matrix; The zero bias estimation and scale factor correction are performed on the corrected acceleration data and angular velocity data.

5. The method according to claim 1 or 4, characterized in that: The step of integrating the acceleration data and the angular velocity data to obtain the position offset and attitude angle offset of the projector in the three-dimensional space specifically includes: The corrected acceleration data and angular velocity data are respectively input into a convolutional neural network for feature extraction to obtain corresponding acceleration data features and angular velocity data features; Establishing a state observation equation and a state transfer equation based on the acceleration data characteristics and the angular velocity data characteristics; The state observation equation and the state transfer equation are solved by using an unscented Kalman filter algorithm to obtain a preliminary pose estimation value; Performing gravity compensation on the preliminary pose estimation value in combination with a preset acceleration reference value to obtain a compensated pose estimation value; Double integrating the acceleration component in the compensated posture estimate to obtain an initial position offset; integrating the angular velocity component in the compensated posture estimate to obtain an initial attitude angle offset; The initial position offset and the initial attitude angle offset are fused and corrected based on a complementary filtering algorithm to obtain a position offset and an attitude angle offset respectively.

6. The method according to claim 1, characterized in that The method of using the initial distance value as a reference value and combining the position offset and the attitude angle offset to determine the compensation distance of the projector spatial posture change specifically includes: Constructing a projection geometric transformation matrix, wherein the projection geometric transformation matrix includes a translation matrix corresponding to the position offset and a rotation matrix corresponding to the attitude angle offset; Obtaining the optical axis vector and projection surface normal vector of the projector; Calculate the spatial transformation result of the optical axis vector under the action of the projection geometric transformation matrix based on the quaternion algorithm; Calculating the deflection angle of the projection light path according to the angle between the spatial transformation result and the normal vector of the projection surface; Using a ray tracing algorithm to simulate the optical path difference corresponding to the deflection angle; The optical path difference is vector-superimposed on the initial distance value to obtain a compensation distance.

7. The method according to claim 6, characterized in that The calculating of the spatial transformation result of the optical axis vector under the effect of the projection geometric transformation matrix based on the quaternion algorithm specifically includes: Convert the optical axis vector into a unit quaternion representation; Constructing a rotation quaternion according to the attitude angle offset, wherein the rotation quaternion includes quaternion components corresponding to a roll angle, a pitch angle, and a yaw angle; Calculate the product of the rotation quaternion and the quaternion of the optical axis vector to obtain the optical axis vector after rotation transformation; Constructing a translation transformation matrix based on the position offset; The translation transformation matrix is ​​applied to the optical axis vector after the rotation transformation to obtain the spatial transformation result.

8. A projector autofocus system based on a spectral sensor, characterized in that: The system comprises: One or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the system to execute the method as described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on a system, the system is caused to execute the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that When the computer program product is run on a system, the system is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Calibration parameter compensation method and device of projection system and readable storage medium

    CN110933391A

  • Projector focusing test method, system and device and storage medium

    CN116614609A

  • Image and wave field projection through diffusive media

    US20160037146A1

Cited By

  • High-precision underwater structured light three-dimensional point cloud imaging method and system

    CN120047626A

  • Humidity detection method and device, computer equipment and storage medium

    CN120253740A

  • Alisma plantago-aquatica harvesting inter-row deviation rectifying system

    CN120871902A