A method for automatic focusing of a projector based on a spectral sensor and related devices
By combining a spectral sensor and an inertial measurement unit, the autofocus method solves the problem of focusing accuracy of projection devices in adverse environments, and achieves efficient and stable projection image clarity.
Patent Information
- Application Number
- CN202411553328.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2044-11-01
AI Technical Summary
Existing projection devices struggle to achieve precise autofocus in low ambient light or on irregular projection surfaces, resulting in a decrease in the clarity of the projected image.
An autofocus method based on a spectral sensor is adopted. The reflected light signal from the projection surface is collected by the spectral sensor and wavelength decomposed. Combined with the data integration operation of the inertial measurement unit, the initial distance between the projector and the projection surface is calculated. An adaptive step size control strategy is used to drive the lens assembly to move, thereby realizing closed-loop iterative focusing.
It improves the accuracy and speed of the projector's autofocus, enhances the stability of the focusing effect, and ensures the clarity of the projected image under different ambient light conditions.
Smart Images

Figure CN119484789B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of automatic focusing, and particularly relates to a projector automatic focusing method based on a spectrum sensor and related equipment. BACKGROUND
[0002] A projection device is a display device that converts an electronic signal into a visible image and projects it onto a projection surface. In use, the existing projection device needs to focus the projection image to obtain a clear display effect. The traditional focusing method mainly adopts a manual adjustment of a focusing ring, which is not only cumbersome to operate, but also difficult to achieve accurate focusing.
[0003] In the related art, a projection device automatic focusing scheme based on image contrast can be used. In this scheme, an image sensor is arranged in the projection device to collect the projection image, and edge detection is performed on the collected image to obtain an image contrast value. Then, a step motor is controlled to drive a lens assembly to move, 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 a maximum, it is determined that the current lens position is the best focusing position, thereby completing the automatic focusing process.
[0004] However, in the case of dark ambient light or an irregular projection surface, the focusing accuracy is reduced due to the difficulty in accurately obtaining the image contrast information, thereby reducing the clarity of the projection image. SUMMARY
[0005] The present application provides a projector automatic focusing method based on a spectrum sensor and related equipment, which is used to improve the accuracy of projector automatic focusing and thereby improve the clarity of the projection image.
[0006] In a first aspect, the present application provides a projector automatic focusing method based on a spectrum sensor. After a light source module emits a light signal of a preset waveband to a projection surface, a spectrum sensor arranged at a lens assembly of the projector collects a reflected light signal of the projection surface, and performs wavelength decomposition on the reflected light signal to obtain light intensity values of different wavelengths.
[0007] Based on a preset mapping model, an initial distance value between the projector and the projection surface is calculated according to the light intensity values of different wavelengths.
[0008] Acceleration data and angular velocity data collected by an inertial measurement unit arranged in the projector within a preset sampling period are obtained, and integral operation is performed on the acceleration data and the angular velocity data to obtain a position offset and an attitude angle offset of the projector in a three-dimensional space.
[0009] The initial distance value is taken as a reference value, a position offset and an attitude angle offset are combined to determine a compensation distance of the spatial pose change of the projector, and the actual projection distance of the projector relative to the projection surface is calculated according to the compensation distance;
[0010] A target focal length value matching the actual projection distance is determined, and the step motor is controlled to drive the lens assembly to move to a focusing position corresponding to the target focal length value;
[0011] The step motor is controlled to drive the lens assembly to move back and forth according to an adaptive step length value, and the adaptive step length value is determined according to the deviation between the current position and the focusing position;
[0012] After each back-and-forth movement, the light source module is triggered to re-emit light signals of a preset waveband, and new reflected light signals are collected by the spectrum sensor;
[0013] The new reflected light signals are processed based on a preset mapping model to obtain a current measurement distance;
[0014] When the deviation value between the current measurement distance and the preset optimal imaging distance is less than a preset threshold for the first time, the corresponding current measurement distance is determined as a final measurement distance;
[0015] The focusing position corresponding to the final measurement distance is determined as a final focusing position, and the step motor is controlled to drive the lens assembly to move to the final focusing position.
[0016] By adopting the above technical solutions, the spectrum sensor collects the reflected light signals of the projection surface and performs wavelength decomposition to obtain light intensity values of different wavelengths, and the initial distance value is calculated using the preset mapping model, which can reduce the influence of environmental light interference. The inertial measurement unit is used to collect acceleration data and angular velocity data in real time and perform integral operation to obtain the position offset and attitude angle offset of the projector in the three-dimensional space, and the compensation distance is calculated in combination with the initial distance value, which can accurately track the spatial pose change of the projector. An adaptive step length control strategy is adopted to drive the lens assembly to move back and forth, and the reflected light signals are continuously collected by triggering the light source module again and updating the measurement distance until the requirement of the preset optimal imaging distance is met. This closed-loop iterative focusing method can reduce the over-adjustment and under-adjustment problems that are prone to occur in the traditional fixed step length focusing method, and improve the focusing accuracy and focusing speed. The dual distance measurement mechanism of spectrum sensing and inertial measurement can verify and compensate each other, thereby improving the reliability of the ranging result, and maintaining stable focusing effect even in the case of shaking of the projector. The present application improves the accuracy of the automatic focusing of the projector, and further improves the clarity of the projection picture.
[0017] In combination with some embodiments of the first aspect, in some embodiments, before wavelength decomposition of the reflected light signals, the method further comprises:
[0018] calculate a signal-to-noise ratio of the acquired reflected light signal;
[0019] when the signal-to-noise ratio is less than a preset signal-to-noise ratio threshold, increase the light-emitting power of the light source module, and reacquire the reflected light signal;
[0020] perform digital filtering on the reacquired reflected light signal to obtain a filtered reflected light signal;
[0021] perform wavelength decomposition on the filtered reflected light signal.
[0022] By adopting the technical solution, the signal-to-noise ratio of the reflected light signal is calculated and compared with the preset signal-to-noise ratio threshold, and the light-emitting power of the light source module is increased to improve the signal quality when the signal-to-noise ratio is low. This adaptive light source control method can ensure that effective reflected light signals can be obtained under different environmental light interference conditions. Digital filtering is performed on the reacquired reflected light signal, which can further suppress the influence of random noise, improve the signal-to-noise ratio of the signal, and improve the measurement accuracy of the 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, the power consumption can be reduced as much as possible under the premise of ensuring measurement accuracy, and the energy efficiency ratio of the system can be improved.
[0023] In some embodiments of the first aspect, based on a 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, specifically including:
[0024] normalizing the light intensity values of different wavelengths to obtain normalized light intensity values;
[0025] constructing a feature vector, the feature vector including the normalized light intensity values, the light intensity difference values of adjacent wavelengths, and the kurtosis values of the spectral curves;
[0026] inputting the feature vector into the preset mapping model to obtain a distance value, and performing smoothing processing on the distance value based on a Kalman filtering algorithm to obtain the initial distance value.
[0027] By adopting the technical solution, the absolute value influence caused by light source intensity fluctuation and ambient light intensity change can be eliminated by normalizing the light intensity values of different wavelengths, and the stability of measurement is improved. By constructing a feature vector including the normalized light intensity value, the adjacent wavelength light intensity difference value and the spectral curve kurtosis value, 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 a preset mapping model to realize fast mapping from spectral features to distance values, avoiding complex theoretical calculation process. The distance values are smoothed by using Kalman filtering algorithm, which can effectively suppress random fluctuations in the measurement process and obtain more smooth and stable initial distance values. This distance calculation method based on multi-dimensional features and filtering algorithm not only ensures the calculation efficiency, but also improves the reliability of the calculation results, providing accurate reference values for subsequent compensation distance calculation.
[0028] 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 arranged in the projector within a preset sampling period, the method further comprises:
[0029] detecting average temperature value, average humidity value and average atmospheric pressure value of the inertial measurement unit within a preset time period;
[0030] establishing an environmental parameter influence model based on the average temperature value, the average humidity value and the average atmospheric pressure value;
[0031] determining an acceleration compensation matrix and an angular velocity compensation matrix according to the environmental parameter influence model;
[0032] correcting the acceleration data and the angular velocity data by using the acceleration compensation matrix and the angular velocity compensation matrix;
[0033] performing zero offset estimation and scale factor correction on the corrected acceleration data and angular velocity data.
[0034] By adopting the technical solution, the temperature, humidity and atmospheric pressure of the environment where the inertial measurement unit is located are detected, and an environmental parameter influence model is established, which can quantitatively analyze the influence of environmental factors on the measurement accuracy of the inertial sensor. Based on the environmental parameter influence model, an acceleration compensation matrix and an angular velocity compensation matrix are determined to correct the original measurement data. This environmental adaptability compensation mechanism can reduce the measurement error caused by temperature drift, humidity change and other environmental factors. By performing zero offset 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 operation to be based on more accurate acceleration data and angular velocity data, thereby improving the calculation accuracy of the position offset and the attitude angle offset.
[0035] In some embodiments of the first aspect, the acceleration data and the angular velocity data are integrated to obtain a position offset and an attitude angle offset of the projector in the three-dimensional space, specifically comprising:
[0036] The corrected acceleration data and the angular velocity data are input into a convolutional neural network for feature extraction to obtain corresponding acceleration data features and angular velocity data features;
[0037] State observation equations and state transition equations are established based on the acceleration data features and the angular velocity data features;
[0038] The state observation equations and the state transition equations are solved using an unscented Kalman filter algorithm to obtain a preliminary pose estimation value;
[0039] The preliminary pose estimation value is compensated for gravity based on a preset acceleration reference value to obtain a compensated pose estimation value;
[0040] The acceleration component in the compensated pose estimation value is double-integrated to obtain an initial position offset, and the angular velocity component in the compensated pose estimation value is integrated to obtain an initial attitude angle offset;
[0041] The initial position offset and the initial attitude angle offset are fused and corrected based on a complementary filter algorithm to obtain a position offset and an attitude angle offset, respectively.
[0042] By using the above technical solution, the corrected acceleration data and the angular velocity data are input into a 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. State observation equations and state transition equations are established based on the extracted features, and the unscented Kalman filter algorithm is used for solving. This state space model-based processing method can effectively fuse multi-source data and improve the accuracy of pose estimation. By introducing a preset acceleration reference value for gravity compensation, the influence of gravitational acceleration on the measurement result can be eliminated. The compensated pose estimation value is integrated, where the acceleration component is double-integrated to obtain a position offset, and the angular velocity component is single-integrated to obtain an attitude angle offset. This separate processing method can reduce the cumulative effect of integration errors. Finally, the initial offset is fused and corrected by the complementary filter algorithm, which can fully utilize the complementary characteristics of the two types of data, maintaining the long-term stability of the acceleration data and retaining the rapid response characteristics of the angular velocity data, thereby obtaining more accurate position offset and attitude angle offset.
[0043] In some embodiments of the first aspect, the initial distance value is used as a reference value to determine a compensation distance of the spatial pose change of the projector based on the position offset and the attitude angle offset, specifically comprising:
[0044] construct a projection geometry transformation matrix, the projection geometry transformation matrix comprising a translation matrix corresponding to the position offset and a rotation matrix corresponding to the attitude angle offset;
[0045] obtain an optical axis vector and a projection surface normal vector of the projector;
[0046] calculate a spatial transformation result of the optical axis vector under the action of the projection geometry transformation matrix based on a quaternion algorithm;
[0047] calculate a deflection angle of the projection light path according to an included angle between the spatial transformation result and the projection surface normal vector;
[0048] simulate an optical path difference corresponding to the deflection angle using a ray tracing algorithm;
[0049] perform vector superposition of the optical path difference and an initial distance value to obtain a compensation distance.
[0050] By adopting the above technical solutions, the projection geometry transformation matrix comprising the translation matrix and the rotation matrix can accurately describe the position and attitude changes of the projector in the three-dimensional space. Combined with the optical axis vector and the projection surface normal vector of the projector, the spatial transformation result is calculated using the quaternion algorithm. This calculation method based on the quaternion can avoid the gimbal lock problem in the traditional Euler angle representation method, and improve the stability of the attitude calculation. By calculating the included angle between the transformed optical axis vector and the projection surface normal vector, 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 physical optics principle can accurately reflect the influence of the projector attitude change on the projection distance. The simulated optical path difference and the initial distance value are subjected to vector superposition to obtain the compensation distance. This vector operation considers the spatial directionality, and can more accurately reflect the change of the actual projection distance, providing a reliable distance reference for subsequent focus control.
[0051] In combination with some embodiments of the first aspect, in some embodiments, the spatial transformation result of the optical axis vector under the action of the projection geometry transformation matrix is calculated based on a quaternion algorithm, specifically comprising:
[0052] convert the optical axis vector into a unit quaternion representation;
[0053] construct a rotation quaternion according to the attitude angle offset, the rotation quaternion comprising quaternion components corresponding to a roll angle, a pitch angle and a yaw angle;
[0054] calculate a quaternion product of the rotation quaternion and the optical axis vector to obtain a rotation-transformed optical axis vector;
[0055] construct a translation transformation matrix based on the position offset;
[0056] The translation matrix is applied to the optical axis vector after rotation transformation to obtain a spatial transformation result.
[0057] By adopting the above technical solution, the optical axis vector is converted into a unit quaternion representation form, the mathematical expression of the vector is unified, and subsequent quaternion operation is facilitated. The rotation quaternion containing the roll angle, pitch angle and yaw angle components is constructed according to the attitude angle offset, and this attitude representation method based on the quaternion has the advantages of high calculation efficiency and small storage space. The quaternion product of the rotation quaternion and the optical axis vector is calculated to directly obtain the optical axis vector after rotation transformation, avoiding multiple matrix multiplication operations and improving the calculation efficiency. The translation transformation matrix is constructed based on the position offset and is applied to the optical axis vector after rotation transformation, and this transformation sequence of rotation first and then translation conforms to the physical nature of spatial geometric transformation and can accurately reflect the actual movement process of the projector. The entire spatial transformation calculation process based on the quaternion not only ensures the stability of numerical calculation but also improves the execution efficiency of the algorithm, thereby providing reliable attitude calculation support for a real-time control system.
[0058] Embodiments of the present application provide a kind of related equipment of projector auto focusing based on spectral sensor, which includes system, computer readable storage medium and computer program product.
[0059] In the second aspect, the embodiments of the present application provide a kind of projector auto focusing system based on spectral sensor, which includes one or more processors and memory;Memory is coupled with one or more processors, and memory is used to store computer program code, computer program code includes computer instructions, one or more processors call computer instructions to make system execute the method as described in the first aspect and any possible implementation manner in the first aspect.
[0060] In the third aspect, the embodiments of the present application provide a kind of computer readable storage medium, including instruction, when the above-mentioned instruction runs on system, makes the above-mentioned system execute the method as described in the first aspect and any possible implementation manner in the first aspect.
[0061] In the fourth aspect, the embodiments of the present application provide a kind of computer program product, which is characterized in that, when computer program product runs on system, makes system execute the method as described in any possible implementation manner in the first aspect.
[0062] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0063] 1、The application provides a kind of projector automatic focusing method based on spectral sensor, spectral sensor acquires reflected light signal of projection surface and carries out wavelength decomposition, obtains the light intensity value of different wavelengths, utilizes preset mapping model to calculate initial distance value, can reduce the influence of ambient light interference. Through inertial measurement unit, acceleration data and angular velocity data are collected in real time and integral operation is carried out, the positional offset and attitude angular offset of projector in three-dimensional space are obtained, combined with initial distance value, compensation distance is calculated, the spatial pose variation of projector can be accurately tracked. Adaptive step control strategy is used to drive lens assembly to move back and forth, by constantly triggering light source module to reacquire reflected light signal and update measurement distance, until the requirement of preset best imaging distance is reached. This closed-loop iterative focusing method can reduce the over-regulation and under-regulation problems that are prone to occur in traditional fixed step focusing method, improve focusing accuracy and focusing speed. Dual distance measurement mechanism of spectral sensing and inertial measurement can verify and compensate each other, improve the reliability of ranging result, even in the case of projector shaking, stable focusing effect can be maintained. The application improves the accuracy of projector automatic focusing, and then improves the clarity of projection picture.
[0064] 2、The application provides a kind of projector automatic focusing method based on spectral sensor, the signal-to-noise ratio of reflected light signal is calculated, and compared with preset signal-to-noise ratio threshold, when signal-to-noise ratio is low, the signal quality is improved by increasing the light emitting power of light source module, this adaptive light source control method can ensure that effective reflected light signal can be obtained under different ambient light interference conditions. Digital filter processing is carried out on the reacquired reflected light signal, which can further suppress the influence of random noise, improve the signal-to-noise ratio of signal, and improve the measurement accuracy of light intensity value of different wavelengths. Since the accuracy of spectral ranging directly affects the calculation result of initial distance value, and the initial distance value is the reference for subsequent compensation distance calculation, the reliability of the entire automatic focusing process can be improved. By adaptively adjusting light source power, the power consumption can be reduced as much as possible under the premise of ensuring measurement accuracy, and the energy efficiency ratio of the system is improved.
[0065] 3, The application provides a projector automatic focusing method based on a spectrum sensor, detects parameters such as temperature, humidity and atmospheric pressure of an environment where an inertial measurement unit is located, establishes an environmental parameter influence model, and can quantitatively analyze the influence of environmental factors on the measurement accuracy of the inertial sensor. The acceleration compensation matrix and the angular velocity compensation matrix are determined based on the environmental parameter influence model, and the original measurement data is corrected. This environmental adaptability compensation mechanism can reduce the measurement error caused by environmental factors such as temperature drift and humidity change. Through zero offset 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 operation to be based on more accurate acceleration data and angular velocity data, thereby improving the calculation accuracy of the position offset and the attitude angle offset. BRIEF DESCRIPTION OF DRAWINGS
[0066] Figure 1 is a flowchart of a projector automatic focusing method based on a spectrum sensor in an embodiment of the application.
[0067] Figure 2 is another flowchart of a projector automatic focusing method based on a spectrum sensor in an embodiment of the application.
[0068] Figure 3 is an entity device structure diagram of a projector automatic focusing system based on a spectrum sensor provided in an embodiment of the application DETAILED DESCRIPTION
[0069] The terms used in the following embodiments of the application are only for the purpose of describing the specific embodiments and are not intended to be limiting on the application. As used in the specification and the appended claims of the application, the singular forms "a," "an," and "the" are intended to include both singular and plural forms, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or" used in the application means any or all possible combinations of one or more of the listed items.
[0070] Hereinafter, the terms "first" and "second" are only for the purpose of description, and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the application, the meaning of "multiple" is two or more, unless otherwise specified.
[0071] The following will be described in conjunction with Figure 1 , a projector automatic focusing method based on a spectrum sensor in an embodiment of the application is described:
[0072] Please refer to Figure 1 , a flowchart of an embodiment of a method for automatic focusing of a projector based on a spectral sensor.
[0073] S101, after controlling the light source module to emit light signals of a preset waveband to the projection surface, the spectral sensor arranged at the lens assembly of the projector collects the reflected light signals of the projection surface, and performs wavelength decomposition on the reflected light signals to obtain light intensity values of different wavelengths;
[0074] After the system controls the light source module to emit light signals of a preset waveband to the projection surface, the spectral sensor arranged at the lens assembly of the projector collects the reflected light signals of the projection surface, calculates the signal-to-noise ratio of the obtained reflected light signals, and when the signal-to-noise ratio is less than a preset signal-to-noise ratio threshold, increases the light emitting power of the light source module, and re-collects the reflected light signals, performs digital filtering on the re-collected reflected light signals to obtain filtered reflected light signals, and performs wavelength decomposition on the filtered reflected light signals to obtain light intensity values of different wavelengths.
[0075] This step is the process of collecting reflected light signals by the spectral sensor and performing wavelength decomposition. The system first controls the light source module to emit light signals of a specific preset waveband to the projection surface. These preset wavebands can include multiple waveband combinations in the visible light spectrum. The spectral sensor is arranged at a specific position of the lens assembly of the projector, which can ensure that it does not affect the projection light path and can accurately collect reflected light signals. After the light signals are emitted, the spectral sensor collects the light signals reflected by the projection surface. The system calculates the signal-to-noise ratio of the collected reflected light signals, compares the calculated signal-to-noise ratio with the preset signal-to-noise ratio threshold, and dynamically adjusts the light emitting power of the light source module. When it is detected that the signal-to-noise ratio is lower than the preset threshold, the system automatically increases the light emitting power of the light source module and re-collects the reflected light signals. In order to improve the quality of the signal, the system applies a digital filtering algorithm 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 perform wavelength decomposition on the reflected light signals to obtain light intensity values corresponding to different wavelengths. In the process of obtaining light intensity values, the system uses the dispersion element of the spectrometer to decompose the mixed light signals into monochromatic light of different wavelengths, and uses the photodetector array to accurately measure the light intensity of each wavelength. The system compensates the reflected light signals based on the collected ambient light intensity to eliminate the influence of ambient light on the measurement results, thereby obtaining more accurate light intensity value data.
[0076] S102, 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 different wavelengths;
[0077] The system is based on a preset mapping model and calculates the initial distance 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 normalized light intensity values.
[0078] Construct a feature vector, which includes the normalized light intensity value, the light intensity difference between adjacent wavelengths, and the kurtosis value of the spectral curve;
[0079] The feature vector is input into a 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.
[0080] This step involves calculating the initial distance between the projector and the projection surface based on a pre-defined mapping model. The system first normalizes the acquired light intensity values at different wavelengths, mapping all values to the [0, 1] interval to eliminate dimensional differences between wavelengths. The normalization process uses a maximum-minimum normalization method to ensure data distribution consistency. During feature vector construction, the system uses the normalized light intensity values as basic features, calculates the intensity difference between adjacent wavelengths as differential features, and calculates the kurtosis of the spectral curve as a statistical feature. Feature vector construction considers multiple statistical features of the spectral data, including the shape and variation characteristics of the spectral curve. The system inputs the constructed feature vectors into a pre-defined mapping model, which can employ machine learning algorithms such as support vector regression and neural networks to establish a mapping relationship between feature vectors and distance values through training data. To improve the stability of distance estimation, the system uses a Kalman filter algorithm to smooth the distance values output by the mapping model. Through prediction and update phases, combined with historical data and current measurements, a more stable initial distance value is obtained.
[0081] S103. Acquire the acceleration and angular velocity data collected by the inertial measurement unit set in the projector within a preset sampling period, and perform integral calculation on the acceleration and angular velocity data to obtain the position offset and attitude angle offset of the projector in three-dimensional space.
[0082] The system obtains acceleration data and angular velocity data collected by an inertial measurement unit arranged in the projector within a preset sampling period, detects 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, the average humidity value and the average atmospheric pressure value, determines an acceleration compensation matrix and an angular velocity compensation matrix according to the environmental parameter influence model, corrects the acceleration data and the angular velocity data by using the acceleration compensation matrix and the angular velocity compensation matrix, performs zero offset estimation and scale factor correction on the corrected acceleration data and the angular velocity data, inputs the corrected acceleration data and the angular velocity data into a convolutional neural network respectively for feature extraction, obtains corresponding acceleration data features and angular velocity data features, establishes a state observation equation and a state transition equation based on the acceleration data features and the angular velocity data features, solves the state observation equation and the state transition equation by using an unscented Kalman filter algorithm, obtains a preliminary pose estimation value, performs gravity compensation on the preliminary pose estimation value in combination with a preset acceleration reference value, obtains a compensated pose estimation value, performs double integration on an acceleration component in the compensated pose estimation value, obtains an initial position offset, performs integration on an angular velocity component in the compensated pose estimation value, obtains an initial attitude angle offset, and fuses and corrects the initial position offset and the initial attitude angle offset based on a complementary filter algorithm to obtain a position offset and an attitude angle offset respectively.
[0083] This step obtains the motion parameters of the projector by the inertial measurement unit and processes the data. The system continuously collects acceleration data and angular velocity data within a preset sampling period through the inertial measurement unit arranged in the projector. The system detects and records the temperature, humidity and atmospheric pressure parameters of the environment where the inertial measurement unit is located, and calculates the average values 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 according to the environmental parameter influence model, which are used to compensate the original measurement data for environmental factors. The compensated data also need to be subjected to zero offset estimation and scale factor correction to eliminate the inherent measurement errors of the sensor. The system inputs the corrected acceleration data and angular velocity data into a pre-trained convolutional neural network respectively to extract time domain and frequency domain features. Based on the extracted features, the system establishes a state observation equation and a state transition equation, and performs state estimation by using an unscented Kalman filter algorithm. The system combines the gravity acceleration reference value to perform gravity compensation on the estimation result, and through double integration of the compensated acceleration component and single integration of the angular velocity component, the position offset and the attitude angle offset are obtained respectively. Finally, the system uses a complementary filter algorithm to fuse and correct these two sets of data, thereby improving the accuracy of the pose estimation.
[0084] S104, taking the initial distance value as a reference value, determining a compensation distance of the spatial pose change of the projector in combination with the position offset and the attitude angle offset, and calculating an actual projection distance of the projector relative to the projection surface according to the compensation distance;
[0085] The system takes the initial distance value measured by the spectrum sensor as a reference value, and constructs a compensation model of the spatial pose change of the projector in combination with the position offset and the attitude angle offset obtained by the inertial measurement unit. In the compensation model, the system describes the rotation attitude of the projector by using a quaternion representation method, and calculates an attitude transformation matrix by using quaternion multiplication. The system converts the position offset into a three-dimensional displacement vector in a world coordinate system, and calculates a projection distance change in the direction of the optical axis of the projector in combination with the attitude transformation matrix. For the attitude angle offset, the system calculates the projection distance change caused by rotation by using the cosine theorem. The system establishes a spatial geometric model, and performs vector superposition on the component of the position offset in the projection direction and the distance change caused by the attitude to obtain a comprehensive compensation distance. When calculating the actual projection distance, the system considers the inclination angle of the projection surface, maps the compensation distance to the normal direction of the projection surface by using the projection theorem, and thus obtains an accurate actual projection distance.
[0086] S105, determining a target focal length value matched with the actual projection distance, and controlling the stepping motor to drive the lens assembly to move to a focusing position corresponding to the target focal length value;
[0087] The system maps the calculated actual projection distance to the target focal length value by establishing a corresponding relationship model between the projection distance and the focal length. In the corresponding relationship model, the system considers optical parameters such as the focal length range of the lens and the projection picture size, and establishes a nonlinear mapping function. The system converts the target focal length value into control parameters of the stepping motor, including the number of rotations and the number of pulses of the stepping motor. In the conversion process, the system considers mechanical parameters such as the reduction ratio of the stepping motor and the lead of the screw rod, to ensure control accuracy. The system adopts a position-velocity double closed-loop control strategy, monitors the position information of the lens assembly in real time during the driving process of the motor, adjusts the rotation speed and acceleration of the motor by using a PID control algorithm, and ensures that the lens assembly moves smoothly to the target position. During the movement, the system obtains position feedback of the lens assembly in real time by using a Hall sensor or an optical encoder, to realize closed-loop control.
[0088] S106, controlling the stepping motor to drive the lens assembly to move reciprocally according to an adaptive step value;
[0089] The system controls the stepping motor to drive the lens assembly to move reciprocally according to an adaptive step value, and the adaptive step value is determined according to the deviation between the current position and the focusing position.
[0090] The system dynamically calculates the control step length of the stepping motor according to the deviation between the current position and the target focusing position. In the adaptive step length calculation, the system uses a nonlinear function to map the position deviation to a suitable step length value. When the deviation is large, a larger step length is used to improve the adjustment speed, and when the deviation is small, a smaller step length is used to improve the accuracy. The system adjusts the step length value in real time through a fuzzy control algorithm, and establishes a fuzzy rule base between the position deviation, the rate of change of the deviation and the step length value. During the reciprocating movement, the system monitors the vibration state of the lens assembly in real time, collects vibration signals through an acceleration sensor, performs frequency spectrum analysis on the signals, identifies the resonance frequency, and adjusts the driving frequency of the motor to avoid the resonance region. The system uses an adaptive predictive control algorithm to predict the optimal control sequence based on historical adjustment data, and realizes smooth reciprocating movement of the lens assembly.
[0091] S107, triggering the light source module to re-emit light signals of a preset waveband after each reciprocating movement and collecting new reflected light signals through a spectrum sensor;
[0092] After the lens assembly completes one reciprocating movement, the system triggers the light source module to emit a new round of light signals of a preset waveband. The system triggers the light source to emit and data collection through a timer or a position sensor to ensure the accuracy of the measurement timing. During the light signal emission process, the system dynamically adjusts the emission power and wavelength combination of the light source to adapt to the characteristics of different reflection surfaces. When collecting new reflected light signals, the system adjusts the sensitivity of the spectrum sensor through an automatic gain control circuit to ensure the signal quality. The system performs real-time preprocessing on the collected spectrum data, including dark current correction, nonlinear correction, etc., to improve the reliability of the data.
[0093] S108, processing the new reflected light signals based on a preset mapping model to obtain a current measurement distance;
[0094] The system uses the same preset mapping model as the initial distance measurement to process the newly collected reflected light signals. During signal processing, the system first normalizes the spectrum data and extracts features to construct a feature vector. The system processes the feature vector through a deep learning model to extract key feature components. In the mapping model, the system uses a kernel function to map the feature space to the distance space to realize 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.
[0095] S109, 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, determining the corresponding current measurement distance as the final measurement distance;
[0096] The system compares the current measured distance with the pre-calibrated optimal imaging distance, and calculates the deviation value. In the deviation calculation, the system considers the statistical distribution of measurement error, and uses a sliding window method to analyze the continuous multiple measurement results. The system dynamically adjusts the preset threshold value through an adaptive threshold algorithm, and determines the appropriate judgment standard according to the environmental conditions and measurement accuracy requirements. The system uses a state machine to manage the focusing process, records historical measurement results, and prevents false judgments caused by transient fluctuations.
[0097] S110, determine the focusing position corresponding to the final measured distance as the final focusing position, and control the stepping motor to drive the lens assembly to move to the final focusing position.
[0098] The system converts the final measured distance into the corresponding final focusing position through the optical transfer function. In the position conversion process, the system considers the optical distortion and mechanical error of the lens, and performs compensation and correction. The system uses an adaptive control algorithm to drive the stepping motor to achieve precise positioning of the lens assembly. In the motion control, the system uses a trapezoidal velocity curve to ensure smooth motion. The system monitors the actual position of the lens assembly in real time through the position feedback loop to ensure that the final focusing position is reached.
[0099] 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 pre-set mapping model, which can reduce the influence of environmental 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. Combined with the initial distance value, the compensation distance is calculated to accurately track the spatial pose changes of the projector. An adaptive step control strategy is used to drive the lens assembly to move back and forth. The reflected light signal is continuously collected by triggering the light source module and the measured distance is updated until the preset optimal imaging distance requirement is met. This closed-loop iterative focusing method can reduce the overshoot and undershoot problems that are prone to occur in traditional fixed step focusing methods, improving the focusing accuracy and speed. The dual distance measurement mechanism of spectral sensing and inertial measurement can verify and compensate each other, improving the reliability of the ranging result, and maintaining stable focusing effect even in the case of projector shaking. The present application improves the accuracy of the projector auto-focusing, and further improves the clarity of the projection picture.
[0100] In the above embodiment step S104, the initial distance value is used as a reference value to determine the compensation distance of the spatial pose change of the projector in combination with the position offset and attitude angle offset. The following describes in detail how this step is implemented in another embodiment. The following describes in detail how this step is implemented in another embodiment. Figure 2 Another embodiment of the present application is described below.
[0101] Please refer to Figure 2 , another flowchart of a method for automatic focusing of a projector based on a spectral sensor according to an embodiment of the present application.
[0102] S201, constructing a projection geometric transformation matrix;
[0103] The system constructs a projection geometric transformation matrix, which includes a translation matrix corresponding to a position offset and a rotation matrix corresponding to an attitude angle offset.
[0104] 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 geometric transformation matrix, unifying the transformation of three-dimensional space into four-dimensional matrix operations. In the construction process, the system first establishes a world coordinate system and a local coordinate system of the projector, and defines the transformation relationship between the coordinate systems. The translation matrix corresponding to the position offset adopts the form of a 4×4 homogeneous matrix, where the 3×3 submatrix is an identity 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 also adopts the form of a 4×4 homogeneous matrix, and a complete rotation transformation matrix is constructed through a sequence of Euler angles transformation. The system uses a matrix exponential mapping method based on Lie group to map continuous rotation motion to the rotation matrix space, ensuring the continuity and accuracy of the rotation transformation. The system establishes a covariance matrix to describe the uncertainty of the transformation parameters, which is used for subsequent error propagation analysis.
[0105] S202, obtaining an optical axis vector and a projection plane normal vector of the projector;
[0106] The system calculates the optical axis vector through the optical system parameters of the projector, including the optical center position and the principal ray direction of the lens. 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 plane, by collecting the three-dimensional coordinates of multiple control points on the projection plane, and using the least squares method to fit the plane equation, thereby obtaining an accurate normal vector. The system normalizes the obtained vectors to ensure the numerical stability of subsequent calculations. In the process of obtaining the optical axis vector, the system collects the light intensity distribution through the optical sensor array, and extracts the optical axis direction combined with the image processing algorithm. For the normal vector of the projection plane, the system obtains the depth information of the projection plane through the structured light projection technology, realizing the real-time update of the normal vector.
[0107] S203, converting the optical axis vector into a unit quaternion representation, and constructing a rotation quaternion according to the attitude angle offset;
[0108] The system converts the optical axis vector into a unit quaternion representation, and constructs a rotation quaternion according to the attitude angle offset, which includes the quaternion components corresponding to the roll angle, pitch angle, and yaw angle.
[0109] The system converts the optical axis vector into a unit quaternion using the Rodrigues rotation formula, and 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 orthogonal basic rotations, and calculates the corresponding quaternion components respectively. The system uses a quaternion interpolation algorithm to achieve smooth attitude transformation and avoid gimbal lock. In the quaternion operation, the system uses a double coverage technique to handle the periodicity of the quaternion, ensuring the shortest path of the rotation interpolation. The system establishes a quaternion error model to describe the uncertainty of the attitude measurement, and performs error analysis through covariance propagation. For continuous attitude changes, the system uses a quaternion spline interpolation method to achieve smooth attitude transition.
[0110] S204, calculate the quaternion product of the rotation quaternion and the optical axis vector to obtain the optical axis vector after rotation transformation;
[0111] The system represents the optical axis vector as a pure quaternion and performs a quaternion multiplication operation with the rotation quaternion. During the operation, the system uses the property of quaternion conjugate 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. In the implementation process, the system uses the SIMD instruction set to optimize the quaternion multiplication operation and improve the calculation efficiency. The system establishes a numerical stability check mechanism for quaternion operation, and maintains the unit property of the quaternion through the regularization method. For high-speed rotation scenarios, the system updates the quaternion using the angular velocity integration method to ensure the accuracy of the rotation transformation. The system describes continuous rotation motion through the quaternion differential equation and solves the rotation trajectory using numerical integration method.
[0112] S205, construct a translation transformation matrix based on the position offset, and apply the translation transformation matrix to the optical axis vector after rotation transformation to obtain the space transformation result;
[0113] The system constructs a 4×4 homogeneous transformation matrix based on the position offset, and the matrix elements include translation vectors and rotation matrices. In the transformation process, the system uses matrix decomposition technology to decompose complex space transformation into a basic transformation sequence. The system ensures the orthogonality of the transformation matrix through eigenvalue analysis to maintain the spatial metric relationship. When applying the transformation, the system uses the block algorithm of matrix multiplication to improve the calculation efficiency of large-scale transformation. The system establishes a transformation error propagation model to analyze the influence of cumulative error on the final result. For continuous space motion, the system uses Lie algebra method to describe the velocity screw to achieve smooth motion trajectory generation.
[0114] S206, calculate the deflection angle of the projection light path according to the included angle between the space transformation result and the projection plane normal vector;
[0115] The system calculates the included angle between two vectors by vector dot product operation, and obtains the radian value by inverse cosine function. In the calculation process, the system considers the normalization processing of the vector to ensure the stability of numerical calculation. The system establishes the projection plane coordinate system, projects the space vector onto the projection plane, and calculates the deviation of the projection direction and the normal vector. For non-ideal plane, the system uses the curved surface fitting method to describe the local geometric characteristics of the projection plane, and calculates the curved surface normal vector. The system analyzes the propagation characteristics of the projection light path on the curved surface by differential geometry method, and establishes the optical path calculation model.
[0116] S207, simulating the optical path difference corresponding to the deflection angle by using the ray tracing algorithm;
[0117] The system establishes a light propagation model, including the geometric relationship of light source position, lens system and projection plane. In the ray tracing process, the system considers the optical parameters such as refractive index and dispersion, and accurately calculates the light path. The system uses recursive ray tracing algorithm to process complex light path with multiple reflections and refractions. For light rays of different wavelengths, the system establishes a dispersion model to calculate the optical path difference caused by chromatic aberration. The system simulates the statistical distribution of light rays by Monte Carlo method to evaluate the uncertainty of optical path calculation. In the ray tracing process, the system uses hierarchical bounding volume technology to accelerate the orthogonal operation of light rays and objects.
[0118] S208, vector superposition of the optical path difference and the initial distance value to obtain the compensation distance.
[0119] The system uses vector operation method to decompose the optical path difference in the projection direction to obtain the equivalent distance change. In the vector superposition process, 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 influence of the measurement error of the initial distance value and the optical path difference on the compensation distance. For dynamic changing scene, the system uses Kalman filtering algorithm to fuse multiple measurement results to improve the accuracy of the compensation distance. The system uses adaptive weight method to dynamically adjust the contribution of each component according to the reliability of measurement. In the compensation calculation, the system establishes a nonlinear optimization model to solve the optimal compensation distance.
[0120] In the above embodiment, the projection geometric transformation matrix containing the translation matrix and the rotation matrix can accurately describe the position and attitude change of the projector in the three-dimensional space. Combined with the optical axis vector and the projection plane normal vector of the projector, the spatial transformation result is calculated using the quaternion algorithm. This calculation method based on quaternion can avoid the gimbal lock problem in the traditional Euler angle representation method and improve the stability of the attitude calculation. By calculating the included angle between the transformed optical axis vector and the projection plane normal vector, the deflection angle of the projection light path can be accurately obtained. The light path difference corresponding to the deflection angle is simulated by using the ray tracing algorithm. This simulation method based on the principle of physical optics can accurately reflect the influence of the position and attitude change of the projector on the projection distance. The simulated light path difference and the initial distance value are superimposed as vectors to obtain the compensation distance. This vector operation considers the spatial directionality and can more accurately reflect the change of the actual projection distance, providing a reliable distance reference for subsequent focus control.
[0121] The system in the embodiment of the present application will be described from the perspective of hardware processing. Please refer to Figure 3 FIG. 1 is a schematic structural diagram of an entity device of a projector automatic focusing system based on a spectrum sensor according to the embodiment of the present application.
[0122] 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 function and use range of the embodiment of the present application.
[0123] As Figure 3 shown, the system includes a central processing unit (CPU) 301 which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 302 or loaded from a storage portion 308 to a random access memory (RAM) 303, such as performing the method in the above embodiment. In the RAM 303, various programs and data required for system operation are also stored. The CPU 301, the ROM 302 and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0124] The following components are connected to the I / O interface 305: an input section 306 including a camera, a microphone, and the like; an output section 307 including a liquid crystal display (LCD), a speaker, and the like; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 309 performs a communication process via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as necessary. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 310 as necessary, so that a computer program read out therefrom is installed in the storage section 308 as necessary.
[0125] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present application. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing a computer program for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 309, and / or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present application are executed.
[0126] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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 (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable computer programs. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above.
[0127] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code containing one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0128] As another aspect, the present application also provides a computer readable storage medium, which can be included in the system described in the above embodiments, or can exist independently without being assembled into the system. The above storage medium carries one or more computer programs, which, when executed by a processor of a system, enable the system to implement the method provided in the above embodiments.
[0129] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still make modifications to the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some of the technical features; and 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.
[0130] In the above embodiments, according to the context, the term "when" can be interpreted as meaning "if" or "after" or "in response to determining" or "in response to detecting". Similarly, according to the context, the phrase "upon determining" or "if detecting (the stated condition or event)" can be interpreted as meaning "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)".
[0131] In the above embodiments, all or some of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or some of the embodiments can be implemented 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, all or some of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions can 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 can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD), or semiconductor media (for example, solid state disk) and the like.
[0132] Those skilled in the art can understand that all or part of the processes in the above-mentioned method embodiments can be implemented by a computer program instructing relevant hardware to complete, the program can be stored in a computer readable storage medium, and the program can include the processes of the above-mentioned method embodiments when executed. The aforementioned storage medium includes ROM or random storage memory RAM, magnetic disc or optical disc and various storage code medium.
Claims
1. A method for auto-focusing a projector based on a spectral sensor, characterized in that, The method comprises the following steps: After the light source module emits the preset waveband of light signals to the projection surface, the reflected light signals of the projection surface are collected by the spectrum sensor arranged at the lens assembly of the projector, and the reflected light signals are wavelength-decomposed to obtain the light intensity values of different wavelengths; Based on a 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; The acceleration data and angular velocity data collected by the inertial measurement unit arranged in the projector within a preset sampling period are obtained, and 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; The initial distance value is taken as a reference value, the position offset and the attitude angle offset are combined to determine the compensation distance of the spatial pose change of the projector, and the actual projection distance of the projector relative to the projection surface is calculated according to the compensation distance; The target focal length value matched with the actual projection distance is determined, and the step motor is controlled to drive the lens assembly to move to the focusing position corresponding to the target focal length value; The step motor drives the lens assembly to move back and forth according to the adaptive step value, and the adaptive step value is determined according to the deviation between the current position and the focusing position; After each back-and-forth movement, the light source module re-emits the preset waveband of light signals, and the new reflected light signals are collected by the spectrum sensor; The new reflected light signals are processed based on the preset mapping model to obtain the current measurement 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 focusing position corresponding to the final measurement distance is determined as the final focusing position, and the step motor is controlled to drive the lens assembly to move to the final focusing position.
2. The method of claim 1, wherein, Before the wavelength decomposition of the reflected light signals, the method further comprises: The signal-to-noise ratio of the obtained reflected light signals is calculated; When the signal-to-noise ratio is less than a preset signal-to-noise ratio threshold value, the light emitting power of the light source module is increased, and the reflected light signals are re-collected; The re-collected reflected light signals are digitally filtered to obtain filtered reflected light signals; The filtered reflected light signals are wavelength-decomposed.
3. The method of claim 1, wherein, The method of calculating the initial distance value between the projector and the projection surface based on the preset mapping model according to the light intensity values of different wavelengths specifically comprises: The light intensity values of different wavelengths are normalized to obtain normalized light intensity values; A feature vector is constructed, which includes the normalized light intensity values, the light intensity difference values of adjacent wavelengths, and the kurtosis values of the spectral curves; 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 filtering algorithm to obtain an initial distance value.
4. The method of claim 1, wherein, After the acceleration data and angular velocity data collected by the inertial measurement unit arranged in the projector within a preset sampling period are obtained, the method further comprises: detecting average temperature value, average humidity value and average atmospheric pressure value of the inertial measurement unit in 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 influence model; correcting the acceleration data and the angular velocity data by using the acceleration compensation matrix and the angular velocity compensation matrix; performing zero offset estimation and scale factor correction on the corrected acceleration data and angular velocity data.
5. The method of claim 4, wherein, The acceleration data and the angular velocity data are integrated to obtain a position offset and an attitude angle offset of the projector in a three-dimensional space, specifically comprising: inputting the corrected acceleration data and angular velocity data 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 transition equation based on the acceleration data features and the angular velocity data features; solving the state observation equation and the state transition equation 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 pose estimation value to obtain an initial position offset, and integrating the angular velocity component in the compensated pose estimation value to obtain an initial attitude angle offset; fusing and correcting the initial position offset and the initial attitude angle offset based on a complementary filter algorithm to obtain a position offset and an attitude angle offset, respectively.
6. The method of claim 1, wherein, The initial distance value is taken as a reference value, and the position offset and the attitude angle offset are combined to determine a compensation distance of the spatial pose change of the projector, specifically comprising: constructing a projection geometric transformation matrix, the projection geometric transformation matrix including a translation matrix corresponding to the position offset and a rotation matrix corresponding to the attitude angle offset; obtaining an optical axis vector and a projection plane normal vector of the projector; calculating a spatial transformation result of the optical axis vector under the action of the projection geometric transformation matrix based on a quaternion algorithm; calculating a deflection angle of a projection light path according to the included angle between the spatial transformation result and the projection plane normal vector; simulating an optical path difference corresponding to the deflection angle by using a ray tracing algorithm; performing vector superposition on the optical path difference and the initial distance value to obtain a compensation distance.
7. The method of claim 6, wherein, The spatial transformation result of the optical axis vector under the action of the projection geometric transformation matrix is calculated based on a quaternion algorithm, specifically comprising: converting the optical axis vector into a unit quaternion representation form; constructing a rotation quaternion according to the attitude angle offset, the rotation quaternion including quaternion components corresponding to a roll angle, a pitch angle and a yaw angle; calculating a quaternion product of the rotation quaternion and the optical axis vector to obtain a rotation-transformed optical axis vector; constructing a translation transformation matrix based on the position offset; applying the translation transformation matrix to the rotation-transformed optical axis vector to obtain the spatial transformation result.
8. A spectral sensor based projector auto focus system, characterized in that, The system comprises: one or more processors and a memory; the memory coupled with the one or more processors, the memory configured to store computer program code comprising computer instructions, the one or more processors configured to invoke the computer instructions to cause the system to perform the method of any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, The instructions, when executed on a system, cause the system to perform the method of any one of claims 1-7.
10. A computer program product, characterised in that, The computer program product, when executed on a system, cause the system to perform the method of any one of claims 1-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