Camera automatic focusing method based on laser radar depth estimation

By sub-region division and depth confidence value calculation of camera image data, combined with the adaptive feedback mechanism dynamically adjusting the focus strategy, the problem of insufficient depth estimation accuracy and focus efficiency in the prior art is solved, and efficient focus in complex scenarios is achieved.

CN120378739AActive Publication Date: 2025-07-25YUNNAN YUNLU ENG INSPECTION CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510854620.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-07-25
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

The existing camera automatic focusing 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 practical applications.

Method used

By sub-region division of the image data acquired by the camera, depth confidence values are calculated and classified and marked, the depth change trend of the occlusion area is detected, different focusing strategy models are selected, and an adaptive feedback mechanism is introduced for dynamic adjustment, so as to improve focus efficiency and accuracy.

Benefits of technology

In complex scenarios, the focus efficiency and accuracy are significantly improved, and the problems of occlusion and high dynamic range areas can be effectively handled, and the imaging quality is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378739A_ABST
    Figure CN120378739A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic camera focusing method based on laser radar depth estimation, relates to the technical field of automatic focusing, is used for improving the problem of low focusing efficiency in a high dynamic range area, and comprises the following steps: scanning a target scene to generate point cloud data and capturing target scene image data; converting the point cloud data into initial depth distribution and correcting the initial depth distribution, performing region division on the corrected depth distribution and acquiring depth features of each sub-region, calculating a depth confidence value and performing classification marking on the sub-regions, and screening the sub-regions according to classification marks to obtain a depth confidence value of each sub-region; the sub-regions are detected, the depth change trend of the sheltered region in each sub-region is analyzed in combination with a screening result, different modes are selected according to the depth change trend to process the sub-regions, a depth change trend data set is generated, and a focusing strategy model is selected according to the depth change trend data set; and a self-adaptive feedback mechanism is introduced to monitor the focusing effect in real time and dynamically adjust the focusing strategy model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of autofocus, and more specifically, to a camera autofocus method based on lidar depth estimation. Background Art

[0002] With the rapid development of lidar and camera technologies, camera autofocus methods based on lidar depth estimation have gradually become a research hotspot in the fields of image processing and robot vision. By obtaining the depth information of the target scene through lidar and combining it with the camera for autofocus, the imaging quality of the target can be significantly improved in complex environments or dynamic scenes, showing important application value. However, existing related technical solutions still have deficiencies in aspects such as depth estimation accuracy, focusing efficiency, and system robustness, which affect their performance in practical applications.

[0003] The above problems indicate that existing camera autofocus methods based on lidar depth estimation still have certain deficiencies in aspects such as depth estimation accuracy, focusing efficiency, and system robustness. Especially in complex scenes, they are easily affected by occlusion, high dynamic range areas, and hardware calibration errors, and it is difficult to meet the requirements of efficient and accurate autofocus in practical applications. 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 autofocus method based on lidar depth estimation. By dividing the image data obtained by the camera into sub-regions and then performing different credibility markings, and detecting the occlusion states of objects in sub-regions with different markings to perform different modes of focusing processing to solve the problems raised in the above background art.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A camera autofocus method based on lidar depth estimation, comprising the following steps,

[0007] Step S1, scanning the target scene to generate point cloud data and capturing the scene image data, converting the point cloud data into an initial depth distribution, extracting image texture features from the scene image data and calculating the depth error, and correcting the initial depth distribution according to the depth error;

[0008] Step S2, dividing the corrected depth distribution into regions and obtaining the depth features of each sub-region, processing the depth features of each region, using a dynamic weight allocation algorithm to calculate the depth confidence value, and classifying and marking the sub-regions;

[0009] Step S3: Filter the sub-regions according to the classification tags, detect each sub-region to obtain the detection results, analyze the depth change trend of the occluded regions in each sub-region in combination with the detection results and the filtering results, and select different modes for processing according to the depth change trend of the occluded regions in each sub-region and generate a depth change trend data set;

[0010] Step S4: Select a focusing strategy model according to the depth change trend data set, 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 composed of a series of three-dimensional coordinate points, which is used to represent the shape and features of the object surface in the target scene; the image data is the depth image of the target scene;

[0012] According to the correction formula, 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 position (x, y), D0(x, y) is the initial correction distribution, and α is the correction coefficient.

[0013] In a preferred embodiment, in step S1, the depth error of the corresponding points is obtained by taking the difference between the depth values of multiple points in the depth image of the target scene and the depth values of the corresponding points in the point cloud data, and 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 generated depth error of 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 the preset area, then 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 pixel points in the sub-region;

[0015] The average depth values of all sub-regions are summarized to form a depth distribution data set and are respectively marked.

[0016] In a preferred embodiment, in step S2, the dynamic weight assignment algorithm obtains the depth confidence Ci of the 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] If the depth confidence value of a sub-region exceeds a preset confidence threshold, the sub-region is marked as a highly credible region; otherwise, the sub-region is marked as a low-credible 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 standard deviation of the gradients of the edge points is calculated as the texture complexity score of the sub-region.

[0019] When calculating the illumination uniformity score of the sub-region, the standard deviation of the brightness of the pixels in the region is calculated. First, the ratio of the standard deviation of the brightness of the sub-region to the difference between the maximum brightness and the minimum brightness of the sub-region is used as the illumination uniformity deviation, and the result of subtracting the illumination uniformity deviation from 1 is used as the illumination uniformity score.

[0020] When calculating the depth distribution smoothness score of the sub-region, the change in the depth value of the sub-region is calculated using a local window. The depth values of the pixel points in the local window are obtained, and the ratio of the average depth value of all the pixel points in the local window to the maximum depth value is calculated as the gradient change amplitude. The result of subtracting the gradient change amplitude of the local window in the sub-region from 1 is used as the depth distribution smoothness score of the sub-region.

[0021] In a preferred embodiment, in step S3, the low-credible regions are screened out, and occlusion detection is performed on each sub-region to identify the occlusion state within the sub-region. The occlusion state within the sub-region includes moving objects and static objects.

[0022] For occlusions caused by moving objects, the system uses a time series analysis method to predict the depth change trend and obtain the depth values of each pixel point within the corresponding sub-region.

[0023] For occlusions caused by static objects, the system estimates the depth values of each pixel point within the corresponding sub-region through a neighborhood depth interpolation method.

[0024] The depth values of each pixel point within the sub-region obtained by the two methods are combined to generate a depth change trend data set.

[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 is selected from the average depth change amplitudes of all sub-regions as the depth change trend threshold.

[0026] If the average depth change amplitude of the sub-region exceeds the depth change trend threshold, it is determined that the depth change trend of the corresponding sub-region is severe; if the average depth change amplitude of the sub-region exceeds the depth change trend threshold, it is determined that the depth change trend of the corresponding sub-region is stable.

[0027] In a preferred embodiment, in step S4, when the depth change trend of the sub-region is stable, a linear focusing strategy model is adopted to achieve fast focusing by gradually adjusting the focal length; when the depth change trend is drastic, the system adopts a non-linear focusing strategy model to ensure the focusing accuracy by segmentally adjusting the focal length.

[0028] In the adaptive feedback mechanism, the actual imaging of the target scene is obtained, the focusing error E is calculated by combining the image data collected by the camera, and the focal length adjustment step is adjusted according to the size of the error.

[0029] When the focusing error exceeds the preset focusing comparison value, the focal length adjustment step is randomly increased; when the focusing error is lower than the preset focusing comparison value, the focal length adjustment step is randomly decreased.

[0030] The technical effects and advantages of a camera automatic focusing method based on lidar depth estimation according to the present invention:

[0031] The present invention generates point cloud data by scanning the target scene and captures the image data of the target scene, converts the point cloud data into an initial depth distribution, extracts the image texture features and calculates the depth error to correct the initial depth distribution. The correction step greatly improves the image depth accuracy. The corrected depth distribution is divided into regions and the depth features of each sub-region are obtained. The depth confidence value is calculated and the sub-regions are classified and marked. The sub-regions are screened according to the classification marks, the sub-regions are detected and the depth change trends of the occluded regions in each sub-region are analyzed in combination with the screening results. Different modes are selected to process the sub-regions according to the depth change trends and a depth change trend data set is generated. A focusing strategy model is selected according to the depth change trend data set, and an adaptive feedback mechanism is introduced to monitor the focusing effect in real time and dynamically adjust the focusing strategy model, improving the focusing efficiency and accuracy in complex scenes. Description of the Drawings

[0032] Figure 1 It is a schematic diagram of a camera automatic focusing method based on lidar depth estimation according to the present invention. Detailed Embodiments

[0033] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0034] The present invention generates point cloud data by scanning a target scene and captures the 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 the depth features of each sub-region, calculates depth confidence values and classifies and labels the sub-regions, filters the sub-regions according to the classification labels, detects the sub-regions and analyzes the depth change trend of the occluded regions in each sub-region in combination with the filtering 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.

[0035] Embodiment, a camera automatic focusing method based on lidar depth estimation, as Figure 1 shown, including the following steps:

[0036] Step S1, scan the target scene to generate point cloud data and capture the scene image data, convert the point cloud data into an initial depth distribution, extract image texture features using the scene image data and calculate depth errors, and correct the initial depth distribution according to the depth errors;

[0037] Step S2, divide the corrected depth distribution into regions and obtain the depth features of each sub-region, process the depth features of each region and then use a dynamic weight allocation algorithm to calculate depth confidence values and classify and label 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 regions in each sub-region in combination with the detection results and the filtering results, and select different modes for processing according to the depth change trend of the occluded regions in each sub-region and generate a depth change trend data set;

[0039] Step S4, select a focusing strategy model according to the depth change trend data set, 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 lidar is used to scan the target scene to generate point cloud data, and a camera is used to capture the image data of the target scene;

[0042] The point cloud data is a set composed of a series of three-dimensional coordinate points, which is used to represent the shape and features of the object surface in the target scene; the 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 noted that the depth value of each point is the numerical value of the z coordinate in the set of three-dimensional coordinate points in the point cloud data. A depth map is a structure that converts the depth value into a depth distribution, and the conversion is achieved by corresponding the depth value of each pixel with the depth of the nearest point in the point cloud data.

[0045] The image data is used to extract texture feature information. In this process, the system maps the point cloud data onto 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] Subsequently, the system extracts the texture feature information in the image, including parameters such as the gradient magnitude and direction. By analyzing the correlation between the texture features and the 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 magnitude of the image at the position (x, y), D0(x, y) is the initial correction distribution, and α is the correction coefficient, which is used to adjust the influence degree of the 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 to obtain 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, take the difference between 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, and take the product of the generated depth error of the target and the preset correction ratio as the correction coefficient and mark it as α.

[0051] It should be noted that the type of high-precision depth sensor is not unique, 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 a preset area, and the depth distribution characteristics of each sub-region are obtained. The average depth value of each sub-region is calculated based on 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 are respectively marked.

[0053] For example: Assume 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 summation of the depth values of all pixel points within the sub-region.

[0054] These average depth values are aggregated to form a depth distribution data set, which provides input for the subsequent dynamic weight assignment algorithm. During this process, the system also records the depth distribution characteristics of each sub-region, such as the standard deviation of depth change and the difference between the maximum and minimum values, in order to further evaluate the depth confidence of the sub-region.

[0055] The system calculates the depth confidence of each sub-region based on the depth distribution data set in combination with the dynamic weight assignment algorithm.

[0056] The dynamic weight assignment algorithm comprehensively considers the texture complexity, illumination uniformity, and smoothness of the depth distribution of the sub-region. Specifically, the depth confidence Ci of the i-th sub-region can be calculated 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.

[0057] Through the above formula, the system can assign a depth confidence value to each sub-region, compare the depth confidence value with a preset confidence threshold to classify different sub-regions. 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 assignment algorithm, the edge detection algorithm is used to extract the edges in each sub-region and calculate the gradient of the image, and the standard deviation of the gradient of the edge points is calculated as the texture complexity score of the sub-region; the larger the standard deviation of the gradient of the edge points within the sub-region, the larger the texture complexity score of the sub-region.

[0059] When calculating the lighting uniformity score of a sub-region, the standard deviation of the brightness of the pixels within the calculation region is calculated. First, the ratio of the standard deviation of the brightness of the sub-region to the difference between the maximum brightness and the minimum brightness of the sub-region is used as the lighting uniformity deviation, and the result of subtracting the lighting uniformity deviation from 1 is used as the lighting uniformity score; the smaller the standard deviation of the brightness of the sub-region, the smaller the lighting uniformity deviation, and the closer the score is to 1.

[0060] When calculating the depth distribution smoothness score of a sub-region, the change in the depth value of the sub-region is calculated using a local window. The depth values of each pixel point in the local window are obtained, and the ratio of the average depth value of all pixel points in the local window to the maximum depth value is used as the gradient change amplitude. The result of subtracting the gradient change amplitude of the local window in the sub-region from 1 is used 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 the high-confidence region is relatively reliable, while the low-confidence region may have occlusion or high dynamic range problems and requires further analysis.

[0062] It should be noted that the weight coefficients of each scoring item in the above method for calculating depth confidence are given by professionals in the field and are changed by setting a change period. For example, if the change period is set to one month, then the weight coefficients of each scoring item are changed 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, according to the classification result, the low-confidence regions are screened out, and occlusion detection is performed on each sub-region to identify the occlusion state within the sub-region. The occlusion state within the sub-region includes moving objects and static objects.

[0064] For the occlusion caused by moving objects, the system uses a time series analysis method to predict the depth change trend.

[0065] Specifically, the system tracks the change in the depth value of the occluded region in consecutive frames of data and fits the depth change curve through a linear regression model. Assuming that the change law of the depth value of the occluded region with time t is z(t) = k × t + b, where k is the slope and b is the intercept, the system solves the optimal values of k and b through the least squares method to predict the depth value at a future moment.

[0066] For occlusion caused by static objects, the system estimates their depth values through the 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 pixel point in the neighborhood, and N is the number of pixel points in the neighborhood.

[0067] According to the above two methods, obtain the depth values of each pixel point in the sub-region at different times and generate a depth change trend data set, providing a basis for the selection of subsequent focusing strategies.

[0068] It should be noted that in the past, cameras did not distinguish the object states in the image data when processing focusing, and used a unified algorithm for focusing, resulting in many cases where the focus point was blurred, the focusing speed was slow, or even the focusing could not be completed.

[0069] In step S4, the system selects different focusing strategy models according to the depth change trend data set, calculates the standard deviation of the data in the depth change trend data set of the sub-region to obtain the average depth change amplitude of the corresponding sub-region, and selects the median as the depth change trend threshold among the average depth change amplitudes of all sub-regions;

[0070] If the average depth change amplitude of the sub-region exceeds the depth change trend threshold, it is judged that the depth change trend of the corresponding sub-region is severe; if the average depth change amplitude of the sub-region exceeds the depth change trend threshold, it is judged that the depth change trend of the corresponding sub-region is 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 of the linear focusing 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-region in the target scene by a preset adjustment ratio;

[0073] When the depth change trend is severe, the system adopts a non-linear focusing strategy model to ensure the focusing accuracy by adjusting the focal length in segments.

[0074] The adjustment formula of the non-linear 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 moment and the next moment respectively, and k is the proportionality coefficient used to control the sensitivity of the focal length adjustment.

[0075] It should be noted that the setting of the proportional coefficient of the non-linear focusing strategy is not unique and can be set according to the actual situation. 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 focusing error E by comparing the difference between the actual imaging of the high-precision sensor and the camera imaging, and adjusts the focal length adjustment step ΔF according to the magnitude of the error. The focusing error E can be calculated by 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 imaging and the camera imaging respectively.

[0078] When the focusing error exceeds the preset focusing comparison value, the system randomly increases ΔF to accelerate the focusing speed to meet the preset focusing speed requirement; when the focusing error is lower than the preset focusing comparison value, the system randomly decreases Δ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: Assume that the target scenario is a car driving on an urban road, and there are 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 the point cloud data into an initial depth distribution, corrects it by combining the image texture feature information, divides the corrected depth distribution into multiple sub-regions, calculates the average depth value and depth confidence of each sub-region, detects the existence of an occlusion region between the pedestrians and vehicles in front, and further analyzes its depth change trend. For the occlusion region of pedestrians, the system uses the time series analysis method to predict the depth change trend; for the occlusion region of vehicles, the system estimates its depth value through the neighborhood depth interpolation method, selects different focusing strategy models after generating the depth change trend data set, and adjusts the focal length in real time through the adaptive feedback mechanism to ensure that the imaging clarity reaches the best state.

[0081] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product.

[0082] Those of ordinary skill in the art will realize that the modules and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application of the technical solution and the invention constraints. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0083] In addition, in each embodiment of this application, the various functional modules can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.

[0084] As described above, this is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

[0085] Finally: The above is only the preferred embodiment of the present invention and is not used to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for automatic focusing of a camera based on lidar 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, dividing the corrected depth distribution into regions and obtaining the depth features of each sub-region, processing the depth features of each region, calculating the depth confidence value using a dynamic weight allocation algorithm, and classifying and marking the sub-regions; Step S3, screening the sub-regions according to the classification marks, detecting each sub-region to obtain the detection results, analyzing the depth change trend of the occluded region in each sub-region in combination with the detection results and the screening results, selecting different modes for processing according to the depth change trend of the occluded region in each sub-region and generating a depth change trend data set; Step S4, selecting a focusing strategy model according to the depth change trend data set, introducing 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, which is used to represent the shape and features of the surface of the 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 subtracted from the depth values of the corresponding points in the point cloud data 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, and 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 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; 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 4, characterized in that: In step S2, the dynamic weight allocation algorithm obtains the depth confidence degree Ci of sub-region i by calculating with 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 the sub-region exceeds the preset confidence threshold, the sub-region is marked as a high-confidence region; Otherwise, the sub-region is marked as a low-confidence region.

6. The method for automatic focusing of a camera based on lidar depth estimation according to claim 5, wherein: 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 standard deviation of the gradients of the edge points is calculated as the texture complexity score of the sub-region; When calculating the illumination uniformity score of the sub-region, the standard deviation of the brightness of the pixels in the region is calculated. First, the ratio of the brightness standard deviation of the sub-region to the difference between the maximum brightness and the minimum brightness of the sub-region is used as the illumination uniformity deviation, and the result of subtracting the illumination uniformity deviation from 1 is used as the illumination uniformity score; When calculating the depth distribution smoothness score of the sub-region, the local window is used to calculate the depth value change of the sub-region, the depth values of each pixel point in the local window are obtained, and the ratio of the average depth value of all pixel points in the local window to the maximum depth value is used as the gradient change amplitude. The result of subtracting the gradient change amplitude of the local window in the sub-region from 1 is used as the depth distribution smoothness score of the sub-region.

7. The method for automatic focusing of a camera based on lidar depth estimation according to claim 5, wherein: In step S3, the low-confidence regions are screened out, and the occluders in each sub-region are detected to identify the occluder states in the sub-region. The occluder states in the sub-region include moving objects and static objects; For the occlusion caused by moving objects, the system uses the time series analysis method to predict the depth change trend and obtain the depth values of each pixel point in the corresponding sub-region; For the occlusion caused by static objects, the system estimates the depth values of each pixel point in the corresponding sub-region by the neighborhood depth interpolation method; The depth values of each pixel point in the sub-region obtained by the two methods are combined to generate a depth change trend data set.

8. The method for automatic focusing of a camera based on lidar depth estimation according to claim 7, wherein: 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 is selected from the average depth change amplitudes of all sub-regions as the depth change trend threshold; If the average depth change amplitude of the sub-region exceeds the depth change trend threshold, it is judged that the depth change trend of the corresponding sub-region is severe; if the average depth change amplitude of the sub-region exceeds the depth change trend threshold, it is judged that the depth change trend of the corresponding sub-region is stable.

9. The method for automatic focusing of a camera based on lidar depth estimation according to claim 8, wherein: In step S4, when the depth change trend of the sub-region is stable, a linear focusing strategy model is adopted to achieve fast focusing by gradually adjusting the focal length; when the depth change trend is drastic, the system adopts a non-linear focusing strategy model to ensure the focusing accuracy by adjusting the focal length in segments; In the adaptive feedback mechanism, the actual imaging of the target scene is obtained, the focusing error E is calculated by combining the image data collected by the camera, and the focal length adjustment step is adjusted according to the size of the error; When the focusing error exceeds the preset focusing comparison value, the focal length adjustment step is randomly increased; when the focusing error is lower than the preset focusing comparison value, the focal length adjustment step is randomly decreased.

Citation Information

Patent Citations

  • Camera automatic focusing method based on depth estimation

    CN118612547A

  • Camera shooting automatic focusing method and system based on machine learning algorithm

    CN119603554A

  • Apparatus and Method for Generating 3D Depth Map using Focus Variation

    KR1020170102748A

  • golf putting and swing training apparatus with combination type

    KR1020230058832A

  • Device for generating a depth map

    TW201412094A