Vehicle head avoidance method, apparatus and system, and computer-readable storage medium
By using visible light array cameras to avoid the front of the vehicle, the problems of high equipment costs, large land area and low accuracy in the existing technology are solved, and high-precision avoidance of the front of the vehicle is achieved, adapting to various models and reducing safety risks.
Patent Information
- Application Number
- PCT/CN2024/141447
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-26
- Filing Date
- 2024-12-23
- Publication Date
- 2025-07-03
AI Technical Summary
In the process of avoiding the front of the vehicle, the existing technology has problems such as high equipment costs, large footprint, large impact on ambient light, impact on the imaging accuracy of the vehicle speed, and inability to identify special models, resulting in inaccurate separation of the front of the vehicle and the carriage, which poses safety hazards.
The visible light array camera is used instead of the linear array image acquisition device, and the focal length and pixel size are obtained through calibration of the internal and external parameters of the camera, combined with multi-frame image processing and depth information, the front dimensions are accurately measured and avoided.
It reduces equipment costs and footprints, improves the accuracy and accuracy of front avoidance, reduces the impact on vehicle speed and ambient light, adapts to various models, and reduces safety hazards.
Smart Images

Figure CN2024141447_03072025_PF_FP_ABST
Abstract
Description
Vehicle head-on avoidance method, device, system, and computer-readable storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on the application with CN application number CN202311810084.0 and application date December 26, 2023, and claims its priority. The disclosed content of the CN application is hereby introduced as a whole into this application. Technical Field
[0003] The present disclosure relates to the field of security inspection technology, and in particular to a vehicle head-on avoidance method, device and system, and a computer-readable storage medium. Background Art
[0004] The need for vehicle front avoidance is to prevent the driver from being scanned by the X-ray when the driver drives the vehicle through the X-ray radiation image security inspection system. The front part where the driver is located and the car part where the cargo is located need to be separated, and only the car part is scanned.
[0005] Related technologies commonly use image data acquisition equipment, such as line array cameras, area lasers, infrared light curtains, etc., to collect linear sequence image information when a vehicle passes through the system, determine the position of the vehicle front based on the vehicle body information in the image, and then separate the vehicle front and the vehicle compartment, thereby performing safety inspections on the vehicle compartment. Summary of the Invention
[0006] According to one aspect of the present disclosure, a vehicle head-on avoidance method is provided, comprising:
[0007] Obtaining an image of the vehicle to be tested captured by a visible light area array camera;
[0008] Obtain the camera focal length by calibrating the internal and external parameters of the camera;
[0009] Process the image of the vehicle to be tested to obtain the pixel size of the vehicle head;
[0010] Get the distance between the camera and the front of the vehicle;
[0011] Obtain the actual size of the vehicle head based on the camera focal length, the distance between the camera and the vehicle head, and the pixel size of the vehicle head;
[0012] Avoid the front of the vehicle based on its actual size.
[0013] In some embodiments of the present disclosure, obtaining the actual size of the vehicle head according to the focal length of the camera, the distance between the camera and the vehicle head, and the pixel size of the vehicle head includes:
[0014] Determining a first ratio according to a ratio of a pixel size of the vehicle head to a focal length of the camera;
[0015] The actual size of the vehicle front is determined according to the product of the distance between the camera and the vehicle front and the first ratio.
[0016] In some embodiments of the present disclosure, acquiring an image of the vehicle to be tested captured by a visible light area array camera includes:
[0017] A single image of the vehicle to be tested or multiple consecutive frames of images of the vehicle to be tested captured by a visible light area array camera is obtained.
[0018] In some embodiments of the present disclosure, acquiring an image of the vehicle to be tested captured by a visible light area array camera includes:
[0019] The visible light area array camera can be used to form an image in one go, which is not affected by the speed of passing vehicles.
[0020] In some embodiments of the present disclosure, processing the image of the vehicle to be tested to obtain the pixel size of the vehicle head includes:
[0021] Pixel segmentation is performed on the visible light image of the vehicle to be tested to determine the positions of various components of the vehicle front, wherein the components include at least one of the vehicle windows, wheels, the rear edge of the driver's seat, the rear end of the vehicle front, and the front end of the vehicle front.
[0022] In some embodiments of the present disclosure, performing vehicle head avoidance according to the actual size of the vehicle head includes:
[0023] Determine the frontal avoidance area;
[0024] Perform vehicle head avoidance according to the vehicle head avoidance area and scan the non-vehicle head avoidance area.
[0025] In some embodiments of the present disclosure, determining the vehicle head avoidance area includes any of the following steps, wherein:
[0026] Set the area from the front of the vehicle to the rear of the vehicle as the vehicle avoidance zone;
[0027] Set the area from the front of the vehicle to the rear edge of the driver's seat as the vehicle front avoidance zone;
[0028] The area from the front of the vehicle to the rear edge of the window is set as the front avoidance area.
[0029] In some embodiments of the present disclosure, processing the image of the vehicle to be tested to obtain the pixel size of the vehicle head includes:
[0030] For a single-frame image, a pixel set of the vehicle front is extracted through pixel segmentation to obtain the pixel size of the vehicle front, wherein the pixel segmentation method includes at least one of a pixel clustering method, a semantic segmentation method, and an instance segmentation method.
[0031] In some embodiments of the present disclosure, processing the image of the vehicle to be tested to obtain the pixel size of the vehicle head includes:
[0032] For multiple frames of continuous images, the pixel segmentation results of each frame are averaged to determine the pixel size of the vehicle head;
[0033] For multiple frames of continuous images, a multi-frame moving target detection method is used to filter out the background of the moving vehicle to be tested in the channel and obtain the pixel set of the vehicle head.
[0034] In some embodiments of the present disclosure, obtaining the focal length of the camera by calibrating the intrinsic and extrinsic parameters of the camera includes:
[0035] Select a reference object parallel to the camera's field of view;
[0036] Measure the vertical distance from the reference object to the camera;
[0037] Measure the actual size of the reference object;
[0038] Obtain the camera's intrinsic calibration parameters and the reference object pixel size of the calibration image through multi-angle checkerboard images;
[0039] The camera focal length is determined based on the vertical distance from the reference object to the camera, the actual size of the reference object, and the pixel size of the reference object in the calibration image.
[0040] In some embodiments of the present disclosure, obtaining the distance between the camera and the vehicle head includes at least one of the following steps, wherein:
[0041] Set a fixed distance as the distance between the camera and the front of the car;
[0042] The distance provided by the ranging sensor is used as the distance between the camera and the front of the vehicle;
[0043] Extracting depth information corresponding to a set of pixels at the front of the vehicle based on a depth image provided by the camera, wherein the depth image includes a three-channel color image and a depth map, and determining the distance between the camera and the front of the vehicle;
[0044] For a single-frame image, the distance between the camera and the vehicle head is determined based on the distance and reference object information provided by the pixel segmentation information;
[0045] For a single frame image, obtain the monocular depth estimation value, obtain the vehicle front depth based on the actual depth of the reference object, and determine the distance between the camera and the vehicle front.
[0046] In some embodiments of the present disclosure, determining the distance between the camera and the vehicle head based on the distance and reference object information provided by the pixel segmentation information includes:
[0047] Setting a first reference point and a second reference point on the ground, and setting the first reference point and the second reference point to correspond to a first reference pixel point and a second reference pixel point in an image captured by the monocular camera;
[0048] Set the test point to correspond to the test pixel point in the image captured by the monocular camera, where the test point is the contact mark point between the ground and the vehicle head;
[0049] Set the vertical projection point of the camera on the ground as the coordinate origin, wherein the distance between the measured point and the coordinate origin is greater than the distance between the first reference point and the coordinate origin, and the distance between the measured point and the coordinate origin is less than the distance between the second reference point and the coordinate origin;
[0050] Determine the distance between the first reference point and the point to be measured based on the distance between the first reference point and the second reference point, the distance between the first reference pixel and the second reference pixel, and the distance between the first reference pixel and the pixel to be measured;
[0051] The distance between the camera and the vehicle head is determined based on the distance between the first reference point and the coordinate origin and the distance between the first reference point and the point to be measured.
[0052] In some embodiments of the present disclosure, determining the distance between the first reference point and the point to be measured based on the distance between the first reference point and the second reference point, the distance between the first reference pixel and the second reference pixel, and the distance between the first reference pixel and the pixel to be measured includes:
[0053] Determining a second ratio according to a distance between the first reference pixel and the pixel to be measured and a ratio between the distance between the first reference pixel and the second reference pixel;
[0054] The distance between the first reference point and the point to be measured is determined according to the product of the distance between the first reference point and the second reference point and the second ratio.
[0055] According to another aspect of the present disclosure, a vehicle head avoidance device is provided, comprising:
[0056] An image acquisition module is configured to acquire an image of the vehicle to be tested captured by a visible light area array camera;
[0057] A focal length acquisition module is configured to obtain the focal length of the camera by calibrating internal and external parameters of the camera;
[0058] A pixel size acquisition module is configured to process the image of the vehicle to be tested and obtain the pixel size of the vehicle head;
[0059] A distance acquisition module is configured to acquire the distance between the camera and the front of the vehicle;
[0060] The actual size acquisition module is configured to acquire the actual size of the vehicle head according to the focal length of the camera, the distance between the camera and the vehicle head, and the pixel size of the vehicle head;
[0061] The vehicle front avoidance module is configured to perform vehicle front avoidance according to the actual size of the vehicle front.
[0062] According to another aspect of the present disclosure, a vehicle head avoidance device is provided, comprising:
[0063] a memory for storing instructions;
[0064] The processor is configured to execute the instructions so that the vehicle head avoidance device implements the vehicle head avoidance method as described in any of the above embodiments.
[0065] According to another aspect of the present disclosure, a vehicle head-on avoidance system is provided, comprising:
[0066] A visible light area array camera is configured to capture images of a vehicle to be tested;
[0067] The vehicle head avoidance device is the vehicle head avoidance device as described in any of the above embodiments.
[0068] According to another aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the vehicle head avoidance method as described in any of the above embodiments is implemented.
[0069] According to another aspect of the present disclosure, there is provided a computer program comprising:
[0070] Instructions, when executed by a processor, cause the processor to execute the vehicle head avoidance method as described in any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0072] FIG1 is a schematic diagram of a vehicle head avoidance method based on an image acquisition sequence.
[0073] FIG. 2 is a schematic diagram of some embodiments of the vehicle head avoidance system disclosed herein.
[0074] FIG3 is a schematic diagram of some embodiments of the vehicle head avoidance method and system disclosed herein.
[0075] FIG4 is a schematic diagram comparing an area array camera and a line array image acquisition device in some embodiments of the present disclosure.
[0076] FIG5 is a schematic diagram of some embodiments of the vehicle front avoidance method disclosed herein.
[0077] FIG6 is a schematic diagram showing a related art image in which a vehicle front and wheels are compressed.
[0078] FIG7 is a schematic diagram showing the basic principle of the vehicle head avoidance link in some embodiments of the present disclosure.
[0079] FIG8 is a schematic diagram of some embodiments of the method for acquiring camera focal length disclosed herein.
[0080] Figure 9 is a schematic diagram of the head length segmentation defect in binary and grayscale images.
[0081] FIG10 is a schematic diagram of some embodiments of pixel segmentation and distortion correction of an image according to the present disclosure.
[0082] FIG11 is a schematic diagram of some embodiments of the method for obtaining the pixel size of the vehicle head disclosed herein.
[0083] FIG12 is a schematic diagram of a method for averaging multiple frames of images in some embodiments of the present disclosure.
[0084] FIG13 is a schematic diagram of a method for obtaining the distance from a camera to a moving object according to the present disclosure.
[0085] FIG14 is a schematic diagram of a method for measuring the distance between a camera and a moving object using a ground reference line in some embodiments of the present disclosure.
[0086] FIG15 is a schematic diagram of a similar triangle formula for calculating the vehicle head length in some embodiments of the present disclosure.
[0087] FIG16 is a schematic diagram of some embodiments of the vehicle front avoidance device disclosed herein.
[0088] FIG17 is a schematic structural diagram of other embodiments of the vehicle head avoidance device disclosed herein. DETAILED DESCRIPTION
[0089] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is in no way intended to limit the present disclosure and its application or use. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0090] Unless specifically stated otherwise, the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0091] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0092] Technologies, methods and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, such technologies, methods and equipment should be considered part of the authorization specification.
[0093] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0094] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0095] Figure 1 is a schematic diagram of a vehicle head-on avoidance method based on an image acquisition sequence. As shown in Figure 1, the related art uses a linear image acquisition device to capture a linear sequence of images of a vehicle passing through the system. The position of the vehicle head is determined based on the vehicle body information in the image, and the vehicle head and cabin are then separated. Based on this, a safety inspection of the cabin can be performed.
[0096] The inventors have found through research that the related art installation of multiple sets of light curtains or area laser sensors in the scanning channel occupies a large area and has high construction costs.
[0097] The inventors have also found through research that the acquisition device method of the related art also has the following problems:
[0098] 1. Installing multiple sets of light curtains or area laser sensors in the scanning channel takes up a large area and has high construction costs.
[0099] 2. Linear array camera images are greatly affected by ambient light and are also more expensive.
[0100] 3. The accuracy of calculating the vehicle head length in the three image acquisition methods of linear array camera, area laser and infrared light curtain is affected by the speed of the scanned vehicle.
[0101] 4. The various structures of the locomotive and carriages affect the algorithm's ability to recognize the vehicle, and require high debugging and maintenance costs.
[0102] 5. The images of the regional laser and infrared light curtain show that there is no gap between the front of the vehicle and the cabin. There are cabin air conditioners and obstructions at the top of the front of the vehicle, which cannot be identified.
[0103] 6. Various special vehicle types that need to be scanned, such as engineering vehicles, sedans, buses, etc., cannot be clearly distinguished.
[0104] In response to at least one of the above technical issues, the present disclosure provides a vehicle head-on avoidance method, device, and system, as well as a computer-readable storage medium. These methods utilize a visible light area array camera, replacing a linear array image acquisition device, thereby reducing usage and installation costs and footprint. The present disclosure is illustrated below through examples.
[0105] FIG2 is a schematic diagram of some embodiments of the vehicle head avoidance system disclosed herein. As shown in FIG2 , the vehicle head avoidance system may include a visible light array camera 1 and a vehicle head avoidance device 2 , wherein:
[0106] The visible light area array camera 1 is configured to capture images of the vehicle to be tested.
[0107] The vehicle front avoidance device 2 is configured to obtain an image of the vehicle to be tested captured by a visible light area array camera; obtain the camera focal length by calibrating internal and external parameters of the camera; process the image of the vehicle to be tested to obtain the pixel size of the vehicle front; obtain the distance between the camera and the vehicle front; obtain the actual size of the vehicle front based on the camera focal length, the distance between the camera and the vehicle front, and the pixel size of the vehicle front; and perform vehicle front avoidance based on the actual size of the vehicle front.
[0108] The present invention adopts a visible light area array camera to replace the linear array image acquisition equipment, which reduces the use and installation costs and reduces the floor space.
[0109] Figure 3 is a schematic diagram of some embodiments of the disclosed vehicle head-on avoidance method and system. As shown in Figure 3, a vehicle under test, consisting of a front and a carriage, passes through a vehicle access gate. A visible light area array camera is positioned before the X-ray scanning device and is configured to capture an area array image of the vehicle under test. The present disclosure utilizes the visible light area array camera to collect data for vehicle head-on avoidance.
[0110] Figure 4 is a schematic diagram comparing area array cameras and linear array image acquisition devices in some embodiments of the present disclosure. The present disclosure uses visible light area array cameras to replace linear array image acquisition devices (such as line array cameras, area lasers, infrared light curtains, etc.) to collect data, reducing usage and installation costs.
[0111] As shown in Figure 4, the linear array image acquisition equipment is installed with multiple sets of light curtains and area laser sensors, which occupies a large area and has high civil engineering costs. It is limited to low-cost and site-limited application scenarios.
[0112] Linear scan cameras used in linear image acquisition devices are significantly affected by ambient light and require high-quality fill lights. Imaging results are prone to overexposure (too bright) or underexposure (too dark), resulting in poor quality. They are also expensive.
[0113] As shown in Figure 4, the visible light area array camera disclosed in this disclosure uses a standard fixed-focus camera, which has lower fill light requirements and is less affected by lighting than a line array camera. It offers excellent image quality and lowers costs. For scenes with limited space, a wide-angle camera can be used, making the overall system installation more compact and reducing additional costs.
[0114] The vehicle head avoidance method and device disclosed herein are further described below through specific embodiments.
[0115] FIG5 is a schematic diagram of some embodiments of the vehicle head-on avoidance method disclosed herein. The embodiment of FIG5 can be performed by the vehicle head-on avoidance device disclosed herein or the vehicle head-on avoidance system disclosed herein. As shown in FIG5 , the method of the embodiment of FIG5 can include at least one of steps 100 to 600, wherein:
[0116] Step 100: Acquire an image of the vehicle to be tested captured by a visible light area array camera.
[0117] In some embodiments of the present disclosure, step 100 may include: receiving an image of the vehicle to be tested captured by a visible light area array camera.
[0118] In some embodiments of the present disclosure, step 100 may include: acquiring a single image of the vehicle to be tested or multiple consecutive frames of images of the vehicle to be tested captured by the visible light area array camera 1 .
[0119] In some embodiments of the present disclosure, step 100 may include: using a visible light area array camera, which can form an image in one go and is not affected by the speed of passing vehicles.
[0120] Through research, the inventors discovered that the image acquisition method of the linear array image acquisition equipment of the related art is affected by the speed of the scanned vehicle; if the speed is too fast, the image is stretched; if the speed is too slow, the image is compressed. Figure 6 is a schematic diagram of the compression of the vehicle head and wheels in the related art image. As shown in Figure 6, a device for measuring vehicle speed is required to provide correction parameters to maintain the imaging ratio unchanged. On this basis, the characteristic information of the vehicle head and the car body is extracted through an algorithm, the pixel set of the vehicle head is distinguished, and then the length of the vehicle head is calculated. This shows that the speed accuracy of the speed measurement device of the related art affects the measurement of the vehicle head length.
[0121] Figure 7 is a schematic diagram of the basic principle of the vehicle head avoidance link in some embodiments of the present disclosure. As shown in Figure 7, to prevent the beam from scanning the driver, the timing starts when the vehicle head reaches the beam output position point O, and a delay time Td is required to trigger.
[0122] Assuming the vehicle speed remains constant, the beam delay time is equal to the vehicle head length divided by the vehicle speed. The beam delay time Td, the vehicle head length Lh, and the vehicle speed V.
[0123] This requires that the acquisition equipment be located close to the beam exit point O; further distance increases vehicle speed variation. Using a single set of speed measuring devices could result in a discrepancy between the final beam exit delay time Td and the actual required beam exit delay time Tdr, posing a potential safety hazard and necessitating the addition of additional speed measuring devices.
[0124] If the application scenario requires scanning from the rear edge of the driver's seat to the rear of the vehicle, the position Lw needs to be calculated from the rear edge of the window. This is difficult to guarantee with related technologies such as area lasers and infrared light curtains.
[0125] The disclosed method utilizes a visible light area array camera, enabling single-shot imaging regardless of the speed of passing vehicles. This reduces installation requirements for the speed measurement device, allowing it to be positioned as needed. The camera can also be installed without requiring close proximity to the beam output point. Image processing time is also relatively ample.
[0126] This area array camera uses a single, standard fixed-focus area array camera to measure vehicle head length. This allows for flexible selection based on the application scenario.
[0127] The area array camera capture method disclosed herein uses a sensor to detect when a vehicle's front end passes through a channel, providing a trigger signal. The image of the vehicle's front end corresponding to the triggering time in the video stream is captured and processed. The captured image can be a single frame or a continuous series of frames.
[0128] The area array camera disclosed in the present invention can also acquire images by controlling the trigger signal through a moving target detection algorithm.
[0129] Step 200: Obtain the focal length of the camera by calibrating the internal and external parameters of the camera.
[0130] In some embodiments of the present disclosure, step 200 may include: calibrating internal and external parameters of the camera, and obtaining the focal length F through a formula calculation with the help of a reference object.
[0131] FIG8 is a schematic diagram of some embodiments of the camera focal length acquisition method disclosed herein. As shown in FIG8 , the camera focal length acquisition method disclosed herein (e.g., step 200 of the embodiment of FIG5 ) may include at least one of steps 210 and 250, wherein:
[0132] Step 210: Select a reference object parallel to the camera's field of view.
[0133] Step 220 : Measure the vertical distance D0 from the reference object to the camera.
[0134] Step 230 : measuring the actual size Lr0 of the reference object.
[0135] In some embodiments of the present disclosure, step 230 may include: calibrating the actual size Lr0 of the reference object using an external reference object.
[0136] Step 240 : Obtain the camera's internal calibration parameters through the multi-angle checkerboard image, and obtain the reference object pixel size Lp0 of the calibration image.
[0137] Step 250 : Determine the focal length F of the camera based on the vertical distance D0 from the reference object to the camera, the actual size Lp0 of the reference object, and the pixel size Lp0 of the reference object in the corrected image.
[0138] In some embodiments of the present disclosure, step 230 may include: determining the camera focal length F according to formula (1).
[0139] Step 300: Process the image of the vehicle to be tested to obtain the pixel size of the vehicle front.
[0140] In some embodiments of the present disclosure, step 300 may include: obtaining a pixel set of the vehicle head through a pixel segmentation algorithm, and obtaining a pixel size of the vehicle head after correction through internal and external parameter correction of a camera.
[0141] In some embodiments of the present disclosure, step 300 may include: extracting a pixel set of a moving object from an image through a pixel segmentation method, and obtaining a pixel size Lp of the moving object through distortion correction.
[0142] The inventors have found through research that the original data collected by the regional laser and infrared light curtain in the related technology needs to be converted to generate grayscale or binary images, and lacks RGB color information.
[0143] The visible light image acquired by the visible light area array camera in the above-mentioned embodiment of the present disclosure has the advantage of RGB information.
[0144] Through research, the inventors discovered that in related technologies, differences between vehicle head and cabin structures of various types, as well as information about differences between different parts of the image when there is no gap between the vehicle head and cabin, or when there is air conditioning or obstructions above the vehicle head, can largely be lost. These factors can affect the line-scribing results of the vehicle head position, leading to avoidance failures. This is shown in Figure 9. Figure 9 is a schematic diagram of the defects in vehicle head length segmentation using binary and grayscale images. This shows that for some scanning requirements, binary images cannot accurately determine the scanning location, such as the rear edge of the driver's seat or the window position, which cannot be penetrated or distinguished due to obstructions.
[0145] In some embodiments of the present disclosure, step 300 may include performing pixel segmentation on the visible light image of the vehicle to be tested to determine the location of vehicle front components, where the components include at least one of a window, a wheel, a rear edge of the driver's seat, a rear end of the vehicle, and a front end of the vehicle. Thus, the above embodiments of the present disclosure can accurately determine the location of various vehicle front components.
[0146] Figure 10 is a schematic diagram of some embodiments of pixel segmentation and distortion correction for images disclosed herein. As shown in Figure 10, pixel segmentation of visible light can clearly distinguish the various components of the vehicle's front end, focusing on the entire front end, windows, and wheel locations. Precise segmentation allows for specific scanning locations. This allows for scanning the interior of the vehicle, from the rear edge of the driver's seat to the rear of the vehicle. This improves the accuracy of vehicle front length processing.
[0147] Figure 11 is a schematic diagram of some embodiments of the disclosed method for obtaining the pixel size of a vehicle head. The pixel size of the vehicle head is a significant factor affecting the accuracy of length calculation. As shown in Figure 11 , the disclosed method can obtain a set of vehicle head pixels through pixel segmentation (including pixel clustering, semantic segmentation, instance segmentation, etc.) and a method based on multi-frame moving target tracking, thereby extracting the pixel size of the vehicle head.
[0148] In some embodiments of the present disclosure, as shown in FIG11 , the method for obtaining the pixel size of the vehicle head of the present disclosure (e.g., step 300 of the embodiment of FIG5 ) may include at least one of steps 310 and 330, wherein:
[0149] Step 310 : For a single frame image, extract a pixel set of the front of the vehicle by pixel segmentation to obtain the pixel size of the front of the vehicle, wherein the pixel segmentation method includes at least one of a pixel clustering method, a semantic segmentation method, and an instance segmentation method.
[0150] In some embodiments of the present disclosure, step 310 may include extracting a pixel set of the moving object of interest from a single frame image using a pixel segmentation algorithm to obtain the pixel size of the moving object. However, due to the influence of the shooting angle, the front and back of the vehicle's front, which are in different positions at the time of image capture, may also be included, resulting in poor accuracy in calculating the vehicle's front length.
[0151] Step 320: For the video stream, obtain multiple frames of continuous images; for the multiple frames of continuous images, obtain the average of the pixel segmentation results of each frame to determine the pixel size of the vehicle head.
[0152] In the above-described embodiments of the present disclosure, for multiple consecutive frames of images, by taking the average of the pixel segmentation results for each frame, the effects of perspective shifts can be eliminated, resulting in a more accurate pixel size compared to a single frame. This is shown in Figure 12. Figure 12 is a schematic diagram of the method for taking the average of multiple frames of images in some embodiments of the present disclosure.
[0153] Step 330: For the video stream, multiple frames of continuous images are obtained; for the multiple frames of continuous images, a multi-frame moving target detection method is used to filter out the background of the moving vehicle to be detected in the channel and obtain a pixel set of the vehicle head.
[0154] In the above embodiment of the present disclosure, for multi-frame moving target detection, the background is screened out for the moving object in the channel, and a more accurate overall pixel set of the moving object can be obtained; combined with the aforementioned method (the method of averaging multi-frame images), some background effects can be screened out and a more accurate pixel size can be obtained.
[0155] Step 400: Obtain the distance between the camera and the front of the vehicle.
[0156] In some embodiments of the present disclosure, step 400 may include: obtaining a distance D between the camera and a moving object through hardware or an algorithm, wherein the moving object is the front of a vehicle.
[0157] In some embodiments of the present disclosure, the distance between the vehicle head and the camera is a significant factor affecting the accuracy of length calculation. Distance calculation accuracy is correlated with the accuracy of the vehicle head pixel segmentation, and the final vehicle head length calculation accuracy is most closely related to the accuracy of the vehicle head pixel segmentation.
[0158] In some embodiments of the present disclosure, the distance between the front of the vehicle and the camera can be obtained by setting a fixed distance, providing the distance with a ranging sensor, providing the distance with an RGB-D image containing the camera's own depth information combined with pixel segmentation information, monocular depth estimation, reference object calculation, etc., wherein the RGB-D image is a depth image, and the depth image includes a three-channel color image and a depth map.
[0159] The above embodiments of the present disclosure can adopt any of a variety of methods to determine the distance between the camera and the front of the vehicle according to different needs and working conditions.
[0160] FIG13 is a schematic diagram of a method for obtaining the distance from a camera to a moving object according to the present disclosure. In the present disclosure, the moving object may be a vehicle to be measured, including a front end. As shown in FIG13 , the method for obtaining the distance from a camera to the front end of the vehicle according to the present disclosure (e.g., step 400 in the embodiment of FIG5 ) may include at least one of steps 410 and 450, wherein:
[0161] Step 410 , setting a fixed distance as the distance between the camera and the front of the vehicle.
[0162] For large trucks or buses with a large width, the limited left and right deviations in the fixed lane limit the distance they can travel. Therefore, the distance from the camera to the object can be set to a fixed value based on experience. However, for smaller vans or buses with a narrower width, or when the fixed lane is wider, the left and right deviations are greater, resulting in significant errors in the calculated vehicle length. Therefore, the method used should be tailored to the specific situation.
[0163] In step 420 , the distance provided by the ranging sensor is used as the distance between the camera and the front of the vehicle.
[0164] Using a ranging sensor device to measure the distance between the camera and the object offers the highest accuracy. However, this approach cannot be used in some scenarios due to installation limitations and cost constraints.
[0165] Step 430 : extract the depth information corresponding to the pixel set at the front of the vehicle based on the depth image containing depth information provided by the camera, and determine the distance between the camera and the front of the vehicle.
[0166] The RGB-D camera disclosed in this publication, which includes built-in depth information, can also provide high accuracy. However, its resolution and field of view are limited, and its cost is relatively high. It can be used based on specific scenario requirements.
[0167] Step 440 : For a single frame image, determine the distance between the camera and the vehicle head based on the distance and reference object information provided by the pixel segmentation information.
[0168] In some embodiments of the present disclosure, step 440 may include at least one of step 441 and step 445, wherein:
[0169] Step 441 : Setting a first reference point and a second reference point on the ground, wherein the first reference point and the second reference point are set to correspond to a first reference pixel point and a second reference pixel point in an image captured by a monocular camera.
[0170] Step 442 : Set the point to be measured to correspond to the pixel point to be measured in the image captured by the monocular camera, wherein the point to be measured is the contact mark point between the ground and the vehicle head.
[0171] Step 443, setting the vertical projection point of the camera on the ground as the coordinate origin, wherein the distance between the measured point and the coordinate origin is greater than the distance between the first reference point and the coordinate origin, and the distance between the measured point and the coordinate origin is less than the distance between the second reference point and the coordinate origin.
[0172] Step 444 : Determine the distance between the first reference point and the point to be measured based on the distance between the first reference point and the second reference point, the distance between the first reference pixel and the second reference pixel, and the distance between the first reference pixel and the point to be measured.
[0173] In some embodiments of the present disclosure, step 444 may include: determining a second ratio based on the distance between the first reference pixel point and the pixel point to be measured, and the ratio of the distance between the first reference pixel point and the second reference pixel point; determining the distance between the first reference point and the point to be measured based on the product of the distance between the first reference point and the second reference point and the second ratio.
[0174] Step 445 , determining the distance between the camera and the vehicle head according to the distance between the first reference point and the coordinate origin and the distance between the first reference point and the point to be measured.
[0175] In some embodiments of the present disclosure, step 445 may include determining the distance between the camera and the front of the vehicle according to the sum of the distance between the first reference point and the coordinate origin and the distance between the first reference point and the point to be measured.
[0176] FIG14 is a schematic diagram of a method for measuring the distance between a camera and a moving object using a ground reference line in some embodiments of the present disclosure. As shown in FIG14 , the distance from the camera to the moving object is obtained by means of a ground reference line and a contact point. The reference points P1 and P2 set between the monocular camera and the ground correspond to the reference points pixel (P1) and pixel (P2) of the captured image, and the contact mark point D between the ground and the moving object corresponds to the reference point pixel (D) of the captured image, which is used to calculate the distance OD, which is specifically determined by formulas (2) and (3). Then, the distance from the camera to the moving object is indirectly calculated. The application scenario of this method is limited to the case where the relative position of the known mark point D and the surface of the moving object is fixed. OD=OP1+P1D (2)
[0177] In some embodiments of the present disclosure, the relative distance between the side of the door of the front of the vehicle and the wheel is fixed and basically remains on the same plane. The wheel surface can represent the side of the front of the vehicle, that is, the distance between the wheel surface and the camera is equivalent to the distance from the front of the vehicle to the camera. This method only requires a fixed reference for ground calibration. When the camera is not moved or replaced, the disappearance of the ground calibration reference has no effect, and no secondary calibration is required. The parameters are fixed. The accuracy of distance calculation is related to the accuracy of wheel pixel segmentation, and the final accuracy of vehicle head length calculation is most correlated with the accuracy of vehicle head pixel segmentation.
[0178] Step 450 : For a single frame image, obtain a monocular depth estimation value, obtain the depth of the vehicle head according to the actual depth of the reference object, and determine the distance between the camera and the vehicle head.
[0179] Step 500 , obtaining the actual size of the vehicle front according to the focal length of the camera, the distance between the camera and the vehicle front, and the pixel size of the vehicle front.
[0180] In some embodiments of the present disclosure, step 500 may include: determining a first ratio based on a ratio of a pixel size of the vehicle head to a focal length of a camera; and determining an actual size of the vehicle head based on a product of a distance between the camera and the vehicle head and the first ratio.
[0181] In some embodiments of the present disclosure, step 500 may include: calculating and obtaining the actual size Lr of the moving object according to the principle of similar triangles.
[0182] FIG15 is a schematic diagram of a similar triangle formula for calculating vehicle head length in some embodiments of the present disclosure. As shown in FIG15 , step 500 of the embodiment of FIG5 may include: Formula (4) shows that the ratio of Lp (the pixel length of the vehicle head in the camera image) to F (the camera parameter focal length) is equal to the ratio of Lr (the actual length of the vehicle head) to D (the distance between the camera and the vehicle head). After obtaining D and F, Lr can be calculated accordingly based on Lp for different vehicle heads.
[0183] Step 600: Perform vehicle front avoidance according to the actual size of the vehicle front.
[0184] In some embodiments of the present disclosure, step 600 may include at least one of step 610 and step 620, wherein:
[0185] Step 610: Determine the vehicle head avoidance area.
[0186] In some embodiments of the present disclosure, determining the vehicle head avoidance area includes any one of steps 611 to 613, wherein:
[0187] Step 611 , setting the area from the front of the vehicle to the rear of the vehicle, such as Lh in the embodiment of FIG. 7 , as a vehicle avoidance area.
[0188] Step 612: Set the area from the front of the vehicle to the rear edge of the driver's seat as the vehicle front avoidance area.
[0189] Step 613 , setting the area from the front of the vehicle to the rear edge of the vehicle window, such as Lw in the embodiment of FIG. 7 , as a vehicle front avoidance area.
[0190] The above embodiments of the present disclosure can set different vehicle front avoidance areas based on different needs and according to the precise positions of various vehicle front components (the rear edge of the driver's seat, the rear edge of the window, the head of the vehicle, and the rear of the vehicle).
[0191] Step 620: Perform vehicle head avoidance according to the vehicle head avoidance area and scan the non-vehicle head avoidance area.
[0192] The errors in measuring vehicle head length using related technology area lasers, infrared light curtains, and linear array cameras include: errors in the speed measuring device (random errors); errors in the image feature extraction algorithm (random errors); and the impact of the resolution of binary or grayscale images.
[0193] The errors in measuring vehicle head length using the area array camera disclosed herein include: the error of the image pixel segmentation algorithm (random error); the error of the camera's intrinsic parameter correction (systematic error); the error of the extrinsic parameter correction (systematic error); the error of ranging (classified as the error of the segmentation algorithm by the method in Figure 14); the error of ranging (random error due to the ranging device or RGBD method); and the influence of pixel resolution.
[0194] The system error of the present disclosure can be compensated and reduced through correction; the random error can be reduced by averaging multiple measurements.
[0195] The error of the speed measurement device in the related technology is a random error. Because the speed measurement is provided in real time and the corresponding pixel column number image is obtained, it is impossible to measure multiple times to calculate the average; the generated binary or grayscale image is also an image generated once and cannot be collected repeatedly; the impact of random errors is relatively large.
[0196] The disclosed image can be collected multiple times and averaged to reduce random errors. When measuring distance, if the vehicle body is long, multiple measurements can be performed and averaged to reduce random errors. The impact of random errors is smaller than that of existing methods.
[0197] The feature extraction algorithm of the related art is affected by the lack of image RGB information and information of different structures, which will affect the algorithm accuracy; the pixel segmentation algorithm disclosed in the present invention can better distinguish information of different structures and has better algorithm accuracy.
[0198] The related art and the method disclosed herein have similar resolutions for the processed input images, and their impact on resolution is basically similar.
[0199] In the related art and the disclosed method, after the vehicle head length is measured, the subsequent vehicle head avoidance link is related to the speed measuring device. The factors affecting the avoidance effect are the same and will not be discussed here.
[0200] In comparison, the method disclosed herein has an advantage in measuring the length of the vehicle head. The method disclosed herein using visible light array images has an advantage in measuring the length of the vehicle head.
[0201] FIG16 is a schematic diagram of some embodiments of the vehicle head avoidance device disclosed herein. As shown in FIG16 , the vehicle head avoidance device disclosed herein (e.g., the vehicle head avoidance device 2 of the embodiment of FIG2 ) may include an image acquisition module 21, a focal length acquisition module 22, a pixel size acquisition module 23, a distance acquisition module 24, an actual size acquisition module 25, and a vehicle head avoidance module 26, wherein:
[0202] The image acquisition module 21 is configured to acquire the image of the vehicle to be tested captured by the visible light area array camera 1 .
[0203] In some embodiments of the present disclosure, the image acquisition module 21 may be configured to acquire a single image of the vehicle to be tested or multiple consecutive frames of images of the vehicle to be tested captured by a visible light area array camera.
[0204] In some embodiments of the present disclosure, the image acquisition module 21 may be configured to form an image in one go using a visible light area array camera, without being affected by the speed of a passing vehicle.
[0205] The focal length acquisition module 22 is configured to obtain the focal length of the camera by calibrating the internal and external parameters of the camera.
[0206] In some embodiments of the present disclosure, the focal length acquisition module 22 can be configured to select a reference object parallel to the camera's field of view; measure the vertical distance from the reference object to the camera; measure the actual size of the reference object; obtain the camera's intrinsic reference correction parameters through multi-angle checkerboard images, and obtain the reference object pixel size of the corrected image; determine the camera focal length based on the vertical distance from the reference object to the camera, the actual size of the reference object, and the reference object pixel size of the corrected image.
[0207] The pixel size acquisition module 23 is configured to process the image of the vehicle to be tested and obtain the pixel size of the vehicle head.
[0208] In some embodiments of the present disclosure, the pixel size acquisition module 23 can be configured to perform pixel segmentation on the visible light image of the vehicle to be tested to determine the positions of various components of the front of the vehicle, wherein the components include at least one of the windows, wheels, the rear edge of the driver's seat, the tail of the front of the vehicle, and the head of the front of the vehicle.
[0209] In some embodiments of the present disclosure, the pixel size acquisition module 23 can be configured to extract a pixel set of the front of the vehicle for a single frame image through a pixel segmentation method to obtain the pixel size of the front of the vehicle, wherein the pixel segmentation method includes at least one of a pixel clustering method, a semantic segmentation method, and an instance segmentation method.
[0210] In some embodiments of the present disclosure, the pixel size acquisition module 23 can be configured to obtain the average of the pixel segmentation results of each frame for multiple frames of continuous images, and determine the pixel size of the front of the vehicle; for multiple frames of continuous images, a multi-frame moving target detection method is used to filter out the background of the moving vehicle to be tested in the channel and obtain the pixel set of the front of the vehicle.
[0211] The distance acquisition module 24 is configured to acquire the distance between the camera and the front of the vehicle.
[0212] In some embodiments of the present disclosure, the distance acquisition module 24 is configured to perform at least one of the following operations when obtaining the distance between the camera and the front of the vehicle, wherein: a fixed distance is set as the distance between the camera and the front of the vehicle; the distance provided by the ranging sensor is used as the distance between the camera and the front of the vehicle; the depth information corresponding to the set of pixels of the front of the vehicle is extracted based on the depth image containing depth information provided by the camera to determine the distance between the camera and the front of the vehicle, wherein the depth image includes a three-channel color image and a depth map; for a single-frame image, the distance between the camera and the front of the vehicle is determined based on the distance and reference object information provided by the pixel segmentation information; for a single-frame image, a monocular depth estimation value is obtained, the depth of the front of the vehicle is obtained based on the actual depth of the reference object to determine the distance between the camera and the front of the vehicle.
[0213] In some embodiments of the present disclosure, the distance acquisition module 24 is configured to set a first reference point and a second reference point on the ground, when determining the distance between the camera and the front of the vehicle based on the distance provided by the pixel segmentation information and the reference object information, and set the first reference point and the second reference point to correspond to the first reference pixel point and the second reference pixel point in the image captured by the monocular camera; set the point to be measured to correspond to the pixel point to be measured in the image captured by the monocular camera, wherein the point to be measured is the contact mark point between the ground and the front of the vehicle; set the vertical projection point of the camera on the ground as the coordinate origin, wherein the distance between the point to be measured and the coordinate origin is greater than the distance between the first reference point and the coordinate origin, and the distance between the point to be measured and the coordinate origin is less than the distance between the second reference point and the coordinate origin; determine the distance between the first reference point and the point to be measured based on the distance between the first reference point and the second reference point, the distance between the first reference pixel point and the second reference pixel point, and the distance between the first reference pixel point and the pixel point to be measured; determine the distance between the camera and the front of the vehicle based on the distance between the first reference point and the coordinate origin and the distance between the first reference point and the point to be measured.
[0214] In some embodiments of the present disclosure, the distance acquisition module 24 is configured to determine the distance between the first reference point and the point to be measured based on the distance between the first reference point and the second reference point, the distance between the first reference pixel point and the second reference pixel point, and the distance between the first reference pixel point and the pixel point to be measured, and determine the second ratio based on the distance between the first reference pixel point and the pixel point to be measured and the ratio of the distance between the first reference pixel point and the second reference pixel point; determine the distance between the first reference point and the point to be measured based on the product of the distance between the first reference point and the second reference point and the second ratio.
[0215] The actual size acquisition module 25 is configured to acquire the actual size of the vehicle head according to the focal length of the camera, the distance between the camera and the vehicle head, and the pixel size of the vehicle head.
[0216] In some embodiments of the present disclosure, the actual size acquisition module 25 can be configured to determine a first ratio based on the ratio of the pixel size of the vehicle head to the focal length of the camera; and determine the actual size of the vehicle head based on the product of the distance between the camera and the vehicle head and the first ratio.
[0217] The vehicle front avoidance module 26 is configured to perform vehicle front avoidance according to the actual size of the vehicle front.
[0218] In some embodiments of the present disclosure, the vehicle head avoidance module 26 is configured to determine a vehicle head avoidance area; perform vehicle head avoidance according to the vehicle head avoidance area, and scan a non-vehicle head avoidance area.
[0219] In some embodiments of the present disclosure, the front avoidance module 26 is configured to perform any of the following operations when the front avoidance area is determined, wherein: the area from the front of the vehicle to the rear of the vehicle is set as the front avoidance area; the area from the front of the vehicle to the rear edge of the driver's seat is set as the front avoidance area; the area from the front of the vehicle to the rear edge of the window is set as the front avoidance area.
[0220] In some embodiments of the present disclosure, the vehicle head avoidance device of the present disclosure may be configured to execute the vehicle head avoidance method as described in any of the above embodiments (e.g., any of the embodiments in FIG. 3 to FIG. 15 ).
[0221] The above-mentioned embodiments of the present disclosure use visible light area array cameras to collect data for vehicle head-on avoidance. A pixel segmentation algorithm is used to obtain a set of vehicle head pixels. After calibration using the camera's internal and external parameters, the pixel size of the calibrated image is obtained. Based on the principle of similar triangles, the actual size of the moving object is determined.
[0222] FIG17 is a schematic diagram of the structure of another embodiment of the vehicle head avoidance device disclosed in the present invention. As shown in FIG17 , the vehicle head avoidance device disclosed in the present invention (such as the vehicle head avoidance device 2 of the embodiment of FIG2 ) includes a memory 71 and a processor 72 .
[0223] The memory 71 is used to store instructions, the processor 72 is coupled to the memory 71, and the processor 72 is configured to execute the vehicle head avoidance method involved in the above embodiment (such as any embodiment of Figures 3 to 15) based on the instructions stored in the memory.
[0224] As shown in FIG17 , the vehicle head avoidance device further includes a communication interface 73 for exchanging information with other devices. Furthermore, the vehicle head avoidance device further includes a bus 74 through which the processor 72 , the communication interface 73 , and the memory 71 communicate with each other.
[0225] Memory 71 may include high-speed RAM memory or non-volatile memory, such as at least one disk storage device. Memory 71 may also be a memory array. Memory 71 may also be divided into blocks, and the blocks may be combined into virtual volumes according to certain rules.
[0226] Furthermore, the processor 72 may be a central processing unit (CPU), or may be an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the present disclosure.
[0227] According to another aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the vehicle head avoidance method as described in any of the above embodiments (for example, any of the embodiments in Figures 3 to 15) is implemented.
[0228] The computer-readable storage medium of the present disclosure may be implemented as a non-transitory computer-readable storage medium.
[0229] Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as methods, apparatus, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0230] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram and the combination of the processes and / or boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0231] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0232] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0233] The vehicle head avoidance device, image acquisition module, focal length acquisition module, pixel size acquisition module, distance acquisition module, actual size acquisition module and vehicle head avoidance module described above can be implemented as a general-purpose processor, programmable logic controller (PLC), digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component or any appropriate combination thereof for performing the functions described in the present disclosure.
[0234] Those skilled in the art will appreciate that all or part of the steps of the above-described embodiment methods of the present disclosure may be accomplished by hardware, and the hardware may be implemented as a general-purpose processor, a programmable logic controller, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or any appropriate combination thereof for executing the methods described in the present disclosure.
[0235] The present disclosure has been described in detail so far. To avoid obscuring the concept of the present disclosure, some details known in the art have not been described. Based on the above description, those skilled in the art can fully understand how to implement the technical solutions disclosed herein.
[0236] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing the relevant hardware through a program, and the program may be stored in a non-transitory computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0237] The description of the present disclosure is provided for purposes of illustration and description and is not intended to be exhaustive or to limit the disclosure to the disclosed form. Many modifications and variations will be apparent to those skilled in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present disclosure and to enable those skilled in the art to understand the present disclosure and design various embodiments with various modifications suitable for specific applications.
Claims
1. A method for avoiding the front of a vehicle, comprising: Obtaining an image of a vehicle to be measured collected by a visible light area array camera; Obtaining the camera focal length through calibration of the internal and external parameters of the camera; Processing the image of the vehicle to be measured to obtain the pixel size of the front of the vehicle; Obtaining the distance between the camera and the front of the vehicle; Obtaining the actual size of the front of the vehicle according to the camera focal length, the distance between the camera and the front of the vehicle, and the pixel size of the front of the vehicle; Performing front-of-vehicle avoidance according to the actual size of the front of the vehicle.
2. The front-end avoidance method according to claim 1, wherein The obtaining the actual size of the front of the vehicle according to the camera focal length, the distance between the camera and the front of the vehicle, and the pixel size of the front of the vehicle includes: Determining a first ratio according to the ratio of the pixel size of the front of the vehicle to the camera focal length; Determining the actual size of the front of the vehicle according to the product of the distance between the camera and the front of the vehicle and the first ratio.
3. The front-end avoidance method according to claim 1 or 2, wherein, The obtaining the image of the vehicle to be measured collected by the visible light area array camera includes: Obtaining a single image of the vehicle to be measured or multiple consecutive frames of images of the vehicle to be measured collected by the visible light area array camera.
4. The front-end avoidance method according to any one of claims 1 to 3, wherein, The obtaining the image of the vehicle to be measured collected by the visible light area array camera includes: Performing single-shot imaging through the visible light area array camera, which is not affected by the speed of passing vehicles.
5. The front-end avoidance method according to any one of claims 1 to 4, wherein The processing the image of the vehicle to be measured to obtain the pixel size of the front of the vehicle includes: Performing pixel segmentation on the visible light image of the vehicle to be measured to determine the positions of the various components of the front of the vehicle, where the components include at least one of a window, a wheel, the rear edge of the driver's seat, the rear of the front of the vehicle, and the front of the front of the vehicle.
6. The headstock avoidance method according to claim 5, wherein, The performing front-of-vehicle avoidance according to the actual size of the front of the vehicle includes: Determining a front-of-vehicle avoidance area; Performing front-of-vehicle avoidance according to the front-of-vehicle avoidance area and scanning non-front-of-vehicle avoidance areas.
7. The headstock avoidance method according to claim 6, wherein, The determining the front-of-vehicle avoidance area includes any one of the following steps, where: Setting the area from the front of the front of the vehicle to the rear of the front of the vehicle as the front-of-vehicle avoidance area; Setting the area from the front of the front of the vehicle to the rear edge of the driver's seat as the front-of-vehicle avoidance area; Setting the area from the front of the front of the vehicle to the rear edge of the window as the front-of-vehicle avoidance area.
8. The front-end avoidance method according to any one of claims 1 to 7, wherein, The processing the image of the vehicle to be measured to obtain the pixel size of the front of the vehicle includes: For a single-frame image, extracting the pixel set of the front of the vehicle through pixel segmentation to obtain the pixel size of the front of the vehicle, where the pixel segmentation method includes at least one of pixel clustering, semantic segmentation, and instance segmentation.
9. The front-end avoidance method according to any one of claims 1 to 8, wherein, The processing the image of the vehicle to be measured to obtain the pixel size of the front of the vehicle includes: For multiple consecutive frames of images, obtaining the mean value of the pixel segmentation results of each frame to determine the pixel size of the front of the vehicle; For multiple consecutive frames of images, adopting a multi-frame moving target detection method to screen out the background for the moving vehicle to be measured in the channel and obtain the pixel set of the front of the vehicle.
10. The vehicle head avoidance method according to any one of claims 1 to 9, wherein, The obtaining the camera focal length through calibration of the internal and external parameters of the camera includes: Selecting a reference object parallel to the camera's field of view plane; Measuring the vertical distance from the reference object to the camera; Measuring the actual size of the reference object; Obtaining the internal parameter calibration parameters of the camera through multi-angle checkerboard images and obtaining the pixel size of the reference object in the calibrated image; Determining the camera focal length according to the vertical distance from the reference object to the camera, the actual size of the reference object, and the pixel size of the reference object in the calibrated image.
11. The front-end avoidance method according to any one of claims 1 to 10, wherein, The obtaining the distance between the camera and the front of the vehicle includes at least one of the following steps, where: Setting a fixed distance as the distance between the camera and the front of the vehicle; The distance provided by the ranging sensor is used as the distance between the camera and the vehicle head; According to the depth image containing depth information provided by the camera, the depth information corresponding to the set of vehicle head pixels is extracted to determine the distance between the camera and the vehicle head, where the depth image includes a three-channel color image and a depth map; For a single-frame image, the distance between the camera and the vehicle head is determined according to the distance and reference object information provided by the pixel segmentation information; For a single-frame image, a monocular depth estimate value is obtained, and the vehicle head depth is obtained according to the actual depth of the reference object to determine the distance between the camera and the vehicle head.
12. The front-end avoidance method according to claim 11, wherein, The determining the distance between the camera and the vehicle head according to the distance and reference object information provided by the pixel segmentation information includes: A first reference point and a second reference point are set on the ground, and a first reference pixel point and a second reference pixel point corresponding to the first reference point and the second reference point in the image collected by the monocular camera are set; A measurement point corresponding to a measurement pixel point in the image collected by the monocular camera is set, where the measurement point is the contact marking point between the ground and the vehicle head; The vertical projection point of the camera on the ground is set as the coordinate origin, where the distance from the measurement point to the coordinate origin is greater than the distance from the first reference point to the coordinate origin, and the distance from the measurement point to the coordinate origin is less than the distance from the second reference point to the coordinate origin; According to the distance between the first reference point and the second reference point, the distance between the first reference pixel point and the second reference pixel point, and the distance between the first reference pixel point and the measurement pixel point, the distance between the first reference point and the measurement point is determined; According to the distance between the first reference point and the coordinate origin and the distance between the first reference point and the measurement point, the distance between the camera and the vehicle head is determined.
13. The front-end avoidance method according to claim 12, wherein, The determining the distance between the first reference point and the measurement point according to the distance between the first reference point and the second reference point, the distance between the first reference pixel point and the second reference pixel point, and the distance between the first reference pixel point and the measurement pixel point includes: According to the ratio of the distance between the first reference pixel point and the measurement pixel point and the distance between the first reference pixel point and the second reference pixel point, a second ratio is determined; According to the product of the distance between the first reference point and the second reference point and the second ratio, the distance between the first reference point and the measurement point is determined.
14. A vehicle head avoidance device, comprising: An image acquisition module configured to acquire an image of a vehicle to be measured collected by a visible light area array camera; A focal length acquisition module configured to acquire the camera focal length through calibration of the internal and external parameters of the camera; A pixel size acquisition module configured to process the image of the vehicle to be measured to obtain the pixel size of the vehicle head; A distance acquisition module configured to acquire the distance between the camera and the vehicle head; An actual size acquisition module configured to acquire the actual size of the vehicle head according to the camera focal length, the distance between the camera and the vehicle head, and the pixel size of the vehicle head; A vehicle head avoidance module configured to perform vehicle head avoidance according to the actual size of the vehicle head.
15. A vehicle head avoidance device, comprising: A memory for storing instructions; A processor for executing the instructions such that the vehicle head avoidance device implements the vehicle head avoidance method according to any one of claims 1-13.
16. A vehicle head avoidance system, comprising: A visible light area array camera configured to collect an image of a vehicle to be measured; The front-end avoidance device is the front-end avoidance device described in claim 14 or 15.
17. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the front-end avoidance method described in any one of claims 1-13.
18. A computer program, comprising: Instructions that, when executed by a processor, cause the processor to execute the front-end avoidance method described in any one of claims 1-13.
Citation Information
Patent Citations
Single-dimensional pixel merging mode equivalent narrow area array camera spatial position measurement method
CN112880563A
Truck overall dimension measuring method based on binocular depth perception and vehicle position
CN112991433A
Vehicle head avoidance system and vehicle head identification method based on laser radar
CN113917480A
Vehicle inspection method and system and storage medium
CN116228656A
Vehicle head avoiding method, device and system and computer readable storage medium
CN117788579A
Cited By
Defect size calibration method, system and equipment for large structural member and medium
CN121353370A
Vehicle head avoidance method, device and system, storage medium and program product
CN121600050A