A binocular vision ranging method and system for realizing occlusion completion
Through the occlusion completion model and edge feature point detection technology, the problem of image quality degradation caused by occlusion in binocular visual ranging is solved, the accuracy and efficiency of ranging are improved, and it is suitable for high-precision measurement of dangerous target distances.
Patent Information
- Application Number
- CN202410249002.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-05
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-03-05
AI Technical Summary
In the process of binocular visual ranging, the degradation of image quality caused by obstructions affects the accuracy of ranging. Especially when the target to be measured is close to the dangerous target, the accuracy of the distance is required. It is difficult for the existing technology to effectively solve the problem of obstructed images. Blurred edges problem.
The occlusion completion model is used to perform occlusion completion on the original image of the target to be ranged, and by detecting typical feature points on the edge of the completed image, the depth information of the binocular camera and the neural network model are used for ranging to improve the accuracy of ranging. Spend.
Through occlusion completion and edge feature point detection, the accuracy and efficiency of binocular camera ranging are significantly improved, ensuring the quality of ranging in occlusion situations.
Smart Images

Figure CN118111382B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual ranging, and in particular to a binocular visual ranging method and system for realizing occlusion completion. Background Art
[0002] Visual ranging is a basic technology in the field of machine vision and is widely used in machine vision positioning, target tracking, visual obstacle avoidance, etc. Visual ranging is mainly divided into monocular ranging, binocular ranging, structured light ranging, etc. In the binocular ranging process, if there is an obstacle between the distance from the object to be measured to the camera, the binocular camera will be blocked, affecting the image quality of the binocular camera, thereby affecting the accuracy of ranging;
[0003] Due to different purposes of analyzing the measured distance, the required accuracy of the distance will be different for different distances, especially when it comes to the distance between the target to be measured and the dangerous target. The closer the target to be measured is to the dangerous target, the higher the accuracy requirement for the distance is, so as to issue early warning prompts in time to ensure safety needs;
[0004] At present, the occluded image part is generally completed to meet the needs. However, in general occluded images, the moving target to be measured will have a certain edge blur problem, which makes it impossible to restore the image quality of the edge area with high quality, affecting the accuracy of the completed image and further affecting the accuracy of the distance measurement.
[0005] Therefore, it is necessary to provide a binocular vision ranging method and system for achieving occlusion completion. Summary of the invention
[0006] The present invention provides a binocular vision ranging method and system for realizing occlusion completion. By utilizing an occlusion completion model, occlusion completion is performed on an original image of a target to be measured, and typical feature points on the edge of the completed image are detected for ranging, thereby ensuring the accuracy of ranging and being beneficial to improving the ranging efficiency and quality of a binocular camera.
[0007] The present invention provides a binocular vision ranging method for realizing occlusion completion, comprising:
[0008] S1: Obtain the original image of the target to be measured captured by the binocular camera, and extract the original image to be completed;
[0009] S2: Use the occlusion completion model to complete the original image to be completed and generate a completed image;
[0010] S3: Perform edge target detection on the completed image to obtain typical edge feature points of the completed image;
[0011] S4: Measure the distance of the target to be measured based on the original image and the typical edge feature points to obtain the distance measurement result.
[0012] Further, S101: using a binocular camera to collect images of the scene where the target to be measured is located to obtain an original image;
[0013] S102: performing region segmentation on the original image using a software program to obtain an occluded region image corresponding to the occluded region;
[0014] S103: Analyze and determine the occluded area image to obtain the position area where the occluded area image is located, and obtain several different types of original images to be completed according to the position area; the position area is: completely in the left camera image, completely in the right camera image, partly in the left camera image and partly in the right camera image.
[0015] Furthermore, S2 includes:
[0016] S201: Build and train an occlusion completion model;
[0017] S202: Perform occlusion completion on the original image to be completed using the occlusion completion model to generate a completed image.
[0018] Further, S202 includes:
[0019] S2021: using the generator in the occlusion completion model, receiving the original image to be completed and the preset completion target image, and after extracting features of the original image to be completed and the completion target image, generating a completion image to be confirmed;
[0020] S2022: respectively obtain the spatial features of the to-be-confirmed completed image, the completed target image and the to-be-confirmed original image, and use the discriminator in the occlusion completion model to perform similarity judgment on the to-be-confirmed completed image according to the spatial features to obtain the similarity between the to-be-confirmed completed image and the to-be-confirmed original image, and optimize the to-be-confirmed completed image based on the similarity to obtain a completed image that meets the preset similarity conditions.
[0021] Furthermore, S3 includes:
[0022] S301: selecting the edge region of the complement image according to a preset selection strategy to obtain a region image; and performing blur processing on the region image to obtain an edge region image;
[0023] S302: Based on the Canny edge detection algorithm, according to a preset edge threshold and the number of edge pixels, edge extraction is performed on the edge region image to obtain a first edge region image;
[0024] S303: performing clarity evaluation on the first edge region image based on a preset clarity evaluation model to obtain a second edge region image with an optimal clarity evaluation result;
[0025] S304: Performing target detection on the second edge region image based on the YOLOv5 model to identify and obtain typical feature points in the second edge region image.
[0026] Furthermore, S4 includes:
[0027] S401: Based on the original image, a left image and a right image are obtained; the left image is an image taken by a left camera of the binocular camera, and the right image is an image taken by a right camera of the binocular camera;
[0028] S402: Obtaining first depth information and second depth information based on the left image and the right image, and typical feature points;
[0029] S403: Calculate first coordinate information and second coordinate information in a camera coordinate system of a binocular camera according to the first depth information and the second depth information, and calculate a distance of the target to be measured according to the first coordinate information and the second coordinate information.
[0030] Further, S402 includes:
[0031] Through the binocular disparity calculation algorithm, the positions and feature values of the left image and the right image are matched according to a preset matching algorithm to obtain disparity information, and the first depth information and the second depth information are calculated according to the disparity information; the preset matching algorithm is: a matching algorithm based on optical flow; the first depth information is: the distance from the center point of the original image to the center point of the left camera and the right camera of the binocular camera; the second depth information is: the distance from the typical feature point to the center point of the left camera and the right camera of the binocular camera.
[0032] Furthermore, S403 also includes:
[0033] Obtain historical data; historical data includes historical original images, historical edge typical feature point data, historical occlusion area location data, historical occlusion area area data and historical ranging accuracy data;
[0034] According to historical data, based on the neural network model, train and generate a neural network prediction model for ranging accuracy;
[0035] Obtaining data to be analyzed; the data to be analyzed includes the original image, typical edge feature points, location data of the occluded area, and area data of the occluded area;
[0036] Based on the data to be analyzed, the ranging accuracy is predicted by using the ranging accuracy neural network prediction model; if the ranging accuracy is less than a preset ranging accuracy threshold, a matching weight value array is obtained based on a preset matching correspondence library between the ranging accuracy and the weight value array; according to the weight value array, the first coordinate information and the second coordinate information are weighted by the weight value respectively to obtain the weighted first coordinate information and the second coordinate information;
[0037] The weighted first coordinate information and the second coordinate information are used to calculate the distance to the target to be measured.
[0038] Further, S403 also includes: obtaining different distance values according to different distance analysis purposes, the specific steps are: obtaining a first distance corresponding to the first coordinate information and obtaining a second distance corresponding to the second coordinate information according to the first coordinate information and the second coordinate information;
[0039] After summing the first distance and the second distance, the average value is calculated to obtain the third distance;
[0040] Set the distance interval and obtain the distance accuracy requirement; the distance accuracy requirement is: set the corresponding accuracy according to different distance analysis purposes;
[0041] Construct a knowledge graph structure with distance values, distance intervals, and distance accuracy requirements as entities;
[0042] Based on the knowledge graph structure and according to the distance accuracy requirements, it is recommended to obtain different distance values; the distance values include a first value, a second value, a third value and a fourth value; the first value is: the minimum value among the first distance, the second distance and the third distance; the second value is: the maximum value among the first distance, the second distance and the third distance; the third value is: the third distance; the fourth value is: the distance value obtained by performing polynomial regression calculation based on the first distance, the second distance and the third distance.
[0043] A binocular vision ranging system for realizing occlusion completion, comprising:
[0044] The module for acquiring the original image to be completed is used to acquire the original image of the target to be measured collected by the binocular camera, and extract the original image to be completed;
[0045] A completion image acquisition module, used to perform occlusion completion on the original image to be completed using the occlusion completion model to generate a completion image;
[0046] The edge typical feature point acquisition module is used to perform edge target detection on the completed image and obtain the edge typical feature points of the completed image;
[0047] The distance measurement result acquisition module is used to measure the distance of the target to be measured based on the original image and the typical edge feature points to obtain the distance measurement result.
[0048] Compared with the prior art, the present invention has the following advantages and beneficial effects: by utilizing the occlusion completion model, the occlusion completion is performed on the original image of the target to be measured, and by detecting the edge typical feature points of the completed image for ranging, the accuracy of ranging can be guaranteed, which is beneficial to improving the ranging efficiency and quality of the binocular camera.
[0049] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0050] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0052] Figure 1 A schematic diagram of the steps of a binocular vision ranging method for achieving occlusion completion;
[0053] Figure 2 A schematic diagram of the steps of the method for generating a completed image;
[0054] Figure 3 The figure is a schematic diagram of the structure of a binocular vision ranging system for achieving occlusion completion. DETAILED DESCRIPTION
[0055] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0056] The present invention provides a binocular vision ranging method for realizing occlusion completion, such as Figure 1 As shown, including:
[0057] S1: Obtain the original image of the target to be measured captured by the binocular camera, and extract the original image to be completed;
[0058] S2: Use the occlusion completion model to complete the original image to be completed and generate a completed image;
[0059] S3: Perform edge target detection on the completed image to obtain typical edge feature points of the completed image;
[0060] S4: Measure the distance of the target to be measured based on the original image and the typical edge feature points to obtain the distance measurement result.
[0061] The working principle of the above technical solution is as follows: in order to realize binocular visual ranging with occlusion completion, first obtain the original image of the target to be measured captured by the binocular camera, and extract the original image to be completed; then use the occlusion completion model to complete the occlusion of the original image to be completed to generate a completed image; then perform edge target detection on the completed image to obtain the edge typical feature points of the completed image, and further perform feature extraction on the edge area of the completed image; based on the original image and the edge typical feature points, measure the distance to the target to be measured to obtain the ranging result.
[0062] The beneficial effect of the above technical solution is: by adopting the solution provided by this embodiment, the occlusion completion model is used to complete the occlusion of the original image of the target to be measured, and the typical edge feature points of the completed image are detected for ranging, which can ensure the accuracy of ranging and is conducive to improving the ranging efficiency and quality of the binocular camera.
[0063] In one embodiment, S101: using a binocular camera to collect images of a scene where a target to be measured is located to obtain an original image;
[0064] S102: performing region segmentation on the original image using a software program to obtain an occluded region image corresponding to the occluded region;
[0065] S103: Analyze and determine the occluded area image to obtain the position area where the occluded area image is located, and obtain several different types of original images to be completed according to the position area; the position area is: completely in the left camera image, completely in the right camera image, partly in the left camera image and partly in the right camera image.
[0066] The working principle of the above technical solution is: using a binocular camera to collect images of the scene where the target to be measured is located, so as to ensure that the original image is obtained; using a software program to segment the original image into regions, and obtaining the occluded area image corresponding to the occluded area, so as to ensure the acquisition quality of the occluded area image; analyzing and determining the occluded area image, and obtaining the position area where the occluded area image is located, and according to the position area, obtaining several different types of original images to be completed; the position area is: completely in the left camera image, completely in the right camera image, partly in the left camera image and partly in the right camera image; by distinguishing the position area where the occluded area image is located, the specific features of the occluded image can be obtained in a targeted manner, and the occlusion completion model can be used to effectively complete the specific features, which is conducive to improving the targetedness and effect of occlusion completion.
[0067] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, by using a software program to segment the original image into regions and analyzing and judging the occluded area image, several different types of original images to be completed can be obtained, which is convenient for targeted completion using the occlusion completion model.
[0068] In one embodiment, Figure 2 As shown, S2 includes:
[0069] S201: Build and train an occlusion completion model;
[0070] S202: Perform occlusion completion on the original image to be completed using the occlusion completion model to generate a completed image.
[0071] The working principle of the above technical solution is: S2 includes:
[0072] Build and train an occlusion completion model, and perform occlusion completion on the original image to be completed to generate a completed image.
[0073] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, by constructing and training an occlusion completion model, it is convenient to generate a completed image with high quality.
[0074] In one embodiment, S202 includes:
[0075] S2021: using the generator in the occlusion completion model, receiving the original image to be completed and the preset completion target image, and after extracting features of the original image to be completed and the completion target image, generating a completion image to be confirmed;
[0076] S2022: respectively obtain the spatial features of the to-be-confirmed completed image, the completed target image and the to-be-confirmed original image, and use the discriminator in the occlusion completion model to perform similarity judgment on the to-be-confirmed completed image according to the spatial features to obtain the similarity between the to-be-confirmed completed image and the to-be-confirmed original image, and optimize the to-be-confirmed completed image based on the similarity to obtain a completed image that meets the preset similarity conditions.
[0077] The working principle of the above technical solution is: using the generator in the occlusion completion model, receiving the original image to be completed and the preset completion target image, and after extracting the features of the original image to be completed and the completion target image, it is guaranteed that the completion image to be confirmed will be generated; respectively obtaining the spatial features of the completion image to be confirmed, the completion target image and the original image to be completed, using the discriminator in the occlusion completion model, according to the spatial features, performing similarity judgment on the completion image to be confirmed, and obtaining the similarity between the completion image to be confirmed and the original image to be completed, and based on the size of the similarity, optimizing the completion image to be confirmed, so as to obtain a completion image that meets the preset similarity conditions.
[0078] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, the functions of the generator and the discriminator in the occlusion completion model can be utilized to ensure that a completed image that meets the preset similarity conditions is obtained.
[0079] In one embodiment, S3 includes:
[0080] S301: selecting the edge region of the complement image according to a preset selection strategy to obtain a region image; and performing blur processing on the region image to obtain an edge region image;
[0081] S302: Based on the Canny edge detection algorithm, according to a preset edge threshold and the number of edge pixels, edge extraction is performed on the edge region image to obtain a first edge region image;
[0082] S303: performing clarity evaluation on the first edge region image based on a preset clarity evaluation model to obtain a second edge region image with an optimal clarity evaluation result;
[0083] S304: Performing target detection on the second edge region image based on the YOLOv5 model to identify and obtain typical feature points in the second edge region image.
[0084] The working principle of the above technical solution is: S3 includes: selecting the edge area of the complement image according to a preset selection strategy to obtain a regional image; blurring the regional image to obtain an edge area image; based on the Canny edge detection algorithm, according to the preset edge threshold and the number of edge pixels, performing edge extraction on the edge area image to obtain a first edge area image; based on a preset clarity evaluation model, performing clarity evaluation on the first edge area image to obtain a second edge area image with the best clarity evaluation result; performing target detection on the second edge area image based on the YOLOv5 model to identify and obtain typical feature points in the second edge area image.
[0085] The beneficial effect of the above technical solution is: by adopting the solution provided by this embodiment, by performing target detection on the edge area of the complement image, typical feature points can be obtained so as to be used as reference distance in distance calculation.
[0086] In one embodiment, S4 includes:
[0087] S401: Based on the original image, a left image and a right image are obtained; the left image is an image taken by a left camera of the binocular camera, and the right image is an image taken by a right camera of the binocular camera;
[0088] S402: Obtaining first depth information and second depth information based on the left image and the right image, and typical feature points;
[0089] S403: Calculate first coordinate information and second coordinate information in a camera coordinate system of a binocular camera according to the first depth information and the second depth information, and calculate a distance of the target to be measured according to the first coordinate information and the second coordinate information.
[0090] The working principle of the above technical solution is: based on the original image, a left image and a right image are obtained; the left image is an image taken by a left camera of the binocular camera, and the right image is an image taken by a right camera of the binocular camera; based on the left image and the right image, and typical feature points, first depth information and second depth information are obtained; according to the first depth information and the second depth information, first coordinate information and second coordinate information in the camera coordinate system of the binocular camera are calculated, and according to the first coordinate information and the second coordinate information, the distance of the target to be measured is calculated.
[0091] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, the first coordinate information and the second coordinate information are obtained according to the original image to be completed and the typical feature points, and the distance of the target to be measured is calculated, so that the accuracy of the distance calculation can be guaranteed.
[0092] In one embodiment, S402 includes:
[0093] Through the binocular disparity calculation algorithm, the positions and feature values of the left image and the right image are matched according to a preset matching algorithm to obtain disparity information, and the first depth information and the second depth information are calculated according to the disparity information; the preset matching algorithm is: a matching algorithm based on optical flow; the first depth information is: the distance from the center point of the original image to the center point of the left camera and the right camera of the binocular camera; the second depth information is: the distance from the typical feature point to the center point of the left camera and the right camera of the binocular camera.
[0094] The working principle of the above technical solution is: in order to obtain the first depth information and the second depth information, the left image and the right image are matched in position and feature value according to a preset matching algorithm through a binocular disparity calculation algorithm to obtain disparity information, and the first depth information and the second depth information are calculated according to the disparity information; the preset matching algorithm is: a matching algorithm based on optical flow; the first depth information is: the distance from the center point of the original image to the center point of the left camera and the right camera of the binocular camera; the second depth information is: the distance from the typical feature point to the center point of the left camera and the right camera of the binocular camera.
[0095] The beneficial effect of the above technical solution is: by adopting the solution provided in this embodiment, the disparity information is obtained through the binocular disparity calculation algorithm, and the first depth information and the second depth information are calculated according to the disparity information, thereby providing data conditions for distance measurement.
[0096] In one embodiment, S403 further includes:
[0097] Obtain historical data; historical data includes historical original images, historical edge typical feature point data, historical occlusion area location data, historical occlusion area area data and historical ranging accuracy data;
[0098] According to historical data, based on the neural network model, train and generate a neural network prediction model for ranging accuracy;
[0099] Obtaining data to be analyzed; the data to be analyzed includes the original image, typical edge feature points, location data of the occluded area, and area data of the occluded area;
[0100] Based on the data to be analyzed, the ranging accuracy is predicted by using the ranging accuracy neural network prediction model; if the ranging accuracy is less than a preset ranging accuracy threshold, a matching weight value array is obtained based on a preset matching correspondence library between the ranging accuracy and the weight value array; according to the weight value array, the first coordinate information and the second coordinate information are weighted by the weight value respectively to obtain the weighted first coordinate information and the second coordinate information;
[0101] The weighted first coordinate information and the second coordinate information are used to calculate the distance to the target to be measured.
[0102] The working principle of the above technical solution is as follows: first, historical data is obtained; the historical data includes historical original images, historical edge typical feature point data, historical occlusion area location data, historical occlusion area area data and historical ranging accuracy data; secondly, based on the historical data, a ranging accuracy neural network prediction model is trained and generated based on a neural network model; data to be analyzed is obtained; the data to be analyzed includes original images, edge typical feature points, occlusion area location data, and occlusion area data; finally, based on the data to be analyzed, the ranging accuracy is predicted using the ranging accuracy neural network prediction model; if the ranging accuracy is less than a preset ranging accuracy threshold, a matching weight value array is obtained based on a preset matching correspondence library between ranging accuracy and weight value array; according to the weight value array, the first coordinate information and the second coordinate information are weighted by weight value respectively to obtain weighted first coordinate information and second coordinate information; the weighted first coordinate information and second coordinate information are used to calculate the distance of the target to be measured.
[0103] The beneficial effect of the above technical solution is: by adopting the solution provided by this embodiment, the ranging accuracy is predicted by using the ranging accuracy neural network prediction model, and the first coordinate information and the second coordinate information are weighted according to the ranging accuracy, so as to ensure the accuracy of the first coordinate information and the second coordinate information, thereby facilitating the calculation accuracy of the distance of the target to be measured.
[0104] In one embodiment, S403 further includes: obtaining different distance values according to different distance analysis purposes, specifically the steps of: obtaining a first distance corresponding to the first coordinate information and obtaining a second distance corresponding to the second coordinate information according to the first coordinate information and the second coordinate information;
[0105] After summing the first distance and the second distance, the average value is calculated to obtain the third distance;
[0106] Set the distance interval and obtain the distance accuracy requirement; the distance accuracy requirement is: set the corresponding accuracy according to different distance analysis purposes;
[0107] Construct a knowledge graph structure with distance values, distance intervals, and distance accuracy requirements as entities;
[0108] Based on the knowledge graph structure and according to the distance accuracy requirements, it is recommended to obtain different distance values; the distance values include a first value, a second value, a third value and a fourth value; the first value is: the minimum value among the first distance, the second distance and the third distance; the second value is: the maximum value among the first distance, the second distance and the third distance; the third value is: the third distance; the fourth value is: the distance value obtained by performing polynomial regression calculation based on the first distance, the second distance and the third distance.
[0109] The working principle of the above technical solution is: according to different distance analysis purposes, different distance values are obtained, and the specific steps are: according to the first coordinate information and the second coordinate information, a first distance corresponding to the first coordinate information is obtained, and a second distance corresponding to the second coordinate information is obtained; after summing the first distance and the second distance, an average value is calculated to obtain a third distance;
[0110] Set the distance interval and obtain the distance accuracy requirement; the distance accuracy requirement is: according to different distance analysis purposes, set the corresponding accuracy; construct a knowledge graph structure with distance value, distance interval and distance accuracy requirement as entities; based on the knowledge graph structure, it is recommended to obtain different distance values according to the distance accuracy requirement; the distance values include a first value, a second value, a third value and a fourth value; the first value is: the minimum value among the first distance, the second distance and the third distance; the second value is: the maximum value among the first distance, the second distance and the third distance; the third value is: the third distance; the fourth value is: the distance value obtained by performing polynomial regression calculation based on the first distance, the second distance and the third distance.
[0111] The beneficial effect of the above technical solution is: by adopting the solution provided by this embodiment, different distance values are obtained according to different distance analysis purposes, so that the distance values can be used for different distance analyses, thereby improving the applicability of the distance values.
[0112] A binocular vision ranging system for achieving occlusion completion, such as Figure 3 As shown, including:
[0113] The module for acquiring the original image to be completed is used to acquire the original image of the target to be measured collected by the binocular camera, and extract the original image to be completed;
[0114] A completion image acquisition module, used to perform occlusion completion on the original image to be completed using the occlusion completion model to generate a completion image;
[0115] The edge typical feature point acquisition module is used to perform edge target detection on the completed image and obtain the edge typical feature points of the completed image;
[0116] The distance measurement result acquisition module is used to measure the distance of the target to be measured based on the original image and the typical edge feature points to obtain the distance measurement result.
[0117] The working principle of the above technical solution is: the original image acquisition module to be completed is used to obtain the original image of the target to be measured collected by the binocular camera, and extract the original image to be completed; the completed image acquisition module is used to use the occlusion completion model to perform occlusion completion on the original image to be completed and generate a completed image; the edge typical feature point acquisition module is used to perform edge target detection on the completed image and obtain the edge typical feature points of the completed image; the ranging result acquisition module is used to measure the distance of the target to be measured based on the original image and the edge typical feature points to obtain the ranging result.
[0118] The beneficial effect of the above technical solution is: by adopting the solution provided by this embodiment, the occlusion completion model is used to complete the occlusion of the original image of the target to be measured, and the typical edge feature points of the completed image are detected for ranging, which can ensure the accuracy of ranging and is conducive to improving the ranging efficiency and quality of the binocular camera.
[0119] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A binocular vision ranging method for achieving occlusion completion, characterized in that: include: S1: Obtain the original image of the target to be measured captured by the binocular camera, and extract the original image to be completed; S2: Use the occlusion completion model to complete the original image to be completed and generate a completed image; S3: Perform edge target detection on the completed image to obtain typical edge feature points of the completed image; S4: Measure the distance of the target to be measured based on the original image and the typical edge feature points to obtain the distance measurement result; S3 includes: S301: selecting the edge area of the complement image according to a preset selection strategy to obtain a regional image; Performing fuzzy processing on the regional image to obtain an edge regional image; S302: Based on the Canny edge detection algorithm, according to a preset edge threshold and the number of edge pixels, edge extraction is performed on the edge region image to obtain a first edge region image; S303: performing clarity evaluation on the first edge region image based on a preset clarity evaluation model to obtain a second edge region image with an optimal clarity evaluation result; S304: Performing target detection on the second edge region image based on the YOLOv5 model to identify and obtain typical feature points in the second edge region image.
2. The binocular vision ranging method for achieving occlusion completion according to claim 1, characterized in that: S1 includes: S101: using a binocular camera to collect images of the scene where the target to be measured is located to obtain an original image; S102: using a software program to perform region segmentation on the original image to obtain an occluded region image corresponding to the occluded region; S103: Analyze and determine the occluded area image to obtain the position area where the occluded area image is located, and obtain several different types of original images to be completed according to the position area; the position area is: completely in the left camera image, completely in the right camera image, partly in the left camera image and partly in the right camera image.
3. The binocular vision ranging method for achieving occlusion completion according to claim 1, characterized in that S2 include: S201: Build and train an occlusion completion model; S202: Perform occlusion completion on the original image to be completed using the occlusion completion model to generate a completed image.
4. The binocular vision ranging method for achieving occlusion completion according to claim 3, characterized in that: S202 includes: S2021: using the generator in the occlusion completion model, receiving the original image to be completed and the preset completion target image, and after extracting features of the original image to be completed and the completion target image, generating a completion image to be confirmed; S2022: respectively obtain the spatial features of the to-be-confirmed completed image, the completed target image and the to-be-confirmed original image, and use the discriminator in the occlusion completion model to perform similarity judgment on the to-be-confirmed completed image according to the spatial features to obtain the similarity between the to-be-confirmed completed image and the to-be-confirmed original image, and optimize the to-be-confirmed completed image based on the similarity to obtain a completed image that meets the preset similarity conditions.
5. The binocular vision ranging method for achieving occlusion completion according to claim 1, characterized in that: S4 includes: S401: Based on the original image, a left image and a right image are obtained; the left image is an image taken by a left camera of the binocular camera, and the right image is an image taken by a right camera of the binocular camera; S402: Obtaining first depth information and second depth information based on the left image and the right image, and typical feature points; S403: Calculate first coordinate information and second coordinate information in a camera coordinate system of a binocular camera according to the first depth information and the second depth information, and calculate a distance of the target to be measured according to the first coordinate information and the second coordinate information.
6. The binocular vision ranging method for achieving occlusion completion according to claim 5, characterized in that: S402 includes: Through the binocular disparity calculation algorithm, the positions and feature values of the left image and the right image are matched according to a preset matching algorithm to obtain disparity information, and the first depth information and the second depth information are calculated according to the disparity information; the preset matching algorithm is: a matching algorithm based on optical flow; the first depth information is: the distance from the center point of the original image to the center point of the left camera and the right camera of the binocular camera; the second depth information is: the distance from the typical feature point to the center point of the left camera and the right camera of the binocular camera.
7. The binocular vision ranging method for achieving occlusion completion according to claim 5, characterized in that: S403 also includes: Obtain historical data; historical data includes historical original images, historical edge typical feature point data, historical occlusion area location data, historical occlusion area area data and historical ranging accuracy data; According to historical data, based on the neural network model, train and generate a neural network prediction model for ranging accuracy; Obtaining data to be analyzed; the data to be analyzed includes the original image, typical edge feature points, location data of the occluded area, and area data of the occluded area; Based on the data to be analyzed, the ranging accuracy is predicted by using the ranging accuracy neural network prediction model; if the ranging accuracy is less than a preset ranging accuracy threshold, a matching weight value array is obtained based on a preset matching correspondence library between the ranging accuracy and the weight value array; according to the weight value array, the first coordinate information and the second coordinate information are weighted by the weight value respectively to obtain the weighted first coordinate information and the second coordinate information; The weighted first coordinate information and the second coordinate information are used to calculate the distance to the target to be measured.
8. The binocular vision ranging method for achieving occlusion completion according to claim 5, characterized in that: S403 also includes: obtaining different distance values according to different distance analysis purposes, and the specific steps are: According to the first coordinate information and the second coordinate information, obtaining a first distance corresponding to the first coordinate information, and obtaining a second distance corresponding to the second coordinate information; After summing the first distance and the second distance, the average value is calculated to obtain the third distance; Set the distance interval and obtain the distance accuracy requirement; the distance accuracy requirement is: set the corresponding accuracy according to different distance analysis purposes; Construct a knowledge graph structure with distance values, distance intervals, and distance accuracy requirements as entities; Based on the knowledge graph structure and according to the distance accuracy requirements, it is recommended to obtain different distance values; the distance values include a first value, a second value, a third value and a fourth value; the first value is: the minimum value among the first distance, the second distance and the third distance; the second value is: the maximum value among the first distance, the second distance and the third distance; the third value is: the third distance; the fourth value is: the distance value obtained by performing polynomial regression calculation based on the first distance, the second distance and the third distance.
9. A binocular vision ranging system for achieving occlusion completion, characterized in that: include: The module for acquiring the original image to be completed is used to acquire the original image of the target to be measured collected by the binocular camera, and extract the original image to be completed; A completion image acquisition module, used to perform occlusion completion on the original image to be completed using the occlusion completion model to generate a completion image; The edge typical feature point acquisition module is used to perform edge target detection on the completed image and obtain the edge typical feature points of the completed image; According to a preset selection strategy, the edge area of the complement image is selected to obtain a regional image; Performing fuzzy processing on the regional image to obtain an edge regional image; Based on the Canny edge detection algorithm, according to a preset edge threshold and the number of edge pixels, edge extraction is performed on the edge area image to obtain a first edge area image; Based on a preset clarity evaluation model, a clarity evaluation is performed on the first edge region image to obtain a second edge region image with an optimal clarity evaluation result; Performing target detection on the second edge region image based on the YOLOv5 model, identifying and acquiring typical feature points in the second edge region image; The distance measurement result acquisition module is used to measure the distance of the target to be measured based on the original image and the typical edge feature points to obtain the distance measurement result.
