An intelligent control method based on camera auto focus and exposure
By using multi-sensor data fusion and intelligent control methods, the camera's working status is monitored in real time, solving the problem of image quality degradation in complex environments for traditional cameras. This enables intelligent adaptive imaging control, improving image quality and system reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN MINRRAY IND CORP LTD
- Filing Date
- 2025-07-21
- Publication Date
- 2026-04-28
AI Technical Summary
Traditional camera autofocus and exposure control systems are ill-suited to complex and ever-changing real-world environments, failing to adjust parameters effectively and promptly, leading to a decline in image quality. This is especially true when the camera is in an unstable state, as they cannot compensate for the effects of thermal expansion and vibration of optical components.
By using multi-sensor data fusion technology to monitor the camera's working status in real time, a temperature-focal length mapping relationship is established for temperature compensation and focus adjustment. Vibration characteristics are analyzed to dynamically adjust image stabilization parameters, image quality features are extracted to evaluate focus status, reinforcement learning algorithms are applied to optimize focus strategies, exposure parameters are adaptively adjusted according to scene characteristics, and the trend of changes in working status is predicted to achieve proactive control.
Maintaining image clarity and stability in complex and ever-changing environments, improving the camera's adaptability to different scenarios, achieving intelligent adaptive imaging control, and significantly improving image quality and system reliability.
Smart Images

Figure CN120751254B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent camera control technology, and in particular to an intelligent control method based on camera autofocus and exposure. Background Technology
[0002] Camera technology plays a crucial role in fields such as security monitoring, industrial inspection, and medical imaging, and autofocus and exposure control are core functions that ensure image quality. With the diversification and increasing complexity of application scenarios, traditional camera autofocus and exposure control systems face severe challenges and struggle to adapt to the demands of various complex environments.
[0003] Currently, mainstream camera automatic control systems primarily rely on image content analysis for parameter adjustment. While this method performs well in ideal environments, it has significant limitations in complex and ever-changing real-world applications. In particular, when the camera is in an unstable state, relying solely on image content feedback mechanisms often fails to adjust focus and exposure parameters effectively and promptly, leading to a decline in image quality.
[0004] There is a complex relationship between a camera's operating status and image quality. Changes in ambient temperature cause optical components to expand or contract thermally, directly affecting focal length accuracy. If this physical change is not compensated for in a timely manner, it will lead to a decrease in image sharpness. At the same time, the unavoidable vibrations and instabilities of cameras in practical applications can make it difficult for traditional focusing algorithms to lock the optimal focus, further deteriorating image quality. This relationship between operating status and imaging parameters is often overlooked by existing systems, lacking effective monitoring and response mechanisms.
[0005] Therefore, how to integrate the real-time working status information of the camera into the autofocus and exposure control system, establish an intelligent mapping relationship between the working status and imaging parameters, and achieve stable and high-quality imaging in various complex environments has become a key issue in the field of intelligent camera control. Summary of the Invention
[0006] This invention provides an intelligent control method for camera autofocus and exposure, mainly including:
[0007] The system collects data from multiple sensors, including temperature, acceleration, illumination, and humidity data. This data is then fused to construct a working state dataset. Based on the temperature data in the dataset, a thermal expansion model for optical components is established to calculate the influence coefficient of temperature changes on focal length. When the temperature change exceeds a preset threshold, a focal length compensation mechanism is triggered. Acceleration sensor data is extracted from the dataset, and vibration modes and intensities are identified through vibration spectrum analysis to dynamically adjust stabilization parameters. Acquired images are analyzed in real-time to extract image quality features. A multi-dimensional feature vector is constructed using the working state dataset to generate a focus status score. Based on the focus status score and environmental parameters in the dataset, the focus search strategy is dynamically adjusted. Optimal exposure parameters are calculated based on illumination data and image brightness histograms in the dataset, combined with the focus status score. Historical data is extracted from the dataset to establish a time-series prediction model, predicting camera status change trends and adjusting focus and exposure parameters in advance.
[0008] Furthermore, the fusion processing of the multi-sensor data includes: applying median filtering to the original signal to remove impulse noise; standardizing the filtered data; resampling the other sensor data using acceleration data as the reference time axis; checking the timestamp deviation of each sensor and performing phase compensation on data segments with delays exceeding a preset time; calculating the signal-to-noise ratio of each sensor data within a sliding window; establishing a Kalman filter state vector, including four dimensions: temperature, root mean square acceleration, light intensity, and humidity; and performing outlier detection on the fused state vector.
[0009] Furthermore, the step of establishing a thermal expansion model for optical components based on the temperature data in the working state dataset includes: obtaining the thermal expansion coefficients of the materials of each component of the optical system; establishing a physical model of the effect of temperature changes on focal length; obtaining the temperature-focal length mapping function by fitting using the least squares method; applying a Kalman filter algorithm to the original temperature signal to eliminate random fluctuations; calculating the ideal focal length value at the current temperature; converting the compensation amount into a stepper motor control signal; collecting image comparison data before and after compensation, and calculating the image sharpness score.
[0010] Furthermore, the step of extracting accelerometer data from the working state dataset and identifying vibration modes and intensities through vibration spectrum analysis includes: using a Butterworth low-pass filter to remove high-frequency noise; performing a fast Fourier transform on the time-domain vibration signal to obtain a vibration spectrum; extracting the main frequency components and energy distribution from the spectrum; calculating the vibration intensity value based on the sum of the vibration spectrum energy; querying a preset anti-shake parameter mapping table based on the vibration feature vector; and calculating a new exposure time according to the inverse function of vibration intensity and exposure time when the vibration intensity exceeds the medium level.
[0011] Furthermore, the real-time analysis of the acquired images and the extraction of image quality features include: calculating the image edge sharpness value using the Laplacian operator; calculating the histogram distribution of the original image and using the standard deviation of pixel brightness as the contrast value; analyzing the image's HSV color space and calculating the average value of the S channel to obtain the color saturation index; reading environmental parameters from the working state dataset and combining them with the image quality index to construct a feature vector; inputting the feature vector into a convolutional neural network model after normalization; and generating a focus quality score from the output layer of the convolutional neural network.
[0012] Furthermore, the dynamic adjustment of the focus search strategy based on the focus state score and environmental parameters in the working state dataset includes: normalizing the dataset using the Z-score method to output standardized feature vectors; constructing a state-space model based on the feature vectors; updating the state-action value table using the Q-learning algorithm; increasing the search step size to a preset proportion of the previous state and increasing the sampling frequency when the vibration intensity exceeds a preset value; monitoring the temperature change rate and expanding the focus search range if it exceeds a preset threshold; and adjusting the contrast threshold when the light intensity change exceeds a preset value.
[0013] Furthermore, the step of calculating the optimal exposure parameters based on the illumination data and image brightness histogram in the working state dataset, combined with the focus state score, includes: calculating the image brightness histogram using an image processing library; detecting the peak position of the histogram using a signal processing function, recording the peak interval and distribution standard deviation; inputting the histogram standard deviation and focus score into an optimizer, and outputting the exposure time and gain combination that minimizes the loss function; performing region segmentation on the image and calculating the brightness difference coefficient of each region; determining a high-contrast scene when the brightness difference coefficient exceeds a preset threshold; calculating multiple exposure values based on the histogram peak position and acquiring images for each value; aligning the multi-exposure images using feature point matching and achieving fusion using a Laplacian pyramid.
[0014] Furthermore, the step of extracting historical data from the working state dataset and establishing a time-series prediction model includes: reading camera operation data within a preset time period; calculating the scene brightness change rate, focus distance change rate, and camera movement speed for each frame of data; processing the data using a sliding window; inputting the sample set into a long short-term memory neural network; the model outputting the predicted changes in focus and exposure parameters within a preset time period; constructing a loss function that includes the parameter change magnitude and image difference; generating a parameter adjustment sequence using a gradient descent optimizer; adjusting the camera parameters in advance according to the time nodes of the adjustment sequence; calculating the mean square error between the predicted value and the actual value, and triggering model retraining when the error continuously exceeds a threshold.
[0015] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:
[0016] This invention discloses an intelligent control method and system for camera autofocus and exposure. It monitors the camera's operating status in real time through multi-sensor data fusion, establishes a temperature-focal length mapping relationship for temperature-compensated focus adjustment, dynamically adjusts image stabilization parameters based on vibration characteristics, extracts image quality features to evaluate focus status, applies reinforcement learning algorithms to optimize focus strategies, adaptively adjusts exposure parameters based on scene characteristics, predicts operating status changes for proactive control, automatically configures optimal parameters based on the operating environment, and continuously learns and optimizes parameter adjustment strategies. This invention maintains image clarity and stability in complex and changing environments, improves the camera's adaptability to different scenes, achieves intelligent adaptive imaging control, and significantly enhances image quality and system reliability. Attached Figure Description
[0017] Figure 1 This is a flowchart of an intelligent control method and system for camera autofocus and exposure based on the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0019] like Figure 1 This embodiment of an intelligent control method based on camera autofocus and exposure may specifically include:
[0020] Step S101, Multi-sensor data acquisition and fusion: Multi-sensor fusion technology is used to acquire camera operating status information in real time, including a temperature sensor to monitor temperature changes of optical components, an accelerometer to detect vibration, a light sensor to measure ambient light intensity, and a humidity sensor to monitor ambient humidity. The acquired data is processed through time synchronization and data standardization to construct a unified camera operating status dataset, providing basic data input for subsequent modules.
[0021] Raw voltage signals were acquired from temperature, acceleration, light, and humidity sensors at sampling frequencies of 10Hz, 100Hz, 1Hz, and 5Hz, respectively. Median filtering was applied to the raw signals to remove impulse noise, with a threshold set at three times the median absolute deviation. Data points exceeding the threshold were padded with the mean of the preceding and following points. The filtered temperature, acceleration, light, and humidity data were then normalized using min-max methods to map the values to the 0-1 range. Using the 100Hz acceleration data as the baseline time axis, linear interpolation was used to complete the 10Hz temperature data to 100Hz, nearest-neighbor interpolation was used to extend the 1Hz light data to 100Hz, and cubic spline interpolation was used to resample the 5Hz humidity data to 100Hz. Timestamp deviations for each sensor were checked, and phase compensation was performed on data segments with delays exceeding 10 milliseconds. The signal-to-noise ratio (SNR) of each sensor data within a 30-second sliding window was calculated, with signal power calculated as the square of the window mean and noise power as the window variance. The variance change rate of temperature data over a 5-minute period is analyzed, and values exceeding a preset threshold of 0.05 are marked as unstable. The distribution of illumination data is checked to see if it conforms to a Weibull distribution; a KS test p-value less than 0.01 indicates an abnormal mode. Sensor reliability is categorized into three levels (A, B, and C) based on three indicators. A Kalman filter state vector is established, containing four dimensions: temperature, RMS acceleration, illumination intensity, and humidity. The state transition matrix is set as an identity matrix, with diagonal elements of the observation matrix corresponding to sensor reliability levels A=0.9, B=0.7, and C=0.5. The state estimate is updated every 100 milliseconds, and the fused device state vector is output. The Pearson correlation coefficient between illumination and temperature is calculated, with a sliding window width of 300 seconds. When the absolute value of the correlation coefficient is greater than 0.8, a linear regression model of humidity and optical element temperature is established; an environmental anomaly flag is triggered when the residual exceeds twice the standard deviation. A 3σ outlier detection is performed on the fused state vector; an alarm is triggered when the temperature exceeds 35℃ or the RMS acceleration exceeds 0.5g. An environmental anomaly is defined as a change in light intensity exceeding 100 lux per second or a change in humidity exceeding 5% per minute. The optical stability index is calculated as the integral of the acceleration energy in the 50-200 Hz frequency band. The temperature and humidity combination index is the product of the temperature value and the logarithm of the relative humidity. The mechanical stability score is based on the ratio of peak acceleration to fundamental frequency amplitude. The final health score is a weighted sum of three indicators, with weights of 0.4, 0.3, and 0.3, respectively.
[0022] In one embodiment, a multi-sensor fusion system was constructed to monitor the operating environment of precision optical equipment. The system integrates sensors with different sampling frequencies: temperature (10Hz), acceleration (100Hz), illumination (1Hz), and humidity (5Hz).
[0023] Specifically, the original signal is first processed by median filtering.
[0024] For example, when the temperature sensor shows a momentary spike of 35.7℃ (while the preceding and following data points are 23.2℃ and 23.5℃ respectively), the system determines that this point exceeds three times the median absolute deviation threshold and automatically replaces it with 23.35℃. This processing effectively eliminates pulse noise caused by electromagnetic interference.
[0025] It should be noted that, in order to unify the data timeline, the system resamples based on 100Hz acceleration data. Temperature data is extended from 10Hz to 100Hz using linear interpolation to maintain the smoothness of temperature changes; illumination data is extended from 1Hz to 100Hz using nearest neighbor interpolation, which is suitable for handling abrupt changes in illumination conditions; and humidity data is resampled from 5Hz to 100Hz using cubic spline interpolation to preserve the curve characteristics of humidity changes.
[0026] For example, in sensor reliability assessment, the system calculates the signal-to-noise ratio (SNR) within a 30-second sliding window. When the light sensor has a mean of 500 lux and a variance of 25 within the window, the SNR is calculated to be 10000 / 25 = 400, indicating good signal quality. However, when the accelerometer is subjected to mechanical vibration interference, its SNR may drop below 5, and the system downgrades its reliability to level C (0.5).
[0027] In one possible implementation, the Kalman filter fuses data from four sensors.
[0028] For example, when a temperature sensor (Class A, 0.9) displays 24.5°C, while a vibration-affected accelerometer (Class C, 0.5) displays an abnormally high RMS value of 0.8g, the filter will assign a higher confidence level to the temperature data based on reliability weights, thereby obtaining a more accurate state estimate.
[0029] Preferably, the system also establishes a correlation model between environmental parameters. When the Pearson correlation coefficient between light and temperature reaches 0.85, the system establishes a linear regression model between humidity and optical element temperature to predict humidity values under normal conditions. If the actual humidity deviates from the predicted value by more than two standard deviations, the system will trigger an environmental anomaly flag, indicating a potential risk of condensation.
[0030] Step S102, Temperature-Compensated Focus Adjustment: Based on the temperature data in the multi-sensor dataset, a thermal expansion model of the optical components is established, and the influence coefficient of temperature change on the focal length is calculated. When a temperature change exceeding a preset threshold of 2℃ is detected, the focal length compensation mechanism is automatically triggered. According to the pre-established temperature-focal length mapping relationship, the focal length parameters are finely adjusted in real time to offset the focus shift caused by temperature changes and maintain image sharpness. The temperature-compensated focal length parameters and the original focal length parameters are recorded together in the working state dataset for subsequent analysis.
[0031] The thermal expansion coefficients of the materials of each component in the optical system are obtained. Combined with the distance between optical elements and the refractive index parameters, a physical model of the effect of temperature change on focal length is established. The physical model adopts a linear regression form, where the temperature change is the independent variable and the focal length change is the dependent variable. A temperature-focal length mapping function is obtained by fitting using the least squares method, and the SciPy library in Python is used for optimization during the fitting process. The temperature sensor data stream is read, and a Kalman filter algorithm is applied to the raw temperature signal to eliminate random fluctuations. The filtering process is implemented using the FilterPy library in Python. The difference between the filtered temperature value and the previous temperature value is calculated using the formula: current temperature value minus the previous temperature value. It is determined whether the temperature change exceeds a preset threshold; if so, focal length compensation is performed. The ideal focal length value at the current temperature is calculated by substituting the filtered temperature value into the mapping function and compared with the current actual focal length value to obtain the focal length compensation amount. The compensation amount is converted into a stepper motor control signal, which is in pulse width modulation form. After receiving the control signal, the stepper motor drives the focusing ring to adjust the lens position according to the calculated compensation amount. After adjustment, the actual displacement is fed back, and the deviation between the actual compensation value and the theoretical compensation value is recorded. The deviation is calculated by subtracting the theoretical compensation value from the actual compensation value. Image comparison data before and after compensation are collected, and image sharpness score is calculated using the Laplacian operator. The scoring formula is the sum of the second derivatives of the image grayscale values. The relationship between sharpness score and temperature change is plotted as a scatter plot using Python's Matplotlib library. The temperature-sharpness impact model is updated, using a linear regression model where temperature change is the independent variable and sharpness score is the dependent variable. The focus drift trend after multiple consecutive compensations is monitored. If the drift direction is consistent and the amplitude increases, a self-learning mechanism is triggered. The self-learning mechanism uses gradient descent to adjust the influence coefficient in the temperature-focus mapping function to reduce cumulative error. The temperature change process, focus parameters before and after compensation, image sharpness score, and mapping function correction history are recorded to construct an optical system temperature adaptability database, serving as the basis for optical component aging analysis and predictive maintenance.
[0032] In one embodiment, a high-precision astronomical observation system employs temperature-adaptive focusing technology. The system integrates various optical components, including a primary mirror (quartz glass, coefficient of thermal expansion 0.55 × 10⁻⁻⁻⁻⁴). 6 / ℃) and secondary mirror (aluminum alloy, coefficient of thermal expansion 23×10⁻ 6 / ℃). The system achieves precise autofocus compensation by establishing a physical model of temperature and focal length changes.
[0033] Specifically, the system first acquires the material parameters and initial position data of each optical element.
[0034] For example, the initial distance between the primary and secondary mirrors is 500 mm, and the focal length of the primary mirror is 1200 mm. Experimental measurements show that for every 1°C increase in ambient temperature, the distance between the primary and secondary mirrors increases by approximately 0.011 mm, resulting in a change in focal length of approximately 0.025 mm. The system uses the least squares method to fit and derive the temperature-focal length mapping function: ΔF = 0.025 × ΔT + 0.002, where ΔF is the change in focal length (mm) and ΔT is the change in temperature (°C).
[0035] It should be noted that the original temperature signal is often subject to electronic noise interference.
[0036] For example, in one measurement, the temperature sensor read [22.1, 22.3, 24.8, 22.2, 22.4]℃ within 5 seconds, where 24.8℃ was clearly an outlier. After applying Kalman filtering, the system obtained a smoothed sequence: [22.1, 22.2, 22.3, 22.3, 22.4]℃, effectively eliminating sudden noise.
[0037] For example, when the system detects that the temperature rises from 22°C to 24°C (a change of 2°C), it calculates that the focal length should be compensated by 0.052mm according to the mapping function. The system converts this compensation amount into a stepper motor control signal, with each step being 0.001mm, requiring a total of 52 steps. After compensation, the system calculates the image sharpness score using the Laplacian operator. The score before compensation was 78.5, and after compensation, it improved to 92.3, verifying the effectiveness of the compensation.
[0038] Preferably, the system also establishes a self-learning mechanism. During continuous observation, if a deviation is found between the actual compensation effect and the theoretical expectation, such as the theoretical compensation being 0.052mm but the actual optimal compensation being 0.058mm, the system will automatically adjust the mapping function parameters and update them to ΔF=0.029×ΔT+0.002, making subsequent compensation more accurate.
[0039] Step S103, Vibration State Detection and Image Stabilization: Accelerometer data is extracted from the working state dataset, and the camera's vibration mode and intensity are identified using a vibration spectrum analysis algorithm. Based on the vibration characteristics, image stabilization parameters are dynamically adjusted. When significant vibration is detected, the exposure time is automatically shortened to reduce motion blur. Simultaneously, the ISO sensitivity is adjusted according to the illumination sensor data in the working state dataset to maintain appropriate brightness. The vibration state information and the corresponding image stabilization parameter adjustment results are recorded in the working state dataset, providing a basis for focusing strategy optimization.
[0040] Raw triaxial data is acquired from an accelerometer. A Butterworth low-pass filter is used to remove high-frequency noise, with a cutoff frequency of 50Hz and an order of 4. The filtered triaxial data is converted into a time-domain vibration signal, and the vibration amplitude and frequency characteristics are calculated. A Fast Fourier Transform (FFT) is performed on the time-domain vibration signal to obtain the vibration spectrum. The dominant frequency components and energy distribution are extracted from the spectrum, and the vibration modes are classified into three types based on the frequency distribution characteristics: low-frequency jitter, mid-frequency vibration, and high-frequency tremor. The vibration intensity value is calculated based on the sum of the vibration spectrum energy, and the vibration state is classified into three levels: slight, moderate, and severe according to a preset vibration intensity threshold. The vibration intensity value and vibration type are combined to form a vibration feature vector. The vibration feature vector is used to look up a preset image stabilization parameter mapping table to obtain the corresponding optical image stabilization compensation, electronic image stabilization sensitivity, and exposure parameter adjustment coefficients. The current exposure time value is read. When the vibration intensity exceeds the moderate level, the new exposure time is calculated according to the inverse ratio function of vibration intensity and exposure time. The reduction in exposure time increases with increasing vibration intensity. The system reads data from the light sensor and, combined with the shortened exposure time, calculates the required ISO sensitivity adjustment using a brightness compensation formula. While maintaining image brightness, it increases the ISO value to compensate for the brightness loss caused by the shortened exposure time. The vibration feature vector, the pre- and post-adjustment stabilization parameters, exposure time, and ISO sensitivity values are written into the working status dataset. A timestamp and camera position information are added to establish a correlation record between vibration status and stabilization processing.
[0041] In one embodiment, a high-precision astrophotography system employs vibration detection and adaptive image stabilization technology. The system mounts a three-axis accelerometer on the telescope base, with a sampling rate of 200Hz, to monitor vibrations in the observation environment in real time.
[0042] Specifically, the system first processes the raw acceleration data using a Butterworth low-pass filter.
[0043] For example, in one observation, the original X-axis data sequence [0.12, 0.18, 0.45, 0.15, 0.19]g was filtered to obtain [0.13, 0.15, 0.17, 0.18, 0.19]g, effectively removing burst noise. The filtered triaxial data was converted into a time-domain vibration signal, with an calculated amplitude of 0.25g and a dominant frequency of approximately 12Hz.
[0044] For example, the system performs a 1024-point FFT transform on the vibration signal, and the resulting spectrum shows that the energy is mainly distributed in the 10-15Hz frequency band, which is a typical "mid-frequency vibration" type. The system calculates the total energy of the vibration spectrum to be 0.58, corresponding to a "moderate" vibration intensity level.
[0045] It should be noted that the vibration feature vector [12Hz, 0.58, "mid-frequency vibration", "medium"] is used to look up the image stabilization parameter mapping table. Based on this feature vector, the system obtains an optical image stabilization compensation of ±0.8mm, an electronic image stabilization sensitivity of 0.65, and an exposure parameter adjustment factor of 0.7.
[0046] In one possible implementation, the system reads the current exposure time as 1 / 15 of a second. Since the vibration intensity is at a "medium" level, the system calculates the new exposure time as 1 / 15 × 0.7 = 1 / 21 of a second using an inverse proportional function. Simultaneously, the light sensor reading is 320 lux, and the system adjusts the ISO sensitivity from the original value of 400 to 570 to compensate for the brightness loss caused by the shortened exposure time.
[0047] Preferably, the system writes the complete record [timestamp: 20230615-203045, location: right ascension 120.5° declination +45.2°, vibration feature vector: [12Hz, 0.58, "mid-frequency vibration", "medium"], exposure time: 1 / 15→1 / 21, ISO: 400→570] into the working status dataset for subsequent analysis and anti-shake strategy optimization.
[0048] Step S104, Image Quality Feature Extraction and Evaluation: Real-time analysis of the acquired images is performed to extract key indicators such as edge sharpness, contrast, and color saturation. A multi-dimensional feature vector is constructed by combining this vector with temperature, vibration, illumination, and humidity data from the working state dataset. This feature vector is then input into a pre-trained focus quality evaluation network to generate a current focus status score, which is recorded in the working state dataset to provide a basis for focus strategy optimization.
[0049] Raw image data is acquired from an image acquisition device. The Laplacian operator is used to calculate the image edge sharpness value; a higher edge sharpness value indicates more accurate focus. A histogram distribution is calculated for the raw image, and the standard deviation of pixel brightness is used as the contrast value, reflecting the image's detail representation. The image's HSV color space is analyzed, and the average value of the S channel is calculated to obtain a color saturation index, reflecting the image's color reproduction degree. Environmental parameters such as temperature, vibration, light intensity, and humidity values from the working state dataset are read and combined with the image quality index to construct a 20-dimensional feature vector. After normalization, the feature vector is input into a convolutional neural network model built with TensorFlow. The convolutional neural network model extracts quality patterns from the feature vector through a three-layer convolutional structure with a kernel size of 3x3 and a stride of 1. The output layer of the convolutional neural network generates a focus quality score, ranging from zero to one hundred. A score greater than eighty is considered a high-quality focus state. The focus quality score is associated with environmental parameters and recorded in the working state dataset. A random forest algorithm built with Scikit-learn is used to analyze the changes in focus quality under different environmental conditions.
[0050] In one embodiment, a high-precision astronomical photography system employs image quality assessment techniques. The system first processes the acquired celestial images using the Laplacian operator to calculate edge sharpness values.
[0051] For example, applying a 5×5 Laplacian kernel to a raw image of the edge region of the Milky Way yields an edge sharpness value of 78.5, indicating good focus.
[0052] Specifically, the system calculates a pixel brightness histogram for the same image, obtaining a standard deviation of 42.3, reflecting a high level of contrast and enabling clear separation of dark-area stars from the background. Simultaneously, the system analyzes the S channel in the HSV color space, calculating an average saturation value of 0.65, indicating that the color reproduction reaches a professional level.
[0053] It should be noted that the system reads environmental parameters from the working state dataset: temperature -5℃, vibration value 0.12g, light intensity 0.02 lux, and humidity 35%. These environmental parameters, combined with image quality indicators, form a 20-dimensional feature vector [78.5, 42.3, 0.65, -5, 0.12, 0.02, 35, ... ], which, after Min-Max normalization, is input into a convolutional neural network constructed using TensorFlow.
[0054] For example, this convolutional neural network adopts a three-layer convolutional structure. The first layer uses 32 3×3 convolutional kernels to extract low-level features, the second layer uses 64 3×3 convolutional kernels to extract mid-level features, and the third layer uses 128 3×3 convolutional kernels to extract high-level features. After processing by the fully connected layers, the network outputs a focus quality score of 87.6, which is judged as a high-quality focus state.
[0055] In one possible implementation, the system associates the focus quality score with environmental parameters and records it in the working state dataset. Analysis using the random forest algorithm reveals that in low-temperature environments (-10℃ to 0℃), when the vibration value is below 0.15g, the focus quality score is generally above 85 points. However, when the temperature rises above 15℃, the focus quality score decreases by an average of 12.3 points under the same vibration conditions, indicating that temperature changes have a significant impact on the focusing accuracy of the optical system.
[0056] Step S105, Adaptive Focus Strategy Optimization: Based on the focus status score and environmental parameters in the working state dataset, a reinforcement learning algorithm is applied to dynamically adjust the focus search strategy. Under vibration conditions, the search step size is reduced and the sampling frequency is increased; under rapid temperature changes, the search range is expanded; and under drastic lighting changes, the contrast threshold judgment criterion is adjusted to achieve environmental adaptive optimization of the focusing process. The optimized focus parameters and corresponding working states are recorded in the dataset for exposure control and parameter prediction.
[0057] Focusing score data was acquired using an industrial camera, and vibration intensity from a triaxial accelerometer, temperature change rate from a thermocouple, and illumination intensity from a photoresistor were simultaneously collected to form the original dataset. The dataset was normalized using the Z-score method, outputting a standardized feature vector. The vector dimensions included the focus quality score (0-100), vibration intensity (g), temperature change rate (℃ / s), and illumination intensity (lux). A state-space model was constructed based on the feature vector, with state variables defined as the current focus position (μm), search step size (μm / step), and sampling frequency (Hz). The Q-learning algorithm was used to update the state-action value table, with the action set including step size increment / decrement by 10% and frequency multiplication / division by 2. When the vibration intensity exceeded 0.5g, the search step size was set to 50% of the previous state, and the sampling frequency was increased to 200% of the previous state. The temperature change rate was monitored; if it exceeded 0.1℃ / s, the focus search range was expanded to a multiple of the temperature change rate of the previous state. Within the expanded range, a binary search was used, dividing the search interval in half each iteration until the focus score difference was less than 5 points. When the light intensity change exceeds 50 lux, the contrast threshold is adjusted to the square root of the previous state's (current light intensity / reference light intensity) multiple. The optimized parameters are written to a time-series database, with each record containing a timestamp, focus position, search step size, sampling frequency, contrast threshold, vibration intensity, temperature change rate, and light intensity. A random forest regression algorithm is used to train the prediction model, with environmental parameters as input and focus position and step size as output. Feature importance is ranked using the Gini coefficient. When the Euclidean distance between new environmental data and historical records is less than 0.2, the prediction parameters are directly loaded.
[0058] In one embodiment, a high-precision astronomical telescope autofocus system employs environmentally aware focusing optimization technology. The system acquires real-time images of celestial bodies using an industrial camera, calculates a focus score, and simultaneously collects environmental parameters to form a multidimensional dataset.
[0059] For example, during a Milky Way galaxy imaging session, the system recorded raw data including a focus score of 78, vibration intensity of 0.3g, temperature change rate of 0.05℃ / s, and illumination intensity of 25 lux.
[0060] Specifically, the system uses the Z-score normalization method to process these data, converting the focus score of 78 to 0.65, vibration intensity of 0.3g to 0.42, temperature change rate of 0.05℃ / s to -0.38, and illumination intensity of 25 lux to -0.72, forming a feature vector [0.65, 0.42, -0.38, -0.72]. Based on this feature vector, the system constructs a state-space model, with initial state variables set as follows: focus position 12500μm, search step size 5μm / step, and sampling frequency 10Hz.
[0061] It should be noted that the system employs a Q-learning algorithm to optimize the focusing strategy. In one observation, the vibration intensity suddenly increased to 0.6g (exceeding the threshold of 0.5g). The system immediately reduced the search step size from 5μm to 2.5μm and simultaneously increased the sampling frequency from 10Hz to 20Hz, effectively suppressing the impact of vibration on focusing accuracy. Simultaneously, the system detected a temperature change rate of 0.12℃ / s and automatically expanded the focusing search range from ±50μm to ±56μm (the original range multiplied by the temperature change rate of 1.12), using a binary search method within this range to find the optimal focusing position.
[0062] For example, when the illumination intensity suddenly changes from 25 lux to 85 lux (a change of more than 50 lux), the system adjusts the contrast threshold from the original 0.35 to 0.65 (the original threshold multiplied by the square root of (85 / 25), 1.84). The system records these optimized parameters in a time-series database, including the timestamp 2023-05-15T20:30:45, focus position 12527μm, search step size 2.5μm, sampling frequency 20Hz, contrast threshold 0.65, vibration intensity 0.6g, temperature change rate 0.12℃ / s, and illumination intensity 85 lux.
[0063] In one possible implementation, the system uses a random forest regression algorithm to train a prediction model. Analysis revealed that the feature importance of vibration intensity is 0.42, the temperature change rate is 0.35, and the light intensity is 0.23, indicating that vibration has the greatest impact on focusing. When the system detects that the new environmental parameters [0.58g, 0.11℃ / s, 80lux] have a Euclidean distance of 0.15 from the historical records (less than the threshold of 0.2), it directly loads the predicted focus position of 12525μm and a step size of 2.5μm, eliminating the need for a re-search and significantly improving focusing speed.
[0064] Step S106, State-Aware Exposure Control: Illumination data and real-time image brightness histograms are extracted from the working state dataset. Combined with focus state scores, optimal exposure parameters are calculated. When a high-contrast scene is detected, HDR mode is automatically activated based on image feature evaluation results. Multiple images with different exposure values are captured, and a high dynamic range image is generated through an exposure fusion algorithm to improve imaging quality under complex lighting conditions. Exposure parameters and fusion results are recorded in the working state dataset, providing a data foundation for state prediction.
[0065] The system reads the current frame image and corresponding illumination sensor data from the working state dataset. It calculates the image brightness histogram using OpenCV, detects the peak positions using `scipy.signal.find_peaks`, and records the peak intervals and standard deviations. The histogram standard deviation and focus score are input into the Adam optimizer, with a learning rate of 0.01 and 50 iterations. The output is the exposure time and gain combination that minimizes the loss function. OpenCV's GrabCut is used for image region segmentation, and the (max-min) / mean ratio of each region is calculated as the brightness difference coefficient. When the brightness difference coefficient exceeds a preset threshold of 0.7, it is considered a high-contrast scene. Based on the bimodal position of the histogram, a Gaussian mixture model is used to calculate underexposure, standard, and overexposure values, and images are acquired for each. SIFT is used for multi-exposure image alignment, and OpenCV's createLaplacianPyramid is used for fusion, with weights determined by the contrast and saturation of each pixel. OpenCV's TonemapDurand is applied to the fused image for tone mapping, with parameters dynamically adjusted according to the histogram distribution. The final parameters and histogram features are stored in an SQLite database, and the RandomForestRegressor of scikit-learn is used to establish a mapping relationship between lighting parameters and exposure parameters.
[0066] In one embodiment, an automatic exposure control system for an astronomical telescope employs multi-exposure fusion technology. The system first reads the current frame of the starry sky image and illumination sensor data from the operating status dataset, recording the starry sky brightness as 25 lux. The system uses OpenCV to calculate the image brightness histogram and detects two main peaks using scipy.signal.find_peaks, located at gray values of 35 and 178, with a peak interval of 143 and a standard deviation of 52.3.
[0067] Specifically, the system inputs the histogram standard deviation of 52.3 and the focus score of 82.5 into the Adam optimizer, sets the learning rate to 0.01, and after 50 iterations, outputs an optimal exposure time of 1.2 seconds and a gain of 1.8. This combination reduces the loss function value to 0.023. The system uses OpenCV's GrabCut algorithm to segment the starry sky image, dividing it into star regions and background regions. The calculated brightness difference coefficient is 0.85, exceeding the preset threshold of 0.7, thus classifying it as a high-contrast scene.
[0068] It should be noted that the system calculates three exposure values based on the bimodal position of the histogram using a Gaussian mixture model: underexposure (0.8 seconds), standard (1.2 seconds), and overexposure (1.6 seconds), and acquires images for each value. The SIFT algorithm is used to align the multi-exposure images, ensuring precise matching of the star positions in the three images, with a maximum deviation of less than 0.5 pixels.
[0069] For example, the system implements image fusion using OpenCV's `createLaplacianPyramid`, with weights determined by the contrast and saturation of each pixel. In the stellar region, the contrast weight is 0.7 and the saturation weight is 0.3; in the background region, the contrast weight is 0.4 and the saturation weight is 0.6. The fused image is then tone-mapped using TonemapDurand, with parameters dynamically adjusted based on the histogram distribution: contrast 0.85 and saturation 1.2.
[0070] In one possible implementation, the system stores the final parameters and histogram features in an SQLite database, including the timestamp 2023-06-20T22:15:30, histogram peak position [35, 178], exposure time 1.2 seconds, gain 1.8, and tone mapping parameters [0.85, 1.2]. The system uses RandomForestRegressor to establish the mapping relationship between illumination parameters and exposure parameters. Feature importance analysis shows that the histogram standard deviation accounts for 0.45, the peak interval accounts for 0.32, and the illumination intensity accounts for 0.23.
[0071] Step S107, Working State Prediction and Proactive Control: Historical data and corresponding parameter adjustment records are extracted from the working state dataset to establish a time-series prediction model, predicting the camera's state change trend in the near future. Based on the prediction results, focus and exposure parameters are adjusted in advance to reduce image quality fluctuations caused by state changes, achieving proactive control of parameter adjustments. The prediction results and pre-adjusted parameters are recorded in the working state dataset, providing predictive support for scene adaptive parameter configuration.
[0072] Camera operation data from the past 24 hours is read from the working status dataset, including focus parameters, exposure parameters, and scene feature vectors. For each frame, the scene brightness change rate (brightness difference between the current and previous frames divided by the time interval), focus distance change rate (focus position difference in the current frame divided by the time interval), and camera movement speed (obtained via an IMU sensor) are calculated. A sliding window is used to process the data, with a window length of 5 minutes and a step size of 1 minute. Data within each window is arranged chronologically, forming a sample set containing sequences of brightness change rate, focus change rate, and movement speed. This sample set is input into an LSTM neural network with 3 nodes in the input layer, 6 nodes in the hidden layer, and 2 nodes in the output layer (corresponding to focus and exposure changes in the next 30 seconds). During training, iteration stops when the validation set loss function does not decrease for 5 consecutive iterations. The model outputs the predicted changes in focus and exposure parameters in the next 30 seconds. When the changes exceed preset thresholds (focus change exceeding 5 units, exposure change exceeding 10 units), an adjustment process is initiated. A loss function is constructed that incorporates the magnitude of parameter changes and image dissimilarity, where image dissimilarity is calculated using the SSIM algorithm. This function is optimized using TensorFlow's GradientDescentOptimizer with a learning rate of 0.01, iterating 20 times to generate a parameter adjustment sequence. Each node in the sequence contains a timestamp, target focus value, and target exposure value, with the magnitude of changes between adjacent nodes not exceeding hardware limitations (focus step size 0.5 units / ms, exposure step size 1 unit / ms). Camera parameters are adjusted in advance based on the time nodes of the adjustment sequence, and the actual parameter values are recorded through encoder feedback. The mean squared error between the predicted and actual values is calculated, and model retraining is triggered when the error exceeds a threshold for 10 consecutive times. The prediction results, adjusted parameters, and actual values are written to the `prediction_log` table in the database, and a B+ tree index based on the timestamp field is built. Records older than 30 days are deleted every day at midnight.
[0073] In one embodiment, an astronomical observation system employs predictive parameter adjustment technology, which predicts future parameter changes by analyzing historical data. The system extracts operational data from the past 24 hours from its operational status dataset, including focus distance, exposure time, and scene feature vectors. The system calculates that the scene brightness change rate for each frame is 0.8 units / second, the focus distance change rate is 0.3 units / second, and the camera movement speed is 0.5 degrees / second.
[0074] Specifically, the system uses a sliding window with a length of 5 minutes and a step size of 1 minute to process the data, forming a sample set containing 300 time points. Each sample includes three features: brightness change rate, focus change rate, and movement speed. These samples are input into an LSTM network with 3 input nodes, 6 hidden nodes, and 2 output nodes. During training, training stops when the validation set loss function remains at 0.023 for 5 consecutive iterations, for a total of 87 iterations.
[0075] For example, the system predicts that the focus parameter will change by 7.2 units and the exposure parameter will change by 12.5 units within the next 30 seconds, both exceeding preset thresholds. The system constructs a loss function, where the parameter change magnitude is weighted at 0.7 and the image difference is weighted at 0.3. After 20 iterations using TensorFlow's optimizer, a parameter adjustment sequence containing 6 time points is generated.
[0076] In one possible implementation, the first node of the sequence is adjusted to the current time + 5 seconds, increasing the focus value by 1.5 units and the exposure value by 3.0 units; the last node is the current time + 28 seconds, increasing the focus value by a total of 7.0 units and the exposure value by a total of 12.0 units. The system adjusts the parameters in advance based on this sequence, and the actual parameters are recorded through encoder feedback. The calculated mean square error between the predicted and actual values is 0.18, which is below the threshold of 0.25, thus eliminating the need to trigger model retraining.
[0077] It should be noted that the system writes the prediction results, adjusted parameters, and actual values to the `prediction_log` table in the database. The records include fields such as timestamp 2023-07-15T03:42:18, predicted focus change 7.2, predicted exposure change 12.5, actual focus change 7.0, and actual exposure change 12.0. This table has a B+ tree index based on timestamps, improving query efficiency by approximately 85%.
[0078] Step S108, Scene Adaptive Parameter Configuration: Based on the image feature analysis results and sensor data in the working state dataset, combined with the state prediction results, a scene recognition model is constructed to automatically identify the current working environment type. According to the recognition results, the most matching basic parameter configuration is selected from a preset scene parameter library, and then fine-tuned by combining the prediction results and real-time working state data to achieve scene adaptation of camera parameters. The scene recognition results and parameter configuration scheme are recorded in the working state dataset to provide training samples for continuous learning.
[0079] Image feature vectors, including features such as contrast, color distribution, and texture complexity, are extracted from the working state dataset. The OpenCV library is used to calculate these image feature vectors. Simultaneously, light intensity, ambient temperature, and camera motion information are read from sensor data. Principal component analysis (PCA) is applied to the extracted image feature vectors for dimensionality reduction. The PCA function from the Scikit-learn library is used to retain the top N feature dimensions with the highest explained variance. The dimensionality-reduced image feature vectors are merged with the sensor data to form a scene feature matrix. A random forest algorithm is used to classify the scene feature matrix and train a scene recognition model. The recognition results include environmental type labels such as indoor, outdoor, low light, strong light, and fast motion. Based on the identified environmental type labels, a preset scene parameter library is queried to extract the corresponding basic parameter configuration template, which includes initial values for parameters such as focus range, exposure time, and white balance. A weighted fusion algorithm is used to combine the basic parameter configuration and state prediction results to calculate the parameter adjustment amount. The weight coefficients are dynamically updated based on historical adjustment effects, and the LinearRegression function from the Scikit-learn library is used to update the weights. The preliminarily adjusted parameter values are obtained. For the initially adjusted parameter values, fine-tuning is performed by combining the image sharpness score and exposure histogram distribution from the real-time working status data. The adjustment step size varies with the image quality score, and the adjustment step size is calculated using the image quality evaluation function in the OpenCV library. The scene recognition results, parameter configuration scheme, and adjusted actual parameter values are written into the working status dataset, and a timestamp index and scene type index are established. Expired data is periodically cleaned up, and typical samples are retained for model updates.
[0080] In one embodiment, an astronomical observation system improves image quality through scene-adaptive parameter configuration technology. The system first extracts image feature vectors from the operational dataset, including feature values such as a mean contrast of 0.72, color saturation of 0.65, and texture complexity of 0.43. Simultaneously, it reads sensor data at an illumination intensity of 2300 lux, an ambient temperature of 18.5°C, and a camera rotation speed of 0.8 degrees per second.
[0081] Specifically, the system applies PCA to reduce the dimensionality of the extracted 15-dimensional image feature vectors, retaining the top 5 feature dimensions that explain 92% of the variance. The reduced feature vectors are then merged with the sensor data to form an 8-dimensional scene feature matrix. A random forest algorithm (tree depth 12, number of trees 100) is used to classify the feature matrix, training a scene recognition model with an accuracy of 87.5%.
[0082] For example, in a certain observation, the system identified the environment type label as "outdoor - low light - slow movement" with a confidence level of 0.92. The system then queries a preset scene parameter library and extracts the basic parameter configuration template for the corresponding environment type: focus range 50-200 meters, exposure time 1.2 seconds, and color temperature 4200K. A weighted fusion algorithm is then used to combine the basic parameters and the state prediction results to calculate the parameter adjustment amount, where the basic parameters have a weight of 0.65 and the prediction results have a weight of 0.35.
[0083] It should be noted that the system performs fine-tuning of parameters based on the initial adjusted parameter values, combined with the image sharpness score (8.2 / 10) and exposure histogram distribution (15% to the left of center) from real-time operating status data. When the sharpness score is below 8.5, the system sets the focus adjustment step size to 2.0 units; when the score is above 8.5, the step size is reduced to 0.5 units. Ultimately, the system adjusts the focus distance to 125 meters, the exposure time to 1.35 seconds, and the color temperature to 4350K.
[0084] In one possible implementation, the system writes the scene recognition results, parameter configuration scheme, and adjusted actual parameter values into the `scene_config` table of the working status dataset. The record includes fields such as timestamp 2023-08-22T21:15:43, scene type ID 5, focus distance 125, exposure time 1.35, and color temperature 4350. This table also has a timestamp-based B-tree index and a scene type-based hash index, improving query efficiency by approximately 78%.
[0085] Step S109, Continuous Learning and Parameter Optimization: Extract working state data, image quality assessment results, and parameter adjustment effect feedback from the working state dataset. Continuously learn the mapping relationship between the working state and the optimal imaging parameters through an adaptive parameter mapping network. As the system is used over time, it continuously optimizes the parameter adjustment strategy, identifying best practices by analyzing historical adjustment data, thereby improving the system's adaptability to different environmental conditions and image quality stability. The learning results are updated in the parameter mapping network and fed back to the working state dataset, forming a closed-loop optimization mechanism.
[0086] Work status data, image quality scores, and parameter adjustment records for the most recent month are extracted from the work status dataset. These are sorted by timestamp and outliers are removed to obtain a valid training sample set. Feature engineering is performed on the valid training sample set to extract work status feature vectors and corresponding optimal parameter configuration pairs. Normalization is used to eliminate differences in feature dimensions, constructing a standardized feature matrix. A gradient boosting tree model is trained using this standardized feature matrix. The work status feature vectors are input, and the predicted optimal parameter configuration is output. Cross-validation is used during model training to select the best hyperparameter combination. K-means clustering is performed on historical parameter adjustment records based on image quality scores to identify parameter adjustment patterns under different environmental conditions, extracting the parameter adjustment rules and key parameter sensitivities for high-quality imaging. A parameter adjustment decision tree is constructed based on the clustering analysis results. Differentiated adjustment strategies are set for branches under different environmental conditions. The adjustment step size is proportional to the rate of change of image quality scores, and the adjustment direction is determined by the quality score gradient. The gradient boosting tree model is updated through incremental learning. Newly added high-quality samples are given higher weights, while the weights of low-quality samples are reduced. Model parameters are updated weekly to maintain a balance between knowledge accumulation and environmental adaptability. The updated gradient boosting tree model and the adjusted decision tree are integrated into the adaptive parameter system. At the same time, the model version and performance indicators are recorded to form a complete parameter optimization closed loop, continuously improving the system's adaptability to complex environments.
[0087] In one embodiment, an astronomical observation system improves image quality through a data-driven parameter optimization method. The system first extracts data records from the most recent 30 days of its operational dataset, containing 12,583 raw samples. After outlier detection, the system removes samples with a signal-to-noise ratio below 3.5 and records with abnormal exposure times (deviations from the mean by more than 3 standard deviations), ultimately retaining 11,247 valid training samples.
[0088] Specifically, the system performs feature engineering on each sample, extracting an 18-dimensional working state feature vector, including key parameters such as ambient light intensity, atmospheric transparency, target celestial body brightness, and equipment temperature. These features, along with their corresponding optimal parameter configurations (such as exposure time, gain value, and focus position), form feature-label pairs. Through the Min-Max normalization method, the system unifies features of different dimensions into the [0,1] interval, constructing a standardized feature matrix.
[0089] For example, the system uses the XGBoost algorithm to train a gradient boosting tree model, setting the learning rate to 0.05, the maximum tree depth to 8, and the regularization parameter λ to 1.2. The optimal hyperparameter combination is determined through 5-fold cross-validation, and the final model's mean squared error of parameter prediction on the validation set is 0.037, a reduction of 42.3% compared to the baseline model.
[0090] It should be noted that the system performed K-means cluster analysis (K=5) on the historical parameter adjustment records to identify parameter adjustment patterns under different environmental conditions.
[0091] For example, in the "low light - high humidity" environment cluster, increasing the exposure time by 0.5 seconds and increasing the gain by 2.3dB resulted in an average improvement of 1.7 points in image quality score; while in the "strong light - low humidity" environment cluster, decreasing the exposure time by 0.3 seconds and adjusting the color temperature to 5600K resulted in the most significant improvement in quality score.
[0092] In one possible implementation, the system constructs a parameter adjustment decision tree and sets differentiated adjustment strategies for different environmental conditions. When the image quality score is below 7.5 and the rate of change is negative, the system uses a larger adjustment step size (exposure step size of 0.2 seconds); when the score is above 8.5 and tends to stabilize, a finer adjustment step size (exposure step size of 0.05 seconds) is used. Through this adaptive adjustment mechanism, the system's average convergence time is reduced by 37%.
[0093] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An intelligent control method based on camera autofocus and exposure, characterized in that, include: Collect data from multiple sensors, including temperature data, acceleration data, illumination data, and humidity data; The multi-sensor data is fused to construct a working status dataset; Based on the temperature data in the working status dataset, an optical element thermal expansion model is established, the influence coefficient of temperature change on focal length is calculated, and when the temperature change exceeds a preset threshold, a focal length compensation mechanism is triggered. Accelerometer data is extracted from the working status dataset, vibration modes and intensities are identified through vibration spectrum analysis, and anti-shake parameters are dynamically adjusted. The acquired images are analyzed in real time to extract image quality features. A multi-dimensional feature vector is constructed by combining the working status dataset to generate a focus status score. Based on the focus status score and the environmental parameters in the working status dataset, the focus search strategy is dynamically adjusted. Based on the illumination data and image brightness histogram in the working state dataset, and combined with the focus state score, the optimal exposure parameters are calculated. Historical data is extracted from the working status dataset to establish a time-series prediction model, predict the trend of camera status changes, and adjust the focus and exposure parameters in advance. The step of extracting historical data from the working status dataset and establishing a time-series prediction model includes: Read camera operation data within a preset time period; For each frame of data, calculate the scene brightness change rate, focus distance change rate, and camera movement speed; Data is processed using a sliding window; The sample set is input into the long short-term memory neural network; The model outputs the predicted changes in focus and exposure parameters within a preset time period. Construct a loss function that includes the magnitude of parameter changes and image differences; Use the gradient descent optimizer to generate parameter adjustment sequences; Adjust camera parameters in advance according to the time points of the adjustment sequence; Calculate the mean square error between the predicted and actual values, and trigger model retraining when the error continuously exceeds the threshold.
2. The method as described in claim 1, characterized in that, The fusion processing of the multi-sensor data includes: Median filtering was used to remove impulse noise from the original signal; Standardize the filtered data; Using acceleration data as the reference time axis, data from other sensors are resampled; Check the timestamp deviation of each sensor and perform phase compensation on data segments with delays exceeding a preset time; Calculate the signal-to-noise ratio of each sensor's data within the sliding window; Establish the state vector of the Kalman filter, which includes four dimensions: temperature, root mean square acceleration, light intensity, and humidity. Outlier detection is performed on the fused state vector.
3. The method as described in claim 1, characterized in that, The step of establishing a thermal expansion model for optical components based on temperature data in the working state dataset includes: Obtain the coefficients of thermal expansion of the materials of each component of the optical system; Establish a physical model of the effect of temperature change on focal length; The temperature-focal length mapping function was obtained by fitting using the least squares method. The Kalman filter algorithm is applied to the original temperature signal to eliminate random fluctuations; Calculate the ideal focal length at the current temperature; Convert the compensation amount into a stepper motor control signal; Collect image comparison data before and after compensation, and calculate the image sharpness score.
4. The method as described in claim 1, characterized in that, The step of extracting acceleration sensor data from the working state dataset and identifying vibration modes and intensity through vibration spectrum analysis includes: Use a Butterworth low-pass filter to remove high-frequency noise; Perform a fast Fourier transform on the time-domain vibration signal to obtain the vibration spectrum. Extract the dominant frequency components and energy distribution from the spectrum; The vibration intensity value is calculated based on the sum of the vibration spectrum energy. Query the preset anti-shake parameter mapping table based on the vibration feature vector; When the vibration intensity exceeds the medium level, the new exposure time is calculated according to the inverse function of vibration intensity and exposure time.
5. The method as described in claim 1, characterized in that, The real-time analysis of the acquired images and extraction of image quality features includes: Calculate the image edge sharpness value using the Laplacian operator; Calculate the histogram distribution of the original image and use the standard deviation of pixel brightness as the contrast value; Analyze the image's HSV color space and calculate the average value of the S channel to obtain the color saturation index; Read environmental parameters from the working status dataset and combine them with image quality indicators to construct a feature vector; The feature vectors are normalized and then input into the convolutional neural network model; The output layer of a convolutional neural network generates a focus quality score.
6. The method as described in claim 1, characterized in that, The dynamic adjustment of the focus search strategy based on the focus status score and environmental parameters in the working status dataset includes: The dataset is normalized using the Z-score method, and a standardized feature vector is output. Construct a state-space model based on feature vectors; Update the state-action value table using the Q-learning algorithm; When the vibration intensity exceeds the preset value, the search step size is set to the preset ratio of the previous state to increase the sampling frequency. Monitor the rate of temperature change; if it exceeds a preset threshold, expand the focus search range. When the light intensity changes beyond the preset value, the contrast threshold is adjusted.
7. The method as described in claim 1, characterized in that, The step of calculating the optimal exposure parameters based on the illumination data and image brightness histogram in the working state dataset, combined with the focus state score, includes: Use an image processing library to calculate the image brightness histogram; The peak positions of the histogram are detected using signal processing functions, and the peak intervals and distribution standard deviations are recorded. Input the histogram standard deviation and focus score into the optimizer, and output the exposure time and gain combination that minimizes the loss function; Perform region segmentation on the image and calculate the brightness difference coefficient of each region; When the brightness difference coefficient exceeds a preset threshold, it is determined to be a high contrast scene; Based on the peak position of the histogram, calculate multiple exposure values and acquire images for each value. Multi-exposure image alignment is performed using feature point matching, and fusion is achieved through Laplacian pyramids.
8. A computer device, comprising: Memory and processor; The memory stores a computer program, characterized in that: when the processor executes the computer program, it implements the steps of the intelligent control method based on camera autofocus and exposure as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Camera adaptive adjustment method and system, and storage medium
CN119545164A
Fast auto-exposure method for camera, and storage medium
WO2022067496A1