Distance detection method, device and vehicle

By collecting and processing color images in the vehicle, combined with the reliability calculation model, the problem of edge detection of target objects under the influence of lighting and environmental factors is solved, and the accuracy of distance detection between the target object and the vehicle in the vehicle is improved.

CN114973190BActive Publication Date: 2024-10-15HAOMO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210492990.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2024-10-15
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

Target object detection and distance detection technologies in existing vehicles are easily affected by lighting and environmental factors, resulting in unclear detection of the edge of the target object, which in turn leads to inaccurate distance detection.

Method used

It collects multiple consecutive color images within a preset time period, selects a single-channel color image through preset color channel instructions, and performs image processing to obtain the outline image and position of the target object, combined with the pre-trained object reliability calculation model. , determine the reliability value of the target object, thereby determining the actual distance between the target object and the vehicle.

Benefits of technology

Through mutual compensation of images with different color channels, the impact of lighting, environment and other factors on target object contour detection is reduced, and the accuracy of distance detection between target objects and vehicles is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114973190B_ABST
    Figure CN114973190B_ABST
Patent Text Reader

Abstract

The present invention provides a distance detection method, device and vehicle, including: obtaining a plurality of continuous color images collected by a shooting device, selecting at least one single-channel color image from the plurality of continuous color images for image processing by following the color channel instruction in a preset mode, obtaining the target object contour image of each single-channel color image, and then performing distance estimation processing on the target object to obtain the position of the target object in the single-channel color image; inputting a pre-trained object reliability calculation model according to each target object contour image and the position between each target object vehicle and the target object, and outputting the reliability value of the target object in each single-channel color image; determining the final distance between the target object and the vehicle according to the distance between each target object vehicle and the target object and the reliability value. The present application improves the accuracy of object contour detection and thus improves the accuracy of distance detection by processing single-color images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle technology, and in particular to a distance detection method, device and vehicle. Background Art

[0002] With the continuous development of the field of vehicle technology, in order to improve the safety factor during vehicle driving, more and more vehicles have the function of automatically detecting target objects and the distance between the target objects and the vehicle.

[0003] The current target object detection and distance detection technology is usually based on the acquisition of color images by the camera system, which is processed into grayscale images, and then the edge detection of the target object in the grayscale image is performed to detect the target object and the distance. However, since color images are easily affected by lighting and road environment when taking pictures, the color, shape, and size parameters of the target object will be lost when the color image is converted into a grayscale image, making the edge detection of the target object unclear, and further resulting in inaccurate detection of the distance between the target object and the vehicle. Summary of the invention

[0004] In view of this, the present invention aims to provide a distance detection method, device and vehicle to reduce the problem of inaccurate distance detection between the target object and the vehicle caused by poor edge detection of the target object due to factors such as environment and light.

[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0006] An embodiment of the present invention provides a distance detection method, which is applied to a vehicle including a camera, and is characterized in that the method includes:

[0007] Acquire a plurality of continuous color images of the target object captured by the photographing device within a preset time period;

[0008] Selecting at least one single-channel color image from the plurality of continuous color images by using a preset color channel instruction;

[0009] Performing image processing on each of the single-channel color images to obtain a contour image of the target object in each of the single-channel color images;

[0010] By performing distance estimation processing on the target object in each of the single-channel color images, the position of the target object in each of the single-channel color images is obtained; the position includes the longitudinal distance and the lateral distance between the vehicle and the target object;

[0011] The contour image of the target object in each single-channel color image and the position of the target object in each single-channel color image are input into a pre-trained object reliability calculation model to obtain the reliability value of the target object in each single-channel color image; the target object in the single-channel color image corresponding to the maximum reliability value is selected as the reliable target object, and the actual longitudinal distance and the actual lateral distance between the reliable target object and the vehicle are determined.

[0012] According to a second aspect of the present invention, there is provided a distance detection device, which is applied to a monocular camera in a vehicle, and the device comprises:

[0013] An image capturing module, used to obtain a plurality of continuous color images of the target object captured by the capturing device within a preset time period;

[0014] A single-channel color image selection module, used to select at least one single-channel color image from the plurality of continuous color images according to a preset color channel instruction;

[0015] A target object contour image acquisition module, used for performing image processing on each of the single-channel color images to obtain a contour image of the target object in each of the single-channel color images;

[0016] A position acquisition module, configured to obtain the position of the target object in each single-channel color image by performing distance estimation processing on the target object in each single-channel color image; the position includes the longitudinal distance and the lateral distance between the vehicle and the target object;

[0017] The reliability acquisition module is used to input the contour image of the target object in each single-channel color image and the position of the target object in each single-channel color image into a pre-trained object reliability calculation model to obtain the reliability value of the target object in each single-channel color image; the final distance acquisition module is used to select the target object in the single-channel color image corresponding to the maximum reliability value as a reliable target object, and determine the actual longitudinal distance and actual lateral distance between the reliable target object and the vehicle.

[0018] A vehicle comprises a vehicle-mounted terminal and the distance detection device.

[0019] Compared with the prior art, the embodiments of the present invention have the following advantages:

[0020] In the distance detection method provided by the embodiment of the present invention, the clarity of the contour of the target object in the single-channel color image is affected by factors such as illumination, road surface environment, inherent color of the target object, and background color. Since the color channel is selected in a preset mode when acquiring the single-channel color image, the single-channel color images of different color channels present different clarity of the contour of the target object, such as, in some scenes, the contour of the target object in the red channel image is clearer, and in some scenes, the contour of the same target object in the green channel image is clearer. Through this difference, in a preset time period, for all single-channel color images, the target object with the clearest contour can be obtained from the single-channel color image according to the calculated reliability of the same target object, that is, for the same target object, the clearer the contour of the target object in the single-channel color image, the greater the reliability value of the single-channel color image where the target object is located, and thus the position of the target object determined based on the contour of the target object in this single-channel image is more accurate. Therefore, by acquiring a single-channel color image in a color image, mutual compensation between factors such as lighting, road surface environment, inherent color of the target object and background color in different single-channel color images can be achieved, thereby reducing the influence of the above environmental factors on the accuracy of target object contour detection, thereby improving the detection accuracy of the distance between the target object and the vehicle. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0022] Figure 1 A flow chart showing the steps of a distance detection method provided by an embodiment of the present invention is shown;

[0023] Figure 2 A schematic structural diagram of a photographing device provided by an embodiment of the present invention is shown;

[0024] Figure 3 A schematic diagram of a single-channel color image provided by an embodiment of the present invention is shown;

[0025] Figure 4 A schematic diagram of the outline of a target object provided by an embodiment of the present invention is shown;

[0026] Figure 5 A flowchart of another distance detection method provided by an embodiment of the present invention is shown;

[0027] Figure 6 The schematic diagram shows a distance calculation model provided by an embodiment of the present invention. Figure 1 ;

[0028] Figure 7 The schematic diagram shows a distance calculation model provided by an embodiment of the present invention. Figure 2 ;

[0029] Figure 8 A structural block diagram of a distance detection device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0030] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0031] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0032] Reference Figure 1 , shows a step flow chart of a distance detection method provided by an embodiment of the present invention, and the distance detection method can be applied to a vehicle including a shooting device.

[0033] like Figure 1 As shown, the distance detection method may specifically include the following steps:

[0034] Step 101: Acquire a plurality of continuous color images of a target object captured by the photographing device within a preset time period.

[0035] In the embodiment of the present invention, the photographing device is used to collect color images around the vehicle. In a preset time period, the vehicle can obtain a plurality of continuous color images collected by the photographing device within the preset time period.

[0036] It can be understood that the duration of the preset time period is determined by relevant technical personnel based on actual conditions (environment and number of collected pictures, etc.), and the embodiment of the present invention does not impose any specific limitation on this.

[0037] It can be understood that the frequency of capturing images by the shooting device and image-related parameters are set by relevant technical personnel according to specific needs, and the embodiments of the present invention are not limited to this.

[0038] Step 102: selecting at least one single-channel color image from the plurality of continuous color images through a preset color channel instruction.

[0039] Optionally, the preset color channel instruction includes:

[0040] An instruction to select two of the color channels, wherein the color channels of the single-channel color images of adjacent time frames are different; and / or,

[0041] An instruction to select a color channel whose reliability value is greater than a preset reliability value; and / or,

[0042] An instruction for selecting a color channel corresponding to the single-channel color image having a higher number of contour points.

[0043] In an embodiment of the present invention, each color image is processed into a single-channel color image by presetting a color channel instruction. For example, two or more color channels may be selected, and the color channels of the single-channel color images of adjacent time frames are different, or a color channel with greater empirical reliability may be selected, where the empirical reliability refers to a color channel that reflects a higher definition of the target object in previous practical applications. At this time, it is still assumed that the image of the color channel in this embodiment can clearly reflect the target object, and the color channel is defined as a color channel with greater empirical reliability.

[0044] It can be understood that the color channel with greater empirical reliability is not limited to specific colors, nor is it necessarily one channel, and is different for different target objects. Therefore, the color channel with greater empirical reliability is selected by relevant technical personnel based on actual applications, and the embodiments of the present invention do not limit its specific content.

[0045] For example, the color image can be processed into a red channel image and a blue channel image. In a preset time period, the color images collected by the shooting device in a continuous time period are obtained, and the color images of each time frame are processed into a red channel image or a blue channel image respectively. After the processing is completed, a blue channel image is separated between every two adjacent red channel images, and similarly, a red channel image is separated between every two adjacent blue channel images. Among them, the sum of the number of red channel images and the number of blue channel images is the number of time frames of the color image. Among them, the number of time frames in the color image can be determined by the relationship between the vehicle speed and the frame rate, that is, when the ratio between the vehicle speed and the frame rate is larger, the number of time frames of the color image is smaller, and vice versa, the number of time frames of the color image is larger.

[0046] It can be understood that in each preset time period, i is defined as the ordering of the single-channel color images in the time series, i starts from 0, and the increasing gradient is 1. When i is an even number, the acquired single-channel color image is a blue channel image; when i is an odd number, the acquired single-channel color image is a red channel image, so as to obtain continuous alternating red channel images and blue channel images.

[0047] In practical applications, during the process of capturing images, the shooting device can directly capture single-channel color images within a time interval. Alternatively, after the color images are captured, the images captured by odd frames can be processed into red channel images, and the images captured by even frames can be processed into blue channel images in a later stage by image processing.

[0048] It is understandable that the shooting interval of the color image is not within the scope of the embodiment of the present invention.

[0049] The preset time period may be 1s, 2s, etc. In different preset time periods, the camera may capture color images of different numbers of frames, thereby processing single-channel color images of different numbers of frames. It is understandable that the total number of frames of a single-channel color image is consistent with the number of frames of the color image, and the total number of frames of the single-channel color image is also consistent with the number of time frames of the preset time period. For example, when the preset time period is 1s, the camera may capture 30 or 20 frames of color images, thereby processing single-channel color images of 30 or 20 frames.

[0050] Furthermore, the number of single-channel color images is the same as the number of time frames within a preset time period.

[0051] Specifically, Figure 2 As shown, the shooting device may include a shooting module and a SOC (System on a Chip), the shooting module may include a CMOS (Complementary Metal Oxide Semiconductor, complementary metal oxide semiconductor) sensor and an ISP (Image Signal Processor, image signal processor), the shooting module may output an image in YUV (a color encoding method) format to the SOC chip, the SOC chip may be integrated with a DSP (Digital Signal Processor, digital signal processor) and a Core (Core) processor, the DSP may convert an image in YUV format into an image in RGB (Red Green Blue color mode, red, green and blue three-channel color mode) format, and store the image in RGB format in a memory, and the Core processor processes the color image into a single-channel color image. The SOC chip may also be integrated with a bus control interface, the bus control interface is connected to an external bus controller, so as to realize the mutual exchange of data between the shooting device and the main controller of the vehicle. Within a preset time period, the continuous multiple color images collected by the shooting device are processed into a single-channel color image, wherein the single-channel color image may be any one of a red channel image, a green channel image, and a blue channel image.

[0052] Step 103: performing image processing on each of the single-channel color images to obtain a contour image of the target object in each of the single-channel color images.

[0053] In the embodiment of the present invention, the contour image of the target object in each single-channel color image can be obtained through image processing. It can be understood that the contour of the target object is the edge of the target object in the single-channel color image. Generally, the contour of the target object in the single-channel color image can be obtained by using a Sobel edge detection operator or a Canny edge detection operator, such as Figure 4 As shown, the contour of the target object may include the contour of the target object in the vertical direction and the contour of the target object in the horizontal direction in the single-channel color image. Figure 3 It shows that the single-channel color image acquired by the shooting device includes four target objects. Figure 3 The target objects 11, 12, 13 and lane 05 are included in the image. The Sobel edge detection operator includes a binarization process with a threshold, which can be used to obtain differential edge points, that is, contours. The contours of the target objects 11, 12, 13 and lane 05 are shown in Figure 1. Figure 4 shown.

[0054] Step 104: Obtain the position of the target object in each single-channel color image by performing distance estimation processing on the target object in each single-channel color image; the position includes the longitudinal distance and the lateral distance between the vehicle and the target object.

[0055] In the embodiment of the present invention, the contour of the target object can be determined based on the contour edge points of the target object, and the continuity and similarity of the edge points of the target object in each single-channel color image can be further determined. Furthermore, the position coordinates of the target object in the single-channel color image can be obtained to determine the position of the target object in the preset area, such as Figure 4 As shown, the dotted box is a preset area, which is a shooting range set by relevant technicians according to the detection target object, generally the shooting range of the camera device, which is relevant to the vehicle driving detection, and the scope of the preset area in the image is not limited by the embodiment of the present invention. It can be understood that the shooting parameters of the camera device are known, and the coordinate value of the preset area set by the relevant technicians in the picture is known. By calculating the difference between the coordinates of the edge point of the target object and the coordinate value of the frame of the preset area, the position of the target object in the preset area can be obtained.

[0056] It is understandable that the target object may be a motorcycle, a truck, a car, a traffic sign, a pedestrian, etc. Through distance estimation processing, the position of the target object in the single-channel color image can be obtained, that is, the horizontal coordinate and the vertical coordinate of the target object in the single-channel color image, and the horizontal position and the vertical position of the target object in the single-channel color image can be obtained.

[0057] Among them, during the driving process of the vehicle, the distance between the target object and the vehicle can be calculated by the fixed parameters of the camera device set on the vehicle, such as the pixel value of the image of the target object taken by the camera device, the installation position of the camera device on the vehicle, and the shooting elevation angle, and it is shown in the captured image, that is, the horizontal distance (lateral distance) and the longitudinal distance (vertical distance) between the target object and the vehicle can be further calculated according to the position of the target object in the image (horizontal coordinate and vertical coordinate). Among them, the horizontal position is the specific embodiment of the coordinate reference system of the horizontal coordinate of the target object in the image, and the longitudinal position is the specific embodiment of the coordinate reference system of the vertical coordinate of the target object in the image.

[0058] It can be understood that the above-mentioned preset area is a shooting range set by relevant technicians according to the detection target object, which is generally the shooting range of the camera device and is relevant to vehicle driving detection. The embodiment of the present invention does not limit the scope of the preset area in the image.

[0059] In an embodiment of the present invention, the edge points of the target object can be determined according to the contour of the target object, so that the continuity and similarity of the edge points of the target object can be determined, wherein the calculation method of the continuity of the edge points is mainly obtained by using the average value of the product of the length of the edge segment connected by the edge points and the convex hull of the edge segment. The larger this value is, the higher the continuity of the edge points is. Of course, the calculation method of the continuity of the edge points is not limited to the above description, and the embodiment of the present invention does not impose specific restrictions on this. In addition, the similarity of the edge points of the target object in each single-channel color image can be determined according to the position difference of the contour of the target object in each single-channel color image in a preset area. The smaller the position difference, the higher the similarity. According to whether the horizontal coordinate of the target object in the single-channel image is between the horizontal coordinates of the left and right boundaries of the preset area, it can be judged whether the target object is located in the preset area of ​​the single-channel image. If the target object is located in the preset area of ​​the single-channel image, the position of the target object in the preset area is obtained; if the target object is not in the preset area of ​​the single-channel image, the next single-channel color image taken by the adjacent frame is selected to re-judge whether the target object is in the preset area in the single-channel color image. According to the continuity and similarity of the edge points of the target object, the position of the target object in the single-channel image, and the position of the target object in the preset area, the reliability value of the target object can be determined. It can be understood that the higher the reliability value of the target object, the clearer the outline of the target object, and the clearer the outline of the target object, the higher the accuracy of the detection results of the size and position of the target object.

[0060] Step 105: Input the contour image of the target object in each single-channel color image and the position of the target object in each single-channel color image into a pre-trained object reliability calculation model to obtain the reliability value of the target object in each single-channel color image; the reliability value is the ratio of the product of the contour continuity in the contour image of each target object and the position of each target object to the length of the preset time period.

[0061] In the embodiment of the present invention, the reliability of the target object can be determined based on the continuity and similarity of the edge points of the target object and the position of the target object in the preset area. It can be understood that the clearer the outline of the target object, the greater the reliability of the target object, that is, the clearer the outline of the target object, the higher the accuracy of the detection results of the size and position of the target object.

[0062] Among them, the reliability calculation model is trained in advance through a large number of object contour images. Therefore, the target object contour image of each single-channel color image and the position of the target object in each single-channel color image are directly output as the reliability value of the target object, which is an evaluation value of the continuity and similarity of the contour.

[0063] Step 106: Determine the actual longitudinal distance and actual lateral distance between the target object and the vehicle according to the longitudinal distance and lateral distance between the vehicle and the target object and the reliability value of the target object in each of the single-channel color images.

[0064] In an embodiment of the present invention, a single-channel color image of a target object having a reliability value greater than a preset reliability threshold is selected, and within a preset time period, the actual longitudinal distance and the actual lateral distance between the target object and the vehicle can be determined based on the contour, position, reliability value and distance calculation model of the target object in the single-channel color image.

[0065] It can be understood that in the embodiment of the present invention, the target object with high reliability in the preset time period is selected as the final target object. The reliability of the same target object in all single-channel color images in different time frames is compared, and the target object with high reliability is selected. That is, the single-channel color image with higher detection accuracy among all single-channel color images is selected. These images may be one or more. If there are multiple images, the target objects detected in these multiple images are superimposed to finally obtain a single-channel color image with the largest reliability value.

[0066] In the distance detection method provided by the embodiment of the present invention, the clarity of the contour of the target object in the single-channel color image is affected by factors such as illumination, road surface environment, inherent color of the target object, and background color. Since the clarity of the contour of the target object presented by the single-channel color images of different color channels is different when acquiring the single-channel color image, for example, in some scenes, the contour of the target object in the red channel image is clearer, and in some scenes, the contour of the same target object in the green channel image is clearer. Through this difference, in a preset time period, for all single-channel color images, the target object with the clearest contour can be obtained from the single-channel color image according to the calculated reliability value of the same target object. Among them, for the same target object, the clearer the contour of the target object in the single-channel color image, the greater the reliability of the single-channel color image where the target object is located, and then the position of the target object determined based on the contour of the target object in this single-channel image is more accurate. Therefore, by acquiring a single-channel color image in a color image, mutual compensation between factors such as lighting, road surface environment, inherent color of the target object and background color in different single-channel color images can be achieved, thereby reducing the influence of the above environmental factors on the accuracy of target object contour detection, thereby improving the detection accuracy of the distance between the target object and the vehicle.

[0067] Reference Figure 5 , shows a step flow chart of a distance detection method provided by an embodiment of the present invention, and the distance detection method can be applied to a vehicle including a shooting device.

[0068] like Figure 5 As shown, the distance detection method may specifically include the following steps:

[0069] Step 201: Acquire a plurality of continuous color images of a target object captured by the photographing device within a preset time period.

[0070] This step may specifically refer to the above step 101, which will not be described in detail here.

[0071] Step 202: selecting at least one single-channel color image from the plurality of consecutive color images by using a preset color channel instruction.

[0072] This step may specifically refer to the above step 102, which will not be described in detail here.

[0073] Step 203: performing image processing on each of the single-channel color images to obtain a contour image of the target object in each of the single-channel color images.

[0074] This step may specifically refer to the above step 103, which will not be described in detail here.

[0075] Step 204: Obtain the position of the target object in each single-channel color image by performing distance estimation processing on the target object in each single-channel color image; the position includes the longitudinal distance and the lateral distance between the vehicle and the target object.

[0076] This step may specifically refer to the above step 104, which will not be described in detail here.

[0077] Step 205: Input the contour image of the target object in each single-channel color image and the position of the target object in each single-channel color image into a pre-trained object reliability calculation model to obtain the reliability value of the target object in each single-channel color image.

[0078] Preferably, in the embodiment of the present invention, step 205 may include:

[0079] Sub-step 2051: extracting contour edge points in the contour image of each target object;

[0080] It can be understood that the contour of the target object is composed of many edge points, and the coordinates of the edge points constituting the object contour in the target object contour image are obtained.

[0081] Sub-step 2052: Determine the continuity of the contour edge points in the contour image of each target object;

[0082] Specifically, according to the coordinates of the edge points of the contour points, the distance between the coordinates is calculated, and then the continuity of the edge points of the contour is obtained, wherein the method for calculating the continuity of the edge points is mainly to obtain it by using the average value of the product of the length of the edge segment connecting the edge points and the convex hull of the edge segment. The larger this value is, the higher the continuity of the edge points is. Of course, the method for calculating the continuity of the edge points is not limited to the above description, and the embodiments of the present invention do not impose specific limitations on this.

[0083] Sub-step 2053: determining the similarity between the contour edge points in the contour images of the target objects;

[0084] It can be understood that the position of the target object contour in the preset area is obtained through the coordinates of the contour point edge point. If the variance between the positions of the target object contour in the preset area in each single-channel color image is smaller, the similarity of the contour edge point is higher.

[0085] Sub-step 2054: determining the area position of the target object within the preset area of ​​each of the single-channel color images;

[0086] Specifically, after the position of the target object in the preset area is determined, the reliability of the target object can be determined by the target object contour image of each single-channel color image and the position of the target object in each single-channel color image and the regional position. It can be understood that the clearer the contour of the target object, the greater the reliability value of the target object, that is, the clearer the contour of the target object, the higher the accuracy of the detection results of the size, position, etc. of the target object.

[0087] Sub-step 2055: Input the continuity and similarity of the contour edge points in the contour images of each target object, the position of the target object and the region position into a pre-trained object reliability calculation model to obtain the reliability value of the target object in each single-channel color image.

[0088] Specifically, the reliability calculation model is trained in advance through a large number of object contour images. Therefore, it will directly output the reliability value of the target object, that is, an evaluation value of the continuity and similarity of the contour, based on the input target object contour image (including the continuity and similarity of the contour edge points in the target object contour image, the position of the target object and the regional position), the longitudinal distance and the lateral distance between the target object and the vehicle.

[0089] This step may specifically refer to the above step 104, which will not be described in detail here.

[0090] Step 206: extracting the last preset number of candidate single-channel color images of the candidate target objects in the shooting process.

[0091] In the embodiment of the present invention, the single-channel color images of the last preset number of time frames in the preset time period are determined as candidate single-channel color images, and the number of objects in the candidate single-channel color images may be multiple.

[0092] Step 207: Acquire the first coordinate value of the candidate target object in each of the candidate single-channel color images.

[0093] In the embodiment of the present invention, the horizontal coordinate value and the vertical coordinate value, ie, the first coordinate value, of the target object in each candidate single-channel color image are obtained.

[0094] Step 208: If the reliability value of the candidate target object in the candidate single-channel color image is greater than a first preset threshold, and the first coordinate value of the candidate target object is less than a second preset threshold, the candidate target object is determined as the first target object.

[0095] In an embodiment of the present invention, the reliability value of the object in the above-mentioned single-channel color image is calculated. Wherein, when the preset time period is 1 second, the preset number can be set to 10. If the reliability value of the object is greater than the first preset threshold value, and the coordinate position of the object is less than the second preset threshold value, the object is determined as the first target object. It can be understood that the coordinate position of the object is the coordinate value of the object in the candidate single-channel color image.

[0096] Step 209: performing a clustering operation on the coordinate values ​​of the first target object to obtain a plurality of first clusters.

[0097] In an embodiment of the present invention, the coordinate position of the first target object in the image is clustered according to a clustering algorithm, and corresponding clusters of different positions of the target object in different time frames are obtained. Among them, the clustering algorithm can be a K-means clustering algorithm (k-means clustering algorithm), a mean shift clustering algorithm, a density-based clustering algorithm (Density-Based Spatial Clustering of Applications with Noise, DBSCAN), etc. Those skilled in the art can set a suitable clustering algorithm according to actual conditions, and the embodiment of the present invention does not limit this. It can be understood that the coordinate position of the first target object in the image includes different coordinate positions of the first target object in the image at different time frames. The coordinate values ​​of the first target object in different time frames are clustered, and clusters of position coordinate values ​​of the same target object in different time frames can be obtained.

[0098] In an implementable manner of the embodiment of the present invention, a specific implementation manner of the above step 209 may include:

[0099] Sub-step 2091: Determine the first target object whose reliability value is greater than a sixth preset threshold as the second target object.

[0100] Specifically, the first target object whose reliability is greater than the sixth preset threshold is determined as the second target object, and the longitudinal position of the second target object in the image can be compensated according to the following formula (1) to obtain the longitudinal absolute position of the second target object, that is, the position of the second target object in the image rather than the position in the preset area.

[0101] xx′=xx-(i-ix)×v×dt (1)

[0102] Wherein, xx′ represents the absolute vertical position of the second target object on the candidate single-channel color image;

[0103] xx represents the longitudinal position of the second target object in the image before compensation;

[0104] i represents the sequence of time frames in the preset time period, i starts from 0 and increases with a gradient of 1;

[0105] ix represents a preset number of time frames that are counted down in chronological order within a preset time period, and ix increases from 1;

[0106] v means Figure 6 The speed of the vehicle 01 shown is in m / s;

[0107] dt represents the duration of a preset time period, in seconds.

[0108] Sub-step 2092: Compensating the distance between the vehicle and the second target object by the vehicle speed when taking the plurality of consecutive color images, and obtaining a second coordinate value of the second target object in the candidate single-channel color image.

[0109] It can be understood that in practical applications, position compensation is only performed on stationary objects.

[0110] By compensating the longitudinal position of the second target object in the image, the distance between the vehicle and the second target object can be compensated accordingly, and the absolute position of the second target object in the image can be obtained.

[0111] Sub-step 2093: performing a clustering operation on the second target object using the second coordinate value to obtain a plurality of second clusters.

[0112] Specifically, clustering is performed on the absolute position of the second target object in the image, that is, clustering is performed on the absolute position of the second target object in the image at different time frames, and clustering clusters of the absolute positions of different time frames can be obtained. Each clustering cluster includes the absolute position of the second target object corresponding to at least one time frame. It can be understood that this clustering method is also applicable to the detection of stationary targets.

[0113] Step 210: Obtain a first reliability value of each of the first target objects in each of the first clusters.

[0114] Step 211: Select the first target object corresponding to the largest first reliability value as a reliable target object.

[0115] In an embodiment of the present invention, according to the maximum reliability value or average reliability value of the first target object, and the moving trajectory of the first target object. Since the first target object corresponds to different reliabilities in different time frames, the maximum reliability or average reliability can be obtained from the multiple reliabilities corresponding to the first target object in the cluster in multiple time frames. The position of the first target object in the image at different time frames is placed in the same image, and the moving trajectory of the first target object in the time series can be obtained. Therefore, according to the maximum reliability or average reliability of the first target object, and the moving trajectory.

[0116] It is understandable that although the reliability value of the first target object is output in the most recent time frame or a frame not related to clustering, because this has sufficient reliability. This can achieve a fast response, but such common objects must follow the clustering process to make reliable outputs. The frames selected for reliability value calculation and whether to cluster are selected by relevant technicians according to specific application scenarios, and the embodiments of the present invention do not specifically limit this.

[0117] Specifically, when the maximum reliability or average reliability of the cluster cluster is greater than the third preset threshold value, and the smoothness of the moving trajectory of the cluster cluster is greater than the fourth preset threshold value, the weighted average of the coordinate position of the first target object in the cluster cluster can be determined as the final distance and lateral position of the target object. It can be understood that the greater the maximum reliability or average reliability of the cluster cluster, and the greater the smoothness of the moving trajectory of the cluster cluster, the more accurate the lateral position of the cluster cluster in the image and the distance detection between the cluster cluster and the vehicle. Among them, the weighted average of the coordinate position of the first target object can include a first weighted average of multiple lateral coordinates of the first target object in the image at different time frames, and a second weighted average of multiple longitudinal coordinates of the first target object in the image at different time frames. According to the sum of the first weighted average and the second weighted average, the weighted average of the coordinate position of the first target object in the cluster cluster is obtained. According to the weighted average of the coordinate position, the final distance between the first target object and the vehicle and the lateral position of the first target object in the image can be obtained.

[0118] Step 212: Acquire the movement trajectory of the reliable target object as the reliable movement trajectory.

[0119] Step 213: If the maximum reliability value of the cluster is greater than the third preset threshold, and the smoothness of the reliable movement trajectory is greater than the fourth preset threshold, the ordinate value and the abscissa value of each of the reliable target objects in each first cluster are obtained.

[0120] Step 214: Calculate the weighted average values ​​of the ordinate value and the abscissa value of the reliable target object respectively.

[0121] Step 215: Determine the weighted average of the longitudinal coordinate values ​​as the actual longitudinal distance between the target object and the vehicle, and the weighted average of the abscissa values ​​as the actual lateral distance between the target object and the vehicle.

[0122] In an embodiment of the present invention, optionally, when the reliability of the target object is greater than a fifth preset threshold, the distance between the target object with the highest reliability and the vehicle is determined as the final distance between the target object and the vehicle, and the lateral position of the target object with the highest reliability is determined as the final actual lateral position of the target object.

[0123] Alternatively, if Figure 6 As shown, the shooting device of vehicle 01 can shoot an image including target object 02, wherein target object 02 is a car. In the image, target object 02 is within shooting area 04. The shooting device may include a monocular camera, and the position of the target object in the single-channel color image is estimated by the shooting angle or shooting height of the monocular camera. Alternatively, the position of the target object in the single-channel color image can be estimated based on pattern matching. Specifically, pattern matching refers to estimating the position of the target object in the single-channel color image based on the estimated height value of the target object in the single-channel color image and the ratio between the initial reference height value preset in the monocular camera.

[0124] Optionally, a plurality of reference frames 03 are preset in the distance calculation model in the vehicle 01, and each reference frame 03 is set with a corresponding distance value, for example, the distance value between the first reference frame 031 and the vehicle 01 is r1, the distance value between the second reference frame 032 and the vehicle 01 is r2, and the distance value between the third reference frame 033 and the vehicle 01 is r3. If the actual size of each reference frame 03 is the same, for example, they are all rectangular reference frames with a width value of 4m and a height value of 2m, the farther the reference frame of the same size is from the vehicle 01, the smaller the size of the reference frame in the shooting area 04 of the shooting device is, such as Figure 7 shown.

[0125] Optionally, the specific implementation of step 204 may further include:

[0126] Sub-step 2041: Determine the estimated size of the target object with the highest reliability when the reliable target object takes each reference frame as a reference object.

[0127] For example, the target object with the highest reliability is the target object corresponding to the time frame with the highest reliability among the multiple reliabilities corresponding to the same target object in multiple time frames. In the first reference frame 031, according to the relationship between the position and outline of the target object 02 in the image and the size of each reference frame, the first estimated size of the target object 02 can be obtained; in the second reference frame 032, the second estimated size of the target object 02 can be obtained; in the third reference frame 033, the third estimated size of the target object 02 can be obtained. Sub-step 2041 may specifically include:

[0128] Sub-step S1: According to the contour of the target object with the highest reliability in all single-channel color images, determine the actual height value and the actual width value of the target object with the highest reliability in the single-channel color image.

[0129] Sub-step S2: Determine the estimated height value of the target object with the highest reliability based on the ratio of the actual height value to the height value of each reference frame, and determine the estimated width value of the target object with the highest reliability based on the ratio of the actual width value to the width of each reference frame.

[0130] Specifically, there is a proportional correspondence between the preset image reference frame and the actual size in the image taken by the camera, that is, the size of the reference frame is preset to correspond to the real scene size, so knowing the ratio of the target object in the image to the reference frame can determine the actual size of the target object.

[0131] Sub-step S3: Determine the estimated size of the target object with the highest reliability in each reference frame according to the estimated height value and the estimated width value.

[0132] For example, the width of each reference frame is set to 4m and the height to 2m. Figure 7 As shown, the ratio of the actual height value of the target object 02 in the single-channel color image to the height value of the first reference frame is 0.3. Based on the ratio value 0.3 and the width value 4m of the first reference frame, the first estimated size of the width value of the target object in the first reference frame can be determined to be 1.2m. Similarly, the second estimated size of the width value of the target object in the second reference frame can be determined to be 1.8m, and the third estimated size of the width value of the target object in the third reference frame can be determined to be 3.2m.

[0133] Sub-step 2042: Determine a score value for each of the reference frames according to a preset size preset for the target object and the estimated size of the target object with the highest reliability.

[0134] Specifically, the size of the target object in the image can be determined according to the outline of the target object, for example, the aspect ratio of the target object can be obtained; according to the size of the target object in the image, a preset size preset for target objects of different sizes can be obtained, wherein the preset size can be the size of the target object in real life, for example, if the actual width value of a car is 1.7m, then the preset width value of the car is 1.7m. According to the preset size and the estimated size of the target object, the score value of each reference frame can be determined. The higher the score value of the reference frame, the more accurate the estimated size of the target object obtained according to the reference frame, and thus the more accurate the distance between the target object and the vehicle. Among them, referring to the example of sub-step 2081, the preset width value is 1.7m, the first estimated size is 1.2m, the second estimated size is 1.8m, and the third estimated size is 3.2m. According to the preset size and the first estimated size, the similarity between the preset size and the first estimated size is determined, and according to the similarity, the score value of the first reference frame 031 is determined to be S1; similarly, according to the preset size and the second estimated size, the score value of the second reference frame 032 is determined to be S2; according to the preset size and the third estimated size, the score value of the third reference frame 033 is determined to be S3.

[0135] Sub-step 2043: Determine the distance value corresponding to the reference frame with the highest score as the distance between the target object and the vehicle.

[0136] Specifically, referring to the example of sub-step 2102, the score value of the first reference frame 031 is S1, the score value of the second reference frame 032 is S2, and the score value of the third reference frame 033 is S3. The reference frame corresponding to the highest score value is selected from S1, S2, and S3, such as Figure 7 As shown, when the width value of the reference frame is set to 4m, the estimated width values ​​of the target object 02 are 1.2m, 1.8m and 3.2m respectively. When the preset size is 1.7m, it can be determined that the estimated size 1.8m and the preset size 1.7m have the highest similarity. The estimated size of the target object 02 in the second reference frame 032 has the highest score value. The distance value corresponding to the second reference frame 032 is r2, and r2 can be determined as the distance between the target object and the vehicle.

[0137] It is understandable that when the score corresponding to each reference frame is less than the preset threshold, the detection result can be output as the target object is not detected in the single-channel color image. Among them, those skilled in the art can set the size of the preset threshold according to actual conditions, and the embodiment of the present invention is not limited to this.

[0138] Optionally, in another embodiment of the present invention, the step of training the object reliability calculation model includes:

[0139] Step A1, obtaining a plurality of continuous training color images of the training target object captured by the shooting device within a preset time period;

[0140] In an embodiment of the present invention, the photographing device is used to collect color images around the vehicle. In a preset time period, the vehicle can obtain a plurality of continuous color images collected by the photographing device in a preset time period for training.

[0141] It can be understood that the duration of the preset time period is determined by relevant technical personnel based on actual conditions (environment and number of collected pictures, etc.), and the embodiment of the present invention does not impose any specific limitation on this.

[0142] It can be understood that the frequency of image acquisition by the shooting device and image-related parameters are set by relevant technical personnel according to specific needs, and the embodiment of the present invention does not limit this.

[0143] Step A2, selecting at least one training single-channel color image from the plurality of continuous training color images by using a preset color channel instruction;

[0144] Optionally, the preset color channel instruction includes:

[0145] An instruction to select two of the color channels, wherein the color channels of the single-channel color images of adjacent time frames are different; and / or,

[0146] An instruction to select a color channel whose reliability value is greater than a preset reliability value; and / or,

[0147] An instruction for selecting a color channel corresponding to the single-channel color image having a higher number of contour points.

[0148] In an embodiment of the present invention, each color image is processed into a single-channel color image by presetting a color channel instruction. For example, two or more color channels may be selected, and the color channels of the single-channel color images of adjacent time frames are different, or a color channel with greater empirical reliability may be selected, where the empirical reliability refers to a color channel that reflects a higher definition of the target object in previous practical applications. At this time, it is still assumed that the image of the color channel in this embodiment can clearly reflect the target object, and the color channel is defined as a color channel with greater empirical reliability.

[0149] It can be understood that the color channel with greater empirical reliability is not limited to specific colors, nor is it necessarily one channel, and is different for different target objects. Therefore, the color channel with greater empirical reliability is selected by relevant technical personnel based on actual applications, and the embodiments of the present invention do not limit its specific content.

[0150] Step A3, extracting contour edge points in the contour image of the training target object as contour sample data;

[0151] In an embodiment of the present invention,

[0152] Step A4, determining the continuity of the contour sample data;

[0153] In an embodiment of the present invention,

[0154] Step A5, determining the similarity between the contour sample data in the contour images of the training target objects;

[0155] In the embodiment of the present invention, the contour image of the training target object in each single-channel training color image can be obtained through image processing. It can be understood that the contour of the training target object is the edge of the training target object in the single-channel training color image. The contour of the training target object in the single-channel color image can usually be obtained by using a Sobel edge detection operator or a Canny edge detection operator.

[0156] According to the contour edge points of the training target object, the contour of the training target object can be determined, and the continuity and similarity of the edge points of the training target object in each single-channel training color image can be further determined. Further, by obtaining the position coordinates of the target object in the training single-channel color image, the position of the training target object in the preset area can be determined. According to the contour edge points of the training target object, the contour of the training target object can be determined, and the continuity and similarity of the edge points of the target object in each single-channel color image can be further determined. Further, by obtaining the position coordinates of the target object in the single-channel color image, the position of the target object in the preset area can be determined.

[0157] Among them, during the driving process of the vehicle, the distance between the target object and the vehicle can be calculated by the fixed parameters of the camera device set on the vehicle, such as the pixel value of the image of the target object taken by the camera device, the installation position of the camera device on the vehicle, and the shooting elevation angle, and it is shown in the captured image, that is, the horizontal distance (lateral distance) and the longitudinal distance (vertical distance) between the target object and the vehicle can be further calculated according to the position of the target object in the image (horizontal coordinate and vertical coordinate). Among them, the horizontal position is the specific embodiment of the coordinate reference system of the horizontal coordinate of the target object in the image, and the longitudinal position is the specific embodiment of the coordinate reference system of the vertical coordinate of the target object in the image.

[0158] Step A6, determining the training area position of the training target object within the preset area of ​​each of the training single-channel color images;

[0159] In an embodiment of the present invention, whether the training target object is located in the preset area of ​​the single-channel color training image can be determined based on whether the horizontal coordinates of the training target object in the single-channel color training image are between the horizontal coordinates of the left and right boundaries of the preset area. If the target object is located in the preset area of ​​the single-channel color training image, the position of the training target object in the preset area is obtained; if the target object is not in the preset area of ​​the single-channel image, the next single-color training channel color image taken by the adjacent frame is selected to re-determine whether the training target object is in the preset area in the single-channel color training image, and the training area position of the training object in the preset area is determined based on the coordinate values.

[0160] Step A7, training the continuity and similarity of each contour sample data, the position of the training target object and the position of the training area through a deep learning algorithm to obtain an object reliability calculation model.

[0161] In an embodiment of the present invention, the continuity and similarity of the contour sample data, the position of the training target object and the position of the training area are trained using a deep learning algorithm. When the parameters in the deep learning algorithm converge, the training is terminated to obtain an object reliability calculation model.

[0162] In an embodiment of the present invention, on the one hand, the distance between the target object and the vehicle can be obtained by the contour, position, reliability, and distance calculation model of the target object. On the other hand, for the candidate single-channel color images of the last preset number of time frames of the preset time period, the object whose reliability is greater than the first preset threshold and whose coordinate position is less than the time frame corresponding to the second preset threshold can be determined as the first target object, and the coordinate position of the first target object in the image is clustered according to the clustering algorithm, and the cluster clusters of the target positions of different time frames are obtained, and the maximum reliability or average reliability of the cluster cluster is determined. According to the coordinate position of the cluster cluster whose maximum reliability or average reliability is greater than the third preset threshold and whose smoothness of the moving trajectory is greater than the fourth preset threshold, the final distance and lateral position between the cluster cluster and the vehicle can be determined. In this way, it is possible to avoid missing the target object with a smaller reliability, improve the detection reliability of the target object, and further improve the reliability of the distance detection between the target object and the vehicle, so as to improve the safety of the vehicle during driving.

[0163] Reference Figure 8 , shows a structural block diagram of a distance detection device 300 according to an embodiment of the present invention, which is applied to a vehicle including a camera. Specifically, it may include the following modules:

[0164] An image capturing module 301 is used to obtain a plurality of continuous color images of a target object captured by the capturing device within a preset time period;

[0165] The single-channel color image selection module 302 is used to select at least one single-channel color image from the plurality of continuous color images according to a preset color channel instruction;

[0166] Preferably, the preset color channel instruction includes:

[0167] An instruction to select two of the color channels, wherein the color channels of the single-channel color images of adjacent time frames are different; and / or,

[0168] An instruction to select a color channel whose empirical reliability is greater than a preset reliability; and / or an instruction to select a color channel corresponding to the single-channel color image having a higher number of contour points; and / or

[0169] An instruction for selecting a color channel corresponding to the single-channel color image having a higher number of contour points.

[0170] The target object contour image obtaining module 303 is used to perform image processing on each of the single-channel color images to obtain the contour image of the target object in each of the single-channel color images;

[0171] A position obtaining module 304 is used to obtain the position of the target object in each single-channel color image by performing distance estimation processing on the target object in each single-channel color image; the position includes the longitudinal distance and the lateral distance between the vehicle and the target object;

[0172] The reliability value acquisition module 305 is used to input the contour image of the target object in each single-channel color image and the position of the target object in each single-channel color image into a pre-trained object reliability calculation model to obtain the reliability value of the target object in each single-channel color image; the reliability value is the product of the contour continuity in the contour image of each target object and the position of each target object, and the ratio of the length of the preset time period;

[0173] Preferably, the reliability value acquisition module 305 is further used for:

[0174] Extracting contour edge points in the contour image of each target object;

[0175] Determining the continuity of the contour edge points in the contour image of each target object;

[0176] Determining the similarity between the contour edge points in the contour image of each target object;

[0177] Determining the regional position of the target object within a preset area of ​​each of the single-channel color images;

[0178] The continuity and similarity of the contour edge points in the contour images of the target objects, the position of the target objects and the region position are input into a pre-trained object reliability calculation model to obtain the reliability value of the target objects in each single-channel color image.

[0179] The final distance acquisition module 306 is used to determine the actual longitudinal distance and actual lateral distance between the target object and the vehicle according to the longitudinal distance, lateral distance between the vehicle and the target object, and the reliability value of the target object in each single-channel color image.

[0180] Preferably, the final distance acquisition module 306 is further used for:

[0181] Determine the coordinate position of the target object in each of the single-channel color images; the coordinate position includes the horizontal coordinate position and the vertical coordinate position of the target object in each of the single-channel color images;

[0182] Determine the longitudinal distance and the lateral distance between the target objects in each of the single-channel color images according to the transverse coordinate position and the longitudinal coordinate position of the target object in each of the single-channel color images;

[0183] Determining the smoothness and continuity of the moving trajectory of the target object according to the change rate of the longitudinal distance and the lateral distance between the target object and the vehicle in each of the single-channel color images;

[0184] According to the smoothness and continuity of the moving track of the target object, the actual longitudinal distance and the actual lateral distance between the target object and the vehicle are determined.

[0185] Preferably, the final distance acquisition module 306 is further used for:

[0186] Extracting the last preset number of candidate single-channel color images of candidate target objects during the shooting process;

[0187] Acquire a first coordinate value of the candidate target object in each of the candidate single-channel color images;

[0188] If the reliability value of the candidate target object in the candidate single-channel color image is greater than a first preset threshold, and the first coordinate value of the candidate target object is less than a second preset threshold, determining the candidate target object as a first target object;

[0189] Performing a clustering operation on the coordinate values ​​of the first target object to obtain a plurality of first clusters;

[0190] Acquire a first reliability value of each of the first target objects in each of the first clusters;

[0191] Selecting the first target object corresponding to the largest first reliability value as a reliable target object;

[0192] Acquiring the movement trajectory of the reliable target object as a reliable movement trajectory;

[0193] If the maximum reliability value of the cluster is greater than a third preset threshold, and the smoothness of the reliable movement trajectory is greater than a fourth preset threshold, obtaining the ordinate value and the abscissa value of each of the reliable target objects in each of the first clusters;

[0194] Calculating the weighted average values ​​of the ordinate value and the abscissa value of the reliable target object respectively;

[0195] The weighted average of the longitudinal coordinate values ​​is determined as the actual longitudinal distance between the target object and the vehicle, and the weighted average of the abscissa values ​​is determined as the actual lateral distance between the target object and the vehicle.

[0196] Preferably, the final distance acquisition module 306 is further used for:

[0197] Determine the first target object whose reliability value is greater than a sixth preset threshold as the second target object;

[0198] Compensating the distance between the vehicle and the second target object by the vehicle speed when taking the plurality of consecutive color images, and acquiring a second coordinate value of the second target object in the candidate single-channel color image;

[0199] A clustering operation is performed on the second target object using the second coordinate value to obtain a plurality of second clusters.

[0200] Preferably, the number of the plurality of consecutive color images captured by the photographing device is determined by the speed of the vehicle when the plurality of consecutive color images are photographed.

[0201] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0202] 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 principle of the present invention should be included in the protection scope of the present invention.

[0203] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A distance detection method, applied to a vehicle including a camera, characterized in that: The method comprises: Acquire a plurality of continuous color images of the target object captured by the photographing device within a preset time period; Selecting at least one single-channel color image from the plurality of continuous color images by using a preset color channel instruction; Performing image processing on each of the single-channel color images to obtain a contour image of the target object in each of the single-channel color images; By performing distance estimation processing on the target object in each of the single-channel color images, the position of the target object in each of the single-channel color images is obtained; the position includes the longitudinal distance and the lateral distance between the vehicle and the target object; Inputting the contour image of the target object in each single-channel color image and the position of the target object in each single-channel color image into a pre-trained object reliability calculation model to obtain the reliability value of the target object in each single-channel color image; Selecting the target object in the single-channel color image corresponding to the maximum reliability value as a reliable target object, and determining an actual longitudinal distance and an actual lateral distance between the reliable target object and the vehicle; The step of calculating the reliability value of the target object in each of the single-channel color images comprises: Extracting contour edge points in the contour image of each target object; Determining the continuity of the contour edge points in the contour image of each target object; Determining the similarity between the contour edge points in the contour image of each target object; Determining the regional position of the target object within a preset area of ​​each of the single-channel color images; Inputting the continuity and similarity of the contour edge points in the contour images of the target objects, the position of the target objects and the position of the regions into a pre-trained object reliability calculation model to obtain the reliability value of the target objects in the single-channel color images; The step of selecting the target object in the single-channel color image corresponding to the maximum reliability value as a reliable target object, and determining the actual longitudinal distance and the actual lateral distance between the reliable target object and the vehicle comprises: Selecting the target object in the single-channel color image corresponding to the maximum reliability value as a reliable target object; Determine the coordinate position of the reliable target object in the single-channel color image; the coordinate position includes the horizontal coordinate position and the vertical coordinate position of the reliable target object in the single-channel color image; Determine the longitudinal distance and the lateral distance between the reliable target objects in the single-channel color image according to the transverse coordinate position and the longitudinal coordinate position of the reliable target object in the single-channel color image; Determining the smoothness and continuity of the moving trajectory of the target object according to the change rate of the longitudinal distance and the lateral distance between the target object and the vehicle in each of the single-channel color images; According to the smoothness and continuity of the moving track of the target object, the actual longitudinal distance and the actual lateral distance between the target object and the vehicle are determined.

2. The method according to claim 1, characterized in that The step of determining the actual longitudinal distance and the actual lateral distance between the target object and the vehicle according to the smoothness and continuity of the moving trajectory of the target object comprises: Extracting the last preset number of candidate single-channel color images of candidate target objects during the shooting process; Acquire a first coordinate value of the candidate target object in each of the candidate single-channel color images; If the reliability value of the candidate target object in the candidate single-channel color image is greater than a first preset threshold, and the first coordinate value of the candidate target object is less than a second preset threshold, determining the candidate target object as a first target object; Performing a clustering operation on the coordinate values ​​of the first target object to obtain a plurality of first clusters; Acquire a first reliability value of each of the first target objects in each of the first clusters; Selecting the first target object corresponding to the largest first reliability value as a reliable target object; Acquiring the movement trajectory of the reliable target object as a reliable movement trajectory; If the maximum reliability value of the cluster is greater than a third preset threshold, and the smoothness of the reliable movement trajectory is greater than a fourth preset threshold, obtaining the ordinate value and the abscissa value of each of the reliable target objects in each of the first clusters; Calculating the weighted average values ​​of the ordinate value and the abscissa value of the reliable target object respectively; The weighted average of the longitudinal coordinate values ​​is determined as the actual longitudinal distance between the target object and the vehicle, and the weighted average of the abscissa values ​​is determined as the actual lateral distance between the target object and the vehicle.

3. The method according to claim 2, characterized in that The step of performing a clustering operation on the coordinate values ​​of the first target object to obtain a plurality of first clusters includes: Determine the first target object whose reliability value is greater than a sixth preset threshold as the second target object; Compensating the distance between the vehicle and the second target object by the vehicle speed when taking the plurality of consecutive color images, and acquiring a second coordinate value of the second target object in the candidate single-channel color image; A clustering operation is performed on the second target object using the second coordinate value to obtain a plurality of second clusters.

4. The method according to claim 1, characterized in that: The preset color channel instruction includes: an instruction to select two color channels, and the color channels of the single-channel color images of adjacent time frames are different; and / or, An instruction to select a color channel whose reliability value is greater than a preset reliability value; and / or, An instruction for selecting a color channel corresponding to the single-channel color image having a higher number of contour points.

5. The method according to claim 1, characterized in that The training step of the object reliability calculation model includes: Acquire a plurality of continuous training color images of the training target object captured by the photographing device within a preset time period; Selecting at least one training single-channel color image from the plurality of continuous training color images by using a preset color channel instruction; Extracting contour edge points in the contour image of the training target object as contour sample data; Determining the continuity of the contour sample data; Determining the similarity between the contour sample data in the contour images of the training target objects; Determining a training area position of the training target object within a preset area of ​​each of the training single-channel color images; The continuity and similarity of each contour sample data, the position of the training target object and the position of the training area are trained through a deep learning algorithm to obtain an object reliability calculation model.

6. A distance detection device, applied to an image processing system in a vehicle, wherein the image processing system comprises a photographing device, characterized in that: The device comprises: An image capturing module, used to obtain a plurality of continuous color images of the target object captured by the capturing device within a preset time period; A single-channel color image selection module, used to select at least one single-channel color image from the plurality of continuous color images according to a preset color channel instruction; A target object contour image acquisition module, used for performing image processing on each of the single-channel color images to obtain a contour image of the target object in each of the single-channel color images; A position acquisition module, configured to obtain the position of the target object in each single-channel color image by performing distance estimation processing on the target object in each single-channel color image; the position includes the longitudinal distance and the lateral distance between the vehicle and the target object; A reliability acquisition module, used for inputting the contour image of the target object in each single-channel color image and the position of the target object in each single-channel color image into a pre-trained object reliability calculation model to obtain the reliability value of the target object in each single-channel color image; A final distance acquisition module, used for selecting the target object in the single-channel color image corresponding to the maximum reliability value as a reliable target object, and determining an actual longitudinal distance and an actual lateral distance between the reliable target object and the vehicle; The reliability acquisition module is further used for: Extracting contour edge points in the contour image of each target object; Determining the continuity of the contour edge points in the contour image of each target object; Determining the similarity between the contour edge points in the contour image of each target object; Determining the regional position of the target object within a preset area of ​​each of the single-channel color images; Inputting the continuity and similarity of the contour edge points in the contour images of the target objects, the position of the target objects and the position of the regions into a pre-trained object reliability calculation model to obtain the reliability value of the target objects in the single-channel color images; The final distance acquisition module is further used for: Determine the coordinate position of the target object in each of the single-channel color images; the coordinate position includes the horizontal coordinate position and the vertical coordinate position of the target object in each of the single-channel color images; Determine the longitudinal distance and the lateral distance between the target objects in each of the single-channel color images according to the transverse coordinate position and the longitudinal coordinate position of the target object in each of the single-channel color images; Determining the smoothness and continuity of the moving trajectory of the target object according to the change rate of the longitudinal distance and the lateral distance between the target object and the vehicle in each of the single-channel color images; According to the smoothness and continuity of the moving track of the target object, the actual longitudinal distance and the actual lateral distance between the target object and the vehicle are determined.

7. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is executed by the processor, the steps of the distance detection method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the distance detection method according to any one of claims 1 to 5 are implemented.