A camera automatic focusing method based on lidar depth estimation
By sub-region division and dynamic weight allocation of camera image data, combined with the adaptive feedback mechanism, the problem of insufficient depth estimation accuracy and focus efficiency of the camera automatic focusing method in complex scenarios in the prior art is solved, and efficient and accurate automatic focusing effect is achieved.
Patent Information
- Application Number
- CN202510854620.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-25
AI Technical Summary
The existing camera autofocus method based on lidar depth estimation has shortcomings in depth estimation accuracy, focus efficiency and system robustness. Especially in complex scenarios, it is susceptible to occlusion, high dynamic range areas and hardware calibration errors, and it is difficult to meet the needs of efficient and accurate automaticfocusing in practical applications.
By sub-region division of the image data acquired by the camera, the occlusion status of objects in the sub-regions of different marks are detected, the focus processing in different modes is carried out, the depth confidence value is calculated in combination with the dynamic weight allocation algorithm, the appropriate focus strategy model is selected, and an adaptive feedback mechanism is introduced for real-time monitoring and dynamic adjustment.
It improves the focus efficiency and accuracy in complex scenarios, enhances the robustness of the system, and ensures efficient and accurate automatic focus in dynamic environments.
Smart Images

Figure CN120378739B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automatic focusing technology, and more particularly to a camera automatic focusing method based on laser radar depth estimation. Background Art
[0002] With the rapid development of lidar and camera technology, camera autofocus methods based on lidar depth estimation have gradually become a research hotspot in the fields of image processing and robotic vision. Obtaining depth information of the target scene through lidar and combining it with camera autofocus can significantly improve the target imaging quality in complex environments or dynamic scenes, showing important application value. However, existing related technical solutions still have shortcomings in depth estimation accuracy, focusing efficiency and system robustness, which affects their performance in practical applications.
[0003] The above problems show that the existing camera autofocus method based on lidar depth estimation still has certain shortcomings in terms of depth estimation accuracy, focusing efficiency and system robustness. In particular, it is easily affected by occlusion, high dynamic range areas and hardware calibration errors in complex scenes, and it is difficult to meet the needs of practical applications for efficient and accurate autofocus. Summary of the Invention
[0004] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a camera automatic focusing method based on lidar depth estimation. The image data acquired by the camera is divided into sub-areas and marked with different credibility levels. The occlusion status of objects in the sub-areas with different marks is detected and different modes of focusing processing are performed to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A camera automatic focusing method based on laser radar depth estimation comprises the following steps:
[0007] Step S1, scanning the target scene to generate point cloud data and capturing scene image data, converting the point cloud data into an initial depth distribution, extracting image texture features using the scene image data and calculating the depth error, and correcting the initial depth distribution according to the depth error;
[0008] Step S2: Divide the corrected depth distribution into regions and obtain the depth features of each sub-region. After processing the depth features of each region, use the dynamic weight allocation algorithm to calculate the depth confidence value and classify and mark the sub-regions.
[0009] Step S3: Filter the sub-regions according to the classification labels, detect each sub-region to obtain detection results, analyze the depth change trend of the occluded area in each sub-region based on the detection results and the screening results, select different modes for processing according to the depth change trend of the occluded area in each sub-region, and generate a depth change trend data set;
[0010] Step S4: Select a focusing strategy model based on the depth change trend dataset, introduce an adaptive feedback mechanism to monitor the focusing effect in real time and dynamically adjust the focusing strategy model.
[0011] In a preferred embodiment, in step S1, the point cloud data is a set of three-dimensional coordinate points, which is used to represent the shape and features of the surface of an object in the target scene; the image data is a depth image of the target scene;
[0012] The correction formula is based on the initial depth distribution: D1(x, y) = D0(x, y) + α × G(x, y), where G(x, y) is the texture gradient amplitude of the image at the (x, y) position, D0(x, y) is the initial correction distribution, and α is the correction coefficient.
[0013] In a preferred embodiment, in step S1, the depth values of multiple points in the depth image of the target scene are obtained and the difference between the depth values of the corresponding points in the point cloud data is taken as the depth error of the corresponding points. The average depth error of all points in the point cloud data corresponding to the target scene is calculated as the depth error of the target scene. The product of the depth error generated by the target and the preset correction ratio is used as the correction coefficient and marked as α.
[0014] In a preferred embodiment, in step S2, the corrected depth distribution is divided into N sub-regions according to a preset area, and the average depth value Di of the i-th sub-region can be calculated by the formula Di = (1 / Ai) ∑(x,y)∈Ri D1(x, y), where Ai represents the area of the sub-region Ri, and ∑(x,y)∈Ri represents the sum of the depth values of all pixels in the sub-region;
[0015] The average depth values of all sub-areas are aggregated to form a depth distribution dataset and marked separately.
[0016] In a preferred embodiment, in step S2, the dynamic weight allocation algorithm obtains the depth confidence Ci of sub-region i by the formula Ci = β1 × T(i) + β2 × L(i) + β3 × S(i), where T(i) represents the texture complexity score, L(i) represents the illumination uniformity score, S(i) represents the depth distribution smoothness score, and β1, β2, and β3 are the weight coefficients of each scoring item respectively;
[0017] When the depth confidence value of the sub-region exceeds a preset confidence threshold, the sub-region is marked as a high confidence region; otherwise, the sub-region is marked as a low confidence region.
[0018] In a preferred embodiment, in step S2, an edge detection algorithm is used to extract the edges in each sub-region and calculate the gradient of the image, and the gradient standard deviation of the edge points is calculated as the texture complexity score of the sub-region;
[0019] When calculating the illumination uniformity score of a sub-region, the brightness standard deviation of the pixels in the region is calculated. The ratio of the brightness standard deviation of the sub-region to the difference between the maximum and minimum brightness of the sub-region is first used as the illumination uniformity deviation. The difference between 1 and the illumination uniformity deviation is used as the illumination uniformity score.
[0020] When calculating the depth distribution smoothness score of a sub-region, a local window is used to calculate the depth value change of the sub-region, the depth value of each pixel in the local window is obtained, and the ratio of the average depth value of all pixels in the local window to the maximum depth value is calculated as the gradient change amplitude. The result of the difference between 1 and the gradient change amplitude of the local window in the sub-region is used as the depth distribution smoothness score of the sub-region.
[0021] In a preferred embodiment, in step S3, the low-confidence area is screened out, and occlusion detection is performed on each sub-area to identify the occlusion state in the sub-area. The occlusion state in the sub-area includes moving objects and static objects.
[0022] For occlusion caused by moving objects, the system uses time series analysis to predict depth change trends and obtain the depth value of each pixel in the corresponding sub-area;
[0023] For occlusion caused by static objects, the system estimates the depth value of each pixel in the corresponding sub-area through the neighborhood depth interpolation method;
[0024] The depth values of each pixel in the sub-area obtained by the two methods are merged to generate a depth change trend dataset.
[0025] In a preferred embodiment, in step S4, the standard deviation of the data in the depth change trend data set of the sub-region is calculated to obtain the average depth change amplitude of the corresponding sub-region, and the median of the average depth change amplitudes of all sub-regions is selected as the depth change trend threshold;
[0026] If the average depth change amplitude of the sub-region exceeds the depth change trend threshold, the depth change trend of the corresponding sub-region is judged to be drastic; if the average depth change amplitude of the sub-region exceeds the depth change trend threshold, the depth change trend of the corresponding sub-region is judged to be stable.
[0027] In a preferred embodiment, in step S4, when the depth variation trend of the sub-area is stable, a linear focusing strategy model is adopted to achieve rapid focusing by gradually adjusting the focal length; when the depth variation trend is drastic, the system adopts a nonlinear focusing strategy model to ensure focusing accuracy by adjusting the focal length in segments;
[0028] In the adaptive feedback mechanism, the actual imaging of the target scene is obtained, and the focus error E is calculated based on the image data collected by the camera. The focus adjustment step size is adjusted according to the error size.
[0029] When the focusing error exceeds the preset focusing contrast value, the focus adjustment step is randomly increased; when the focusing error is lower than the preset focusing contrast value, the focus adjustment step is randomly decreased.
[0030] The technical effects and advantages of the camera automatic focusing method based on laser radar depth estimation of the present invention are as follows:
[0031] The present invention generates point cloud data by scanning the target scene and captures the target scene image data, converts the point cloud data into an initial depth distribution, extracts image texture features and calculates the depth error to correct the initial depth distribution. The correction step greatly improves the image depth accuracy, divides the corrected depth distribution into regions and obtains the depth features of each sub-region, calculates the depth confidence value and classifies and marks the sub-regions, screens the sub-regions according to the classification marks, detects the sub-regions and analyzes the depth change trend of the occluded regions in each sub-region based on the screening results, selects different modes to process the sub-regions according to the depth change trend and generates a depth change trend data set, selects a focusing strategy model according to the depth change trend data set, introduces an adaptive feedback mechanism to monitor the focusing effect in real time and dynamically adjusts the focusing strategy model, so as to improve the focusing efficiency and accuracy in complex scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a schematic diagram of a camera automatic focusing method based on lidar depth estimation according to the present invention. DETAILED DESCRIPTION
[0033] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0034] The present invention generates point cloud data by scanning a target scene and captures image data of the target scene, converts the point cloud data into an initial depth distribution, extracts image texture features and calculates depth errors to correct the initial depth distribution, divides the corrected depth distribution into regions and obtains depth features of each sub-region, calculates depth confidence values and classifies and marks the sub-regions, screens the sub-regions according to the classification marks, detects the sub-regions and analyzes the depth change trends of occluded regions in each sub-region based on the screening results, selects different modes to process the sub-regions according to the depth change trends and generates a depth change trend data set, selects a focusing strategy model according to the depth change trend data set, introduces an adaptive feedback mechanism to monitor the focusing effect in real time and dynamically adjusts the focusing strategy model, so as to improve the focusing efficiency and accuracy in complex scenes.
[0035] Embodiment, a camera automatic focusing method based on laser radar depth estimation, such as Figure 1 As shown, the following steps are included:
[0036] Step S1, scanning the target scene to generate point cloud data and capturing scene image data, converting the point cloud data into an initial depth distribution, extracting image texture features using the scene image data and calculating the depth error, and correcting the initial depth distribution according to the depth error;
[0037] Step S2: Divide the corrected depth distribution into regions and obtain the depth features of each sub-region. After processing the depth features of each region, use the dynamic weight allocation algorithm to calculate the depth confidence value and classify and mark the sub-regions.
[0038] Step S3: Filter the sub-regions according to the classification labels, detect each sub-region to obtain detection results, analyze the depth change trend of the occluded area in each sub-region based on the detection results and the screening results, select different modes for processing according to the depth change trend of the occluded area in each sub-region, and generate a depth change trend data set;
[0039] Step S4: Select a focusing strategy model based on the depth change trend dataset, introduce an adaptive feedback mechanism to monitor the focusing effect in real time and dynamically adjust the focusing strategy model.
[0040] The specific implementation is as follows:
[0041] In step S1, a target scene is scanned by a laser radar to generate point cloud data, and image data of the target scene is captured by a camera;
[0042] Point cloud data is a collection of three-dimensional coordinate points, which is used to represent the shape and features of the surface of objects in the target scene; image data is the depth image of the target scene.
[0043] The point cloud data generated by the lidar is converted into an initial depth distribution after preprocessing. During preprocessing, the depth value of each point is extracted from the point cloud data and a depth map is constructed to convert the depth value into a depth distribution;
[0044] It should be explained that the depth value of each point is the value of the z coordinate in the set of three-dimensional coordinate points in the point cloud data. The depth map is a structure that converts depth values into depth distribution. The conversion is achieved by corresponding the depth value of each pixel to the depth of the nearest point in the point cloud data.
[0045] Image data is used to extract texture feature information. During this process, the system maps the point cloud data to a two-dimensional image plane to form an initial depth distribution matrix D0(x, y), where x and y represent the pixel coordinate positions respectively.
[0046] The system then extracts texture feature information from the image, including parameters such as gradient amplitude and direction. By analyzing the correlation between texture features and depth error, the system corrects the initial depth distribution. The specific steps are as follows:
[0047] The correction formula based on the initial depth distribution is: D1(x, y) = D0(x, y) + α × G(x, y), where G(x, y) is the texture gradient amplitude of the image at the (x, y) position, D0(x, y) is the initial correction distribution, and α is the correction coefficient used to adjust the influence of texture features on the depth distribution.
[0048] The corrected depth distribution D1(x, y) more accurately reflects the true depth information of the target scene.
[0049] Furthermore, before correcting the initial depth distribution, the specific steps for obtaining the depth error are as follows:
[0050] Use a high-precision depth sensor to obtain the depth values of multiple points in the depth image of the target scene and take the difference between them and the depth values of the corresponding points in the point cloud data as the depth error of the corresponding points. Calculate the average depth error of all points in the point cloud data corresponding to the target scene as the depth error of the target scene. The product of the depth error generated by the target and the preset correction ratio is used as the correction coefficient and marked as α.
[0051] It should be noted that there is no single type of high-precision depth sensor, and the specific selection is determined by the accuracy requirements of the staff.
[0052] In step S2, the corrected depth distribution is divided into multiple sub-regions according to the preset area and the depth distribution characteristics of each sub-region are obtained. The average depth value of each sub-region is calculated according to the depth distribution characteristics of each sub-region, and the average depth values of all sub-regions are aggregated to form a depth distribution data set and marked separately.
[0053] For example, assuming that the target scene is divided into N sub-regions, the average depth value Di of the i-th sub-region can be calculated by the formula Di = (1 / Ai) ∑(x,y)∈Ri D1(x, y), where Ai represents the area of the sub-region Ri and ∑(x,y)∈Ri represents the sum of the depth values of all pixels in the sub-region.
[0054] These average depth values are aggregated to form a depth distribution dataset, which provides input for the subsequent dynamic weight allocation algorithm. During this process, the system also records the depth distribution characteristics of each sub-area, such as the standard deviation of the depth change and the difference between the maximum and minimum values, in order to further evaluate the depth confidence of the sub-area.
[0055] The system calculates the depth confidence of each sub-area based on the depth distribution dataset combined with a dynamic weight allocation algorithm.
[0056] The dynamic weight allocation algorithm comprehensively considers the texture complexity, illumination uniformity, and smoothness of the depth distribution of each subregion. Specifically, the depth confidence Ci of subregion i can be calculated using the formula Ci = β1 × T(i) + β2 × L(i) + β3 × S(i), where T(i) represents the texture complexity score, L(i) represents the illumination uniformity score, S(i) represents the depth distribution smoothness score, and β1, β2, and β3 are the weight coefficients for each score item.
[0057] Through the above formula, the system can assign a depth confidence value to each sub-region, compare the depth confidence value with the preset confidence threshold to classify different sub-regions, and when the depth confidence value of the sub-region exceeds the confidence threshold, the sub-region is marked as a high-confidence region; when the depth confidence value of the sub-region is lower than the confidence threshold, the sub-region is marked as a low-confidence region.
[0058] Before using the dynamic weight allocation algorithm, the edge detection algorithm is used to extract the edges of each sub-region and calculate the gradient of the image. The gradient standard deviation of the edge points is calculated as the texture complexity score of the sub-region; the larger the gradient standard deviation of the edge points in the sub-region, the greater the texture complexity score of the sub-region;
[0059] When calculating the illumination uniformity score for a sub-region, the brightness standard deviation of the pixels in the region is calculated. The ratio of the brightness standard deviation of the sub-region to the difference between the maximum and minimum brightness of the sub-region is first taken as the illumination uniformity deviation. The difference between 1 and the illumination uniformity deviation is then used as the illumination uniformity score. The smaller the brightness standard deviation of the sub-region, the smaller the illumination uniformity deviation, and the closer the score is to 1.
[0060] When calculating the depth distribution smoothness score of a sub-region, a local window is used to calculate the depth value change of the sub-region, obtain the depth value of each pixel in the local window, calculate the ratio of the average depth value of all pixels in the local window to the maximum depth value as the gradient change amplitude, and subtract 1 from the gradient change amplitude of the local window in the sub-region as the depth distribution smoothness score of the sub-region; the smaller the depth change amplitude of the sub-region, the smoother the depth distribution of the sub-region, and the higher the depth distribution smoothness score of the sub-region.
[0061] The depth information in high-confidence areas is more reliable, while low-confidence areas may have occlusion or high dynamic range problems and require further analysis.
[0062] It should be noted that the weight coefficient of each scoring item in the above method of calculating depth confidence is given by professionals in this field, and the assignment is changed by setting a change period. For example, if the change period is set to one month, the weight coefficient of each scoring item will be assigned a value change every month. The local window is a small area selected in the image for local calculation and feature extraction. The size of the local window is not unique and will not be elaborated here.
[0063] In step S3, based on the classification results, the low-confidence areas are screened out, and occlusion detection is performed on each sub-area to identify the occlusion state within the sub-area. The occlusion state within the sub-area includes moving objects and static objects.
[0064] For occlusion caused by moving objects, the system uses time series analysis methods to predict depth change trends.
[0065] Specifically, the system tracks the depth changes of occluded areas across multiple frames of data and fits a depth curve using a linear regression model. Assuming that the depth of the occluded area changes over time t according to the equation z(t) = k × t + b, where k is the slope and b is the intercept, the system uses the least squares method to find the optimal values of k and b, thereby predicting the depth value at the future moment.
[0066] For occlusion caused by static objects, the system estimates the depth value using a neighborhood depth interpolation method. The specific formula is Z(x, y) = (1 / N) ∑(xi,yi)∈N(x,y) Z(xi,yi), where N(x,y) represents the neighborhood set centered at (x,y), Z(xi,yi) represents the depth value of the pixels in the neighborhood, and N is the number of pixels in the neighborhood.
[0067] According to the above two methods, the depth value of each pixel in the sub-area at different times is obtained and a depth change trend dataset is generated to provide a basis for the subsequent selection of focusing strategies.
[0068] It should be noted that in the past, cameras did not distinguish the state of objects in the image data when processing focus adjustment, and used a unified algorithm for focusing. As a result, the focus point was often blurred, the focusing speed was slow, or even the focus could not be completed.
[0069] In step S4, the system selects different focusing strategy models based on the depth change trend dataset, calculates the standard deviation of the data in the depth change trend dataset of the sub-region to obtain the average depth change amplitude of the corresponding sub-region, and selects the median of the average depth change amplitudes of all sub-regions as the depth change trend threshold;
[0070] If the average depth change amplitude of the sub-region exceeds the depth change trend threshold, the depth change trend of the corresponding sub-region is judged to be drastic; if the average depth change amplitude of the sub-region exceeds the depth change trend threshold, the depth change trend of the corresponding sub-region is judged to be stable.
[0071] When the depth change trend is stable, the system adopts a linear focusing strategy model to achieve fast focusing by gradually adjusting the focal length.
[0072] The adjustment formula for the linear focus strategy is F(t+1) = F(t) + ΔF, where F(t) represents the current focal length value and ΔF is the step size of each adjustment, which is obtained by multiplying the depth change amplitude of the corresponding sub-area of the target scene by the preset adjustment ratio.
[0073] When the depth changes dramatically, the system adopts a nonlinear focusing strategy model to ensure focusing accuracy by adjusting the focal length in segments.
[0074] The adjustment formula of the nonlinear focusing strategy is F(t+1) = F(t) + k × |Z(t+1) - Z(t)|, where Z(t) and Z(t+1) represent the depth values at the current and next moments, respectively, and k is a proportional coefficient used to control the sensitivity of focus adjustment.
[0075] It should be noted that the proportional coefficient setting of the nonlinear focusing strategy is not unique and can be set according to actual conditions. For example, the proportional coefficient can be set to 0.8, etc., which is not limited here.
[0076] In addition, the system also introduces an adaptive feedback mechanism to monitor the focusing effect in real time and dynamically adjust the focusing strategy.
[0077] Specifically, the system calculates the focus error E by comparing the actual image obtained by the high-precision sensor with the image obtained by the camera. It then adjusts the focus adjustment step size ΔF based on the magnitude of the error. The focus error E can be calculated using the formula E = (1 / M) ∑m=1M |I(m) - I'(m)|, where M represents the total number of pixels in the imaging area, and I(m) and I'(m) represent the brightness values of the actual image and the camera image, respectively.
[0078] When the focusing error exceeds the preset focusing contrast value, the system randomly increases ΔF to speed up the focusing speed to meet the preset focusing speed requirement; when the focusing error is lower than the preset focusing contrast value, the system randomly reduces ΔF to improve the focusing accuracy to meet the preset focusing accuracy requirement.
[0079] To verify the effectiveness of the present invention, a specific application scenario is given below: assuming that the target scene is a car driving on a city road with multiple pedestrians and vehicles in front, the system generates point cloud data through lidar scanning and captures image data through a camera.
[0080] The system converts point cloud data into initial depth distribution and corrects it based on image texture feature information. It divides the corrected depth distribution into multiple sub-areas and calculates the average depth value and depth confidence of each sub-area. It detects the existence of occlusion areas between pedestrians and vehicles in front and further analyzes their depth change trends. For pedestrian occlusion areas, the system uses time series analysis methods to predict depth change trends; for vehicle occlusion areas, the system estimates their depth values through neighborhood depth interpolation methods. After generating a depth change trend data set, it selects different focusing strategy models and adjusts the focal length in real time through an adaptive feedback mechanism to ensure optimal imaging clarity.
[0081] The above embodiments may be implemented in whole or in part through software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product.
[0082] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application of the technical solution and the invention constraints. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0083] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0084] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
[0085] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A camera automatic focusing method based on laser radar depth estimation, characterized in that: The following steps are included: Step S1, scanning the target scene to generate point cloud data and capturing scene image data, converting the point cloud data into an initial depth distribution, extracting image texture features using the scene image data and calculating the depth error, and correcting the initial depth distribution according to the depth error; Step S2: Divide the corrected depth distribution into regions and obtain the depth features of each sub-region. After processing the depth features of each region, use the dynamic weight allocation algorithm to calculate the depth confidence value and classify and mark the sub-regions. In step S2, the dynamic weight allocation algorithm obtains the depth confidence Ci of sub-region i by the formula Ci = β1 × T(i) + β2 × L(i) + β3 × S(i), where T(i) represents the texture complexity score, L(i) represents the illumination uniformity score, S(i) represents the depth distribution smoothness score, and β1, β2, and β3 are the weight coefficients of each scoring item respectively; When the depth confidence value of a sub-region exceeds a preset confidence threshold, the sub-region is marked as a high confidence region; Otherwise, the subregion is marked as a low-confidence region; Step S3: Filter the sub-regions according to the classification labels, detect each sub-region to obtain detection results, analyze the depth change trend of the occluded area in each sub-region based on the detection results and the screening results, select different modes for processing according to the depth change trend of the occluded area in each sub-region, and generate a depth change trend data set; In step S3, the low-confidence area is screened out, and occlusion detection is performed on each sub-area to identify the occlusion state in the sub-area. The occlusion state in the sub-area includes moving objects and static objects. For occlusion caused by moving objects, the system uses time series analysis to predict depth change trends and obtain the depth value of each pixel in the corresponding sub-area; For occlusion caused by static objects, the system estimates the depth value of each pixel in the corresponding sub-area through the neighborhood depth interpolation method; The depth values of each pixel in the sub-area obtained by the two methods are combined to generate a depth change trend dataset; Step S4: Select a focusing strategy model based on the depth change trend dataset, introduce an adaptive feedback mechanism to monitor the focusing effect in real time and dynamically adjust the focusing strategy model.
2. The camera automatic focusing method based on laser radar depth estimation according to claim 1, characterized in that: In step S1, the point cloud data is a set of three-dimensional coordinate points used to represent the shape and features of the surface of an object in the target scene; the image data is a depth image of the target scene; The correction formula is based on the initial depth distribution: D1(x, y) = D0(x, y) + α × G(x, y), where G(x, y) is the texture gradient amplitude of the image at the (x, y) position, D0(x, y) is the initial correction distribution, and α is the correction coefficient.
3. The camera automatic focusing method based on laser radar depth estimation according to claim 2, characterized in that: In step S1, the depth values of multiple points in the depth image of the target scene are obtained and the difference between them and the depth values of the corresponding points in the point cloud data is taken as the depth error of the corresponding points. The average depth error of all points in the point cloud data corresponding to the target scene is calculated as the depth error of the target scene. The product of the depth error generated by the target and the preset correction ratio is used as the correction coefficient and marked as α.
4. The camera automatic focusing method based on laser radar depth estimation according to claim 2, characterized in that: In step S2, the corrected depth distribution is divided into N sub-regions according to the preset area, and the average depth value Di of the i-th sub-region can be calculated by the formula Di = (1 / Ai) ∑(x,y)∈Ri D1(x, y), where Ai represents the area of the sub-region Ri, and ∑(x,y)∈Ri represents the sum of the depth values of all pixels in the sub-region; The average depth values of all sub-areas are aggregated to form a depth distribution dataset and marked separately.
5. The camera automatic focusing method based on laser radar depth estimation according to claim 1, characterized in that: In step S2, the edge detection algorithm is used to extract the edges in each sub-region and calculate the gradient of the image, and the gradient standard deviation of the edge points is calculated as the texture complexity score of the sub-region; When calculating the illumination uniformity score of a sub-region, the brightness standard deviation of the pixels in the region is calculated. The ratio of the brightness standard deviation of the sub-region to the difference between the maximum and minimum brightness of the sub-region is first used as the illumination uniformity deviation. The difference between 1 and the illumination uniformity deviation is used as the illumination uniformity score. When calculating the depth distribution smoothness score of a sub-region, a local window is used to calculate the depth value change of the sub-region, the depth value of each pixel in the local window is obtained, and the ratio of the average depth value of all pixels in the local window to the maximum depth value is calculated as the gradient change amplitude. The result of the difference between 1 and the gradient change amplitude of the local window in the sub-region is used as the depth distribution smoothness score of the sub-region.
6. The camera automatic focusing method based on laser radar depth estimation according to claim 1, characterized in that: In step S4, the standard deviation of the data in the depth change trend data set of the sub-region is calculated to obtain the average depth change amplitude of the corresponding sub-region, and the median of the average depth change amplitudes of all sub-regions is selected as the depth change trend threshold; If the average depth change amplitude of the sub-region exceeds the depth change trend threshold, the depth change trend of the corresponding sub-region is judged to be drastic; if the average depth change amplitude of the sub-region is lower than the depth change trend threshold, the depth change trend of the corresponding sub-region is judged to be stable.
7. The camera automatic focusing method based on laser radar depth estimation according to claim 6, characterized in that: In step S4, when the depth variation trend of the sub-area is stable, a linear focusing strategy model is adopted to achieve rapid focusing by gradually adjusting the focal length; when the depth variation trend is drastic, the system adopts a nonlinear focusing strategy model to ensure focusing accuracy by adjusting the focal length in segments; In the adaptive feedback mechanism, the actual imaging of the target scene is obtained, and the focus error E is calculated based on the image data collected by the camera. The focus adjustment step size is adjusted according to the error size. When the focusing error exceeds the preset focusing contrast value, the focus adjustment step is randomly increased; when the focusing error is lower than the preset focusing contrast value, the focus adjustment step is randomly decreased.
Citation Information
Patent Citations
Apparatus and Method for Generating 3D Depth Map using Focus Variation
KR1020170102748A
Automatic focusing method and apparatus for lens, and electronic device and computer-readable storage medium
WO2023072030A1