Motor vehicle target detection device and method
By preprocessing, line segment fitting and quadrilateral fitting of the image, combined with pre-stored motor vehicle quadrilateral geometric distribution model screening and feature enhancement, the problem of low motor vehicle target detection efficiency in the existing technology is solved and a more efficient goal is achieved detection.
Patent Information
- Application Number
- CN202010892887.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-31
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-08-31
AI Technical Summary
Existing motor vehicle target detection technology has poor stability and adaptability under changes in imaging environment and lens characteristics, and low detection efficiency. It is especially difficult to effectively detect motor vehicle targets when the image is blurred and the outline is unclear.
The preprocessing module is used for grayscale and threshold segmentation. The line segment fitting module segments and fits contour segments. The quadrilateral fitting module screens out line segment combinations that conform to quadrilateral relationships. The preliminary positioning module screens suspected cases based on the pre-stored motor vehicle quadrilateral geometric distribution model. motor vehicle area, and enhance features within this area, and finally use a pre-trained detection model for target detection.
Through line segment fitting and quadrilateral fitting, the number of objects that need enhanced processing is reduced, the detection efficiency is improved, and the accuracy and speed of motor vehicle target detection are improved.
Smart Images

Figure CN112001344B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of motor vehicle safe driving, and in particular to a motor vehicle target detection device and method. Background Art
[0002] In order to achieve safe driving, existing motor vehicles usually need to detect motor vehicle targets in the image frames of the motor vehicle's surrounding environment, and remind the driver of the motor vehicle targets around them in advance to avoid traffic accidents. Existing motor vehicle target detection based on image vision usually uses pre-trained motor vehicle detection templates or pre-trained motor vehicle detection classifiers. Commonly used templates in motor vehicle detection templates include edge contour templates, grayscale block templates, corner point statistical templates, local deformable statistical templates, etc. However, the successful detection of the template is affected by the imaging environment (external environment, lens characteristics, imaging angle), so the stability and adaptability are poor; and the motor vehicle detection classifier, the selection of image features is the key to this solution, but the image frames of the surrounding environment obtained during the driving of the motor vehicle are usually fuzzy, and the contour boundaries of each object in the image frame are relatively unclear. If the contour features of all objects in the image frame are enhanced before detection, the enhancement speed of the contour features is slow and the detection efficiency is relatively low. Summary of the invention
[0003] The technical problem to be solved by the embodiments of the present invention is to provide a motor vehicle target detection device that can effectively improve the detection efficiency of motor vehicle targets.
[0004] A further technical problem to be solved by the embodiments of the present invention is to provide a motor vehicle target detection method that can effectively improve the detection efficiency of motor vehicle targets.
[0005] In order to solve the above technical problems, the embodiment of the present invention provides the following technical solutions: a motor vehicle target detection device, comprising:
[0006] A preprocessing module, connected to the vehicle-mounted camera of the motor vehicle, is used to extract frame by frame from the real-time image collected and transmitted by the vehicle-mounted camera to obtain image frames, and preprocess the image frames to determine the contours of each object in the image frames, wherein the preprocessing includes at least grayscale conversion and threshold segmentation;
[0007] A line segment fitting module, connected to the preprocessing module, for segmenting the contour line and fitting each contour line segment obtained by segmentation into a corresponding fitting line segment;
[0008] A quadrilateral fitting module, connected to the line segment fitting module, is used to analyze the geometric arrangement relationship of all fitting line segments, screen out the fitting line segment combination that meets the quadrilateral relationship, and fit each fitting line segment combination into a basic unit area in a quadrilateral shape;
[0009] a preliminary positioning module, connected to the quadrilateral fitting module, for screening out basic unit areas that meet the quadrilateral geometric distribution characteristics of motor vehicles according to a pre-stored motor vehicle quadrilateral geometric distribution model, and determining a suspected motor vehicle area that includes all basic unit areas that belong to the same motor vehicle quadrilateral geometric distribution characteristics, and enhancing the features of all objects in the suspected motor vehicle area; and
[0010] The target final inspection module is connected to the preliminary positioning module and is used to detect all objects in the suspected motor vehicle area using a pre-trained motor vehicle detection model to determine the motor vehicle target.
[0011] Furthermore, the line segment fitting module includes:
[0012] a segmentation unit, configured to segment the contour line into a plurality of contour line segments according to a predetermined segmentation criterion; and
[0013] A first fitting unit is used to prepare a line segment as the fitting line segment for each contour line segment, and the contour line segment and the corresponding fitting line segment meet the following relationship: the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment is less than a first predetermined distance threshold; or the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment is greater than or equal to the first predetermined distance threshold and less than a second predetermined distance threshold, and at the same time, the curvature at the coordinate point is less than a predetermined curvature threshold.
[0014] Furthermore, the quadrilateral fitting module includes:
[0015] An analysis unit, used for analyzing and determining the spatial position of each fitting line segment;
[0016] a first screening unit, configured to sequentially select one of the fitting line segments as a basic line segment, and correspondingly screen out three different fitting line segments whose geometric arrangement relationship with the basic line segment satisfies the geometric characteristics of a quadrilateral, and combine the three different fitting line segments with the basic line segment as the fitting line segment; and
[0017] The second fitting unit is used to fit the three different fitting line segments contained in each fitting line segment combination and the basic line segment to form the basic unit area.
[0018] Furthermore, the preliminary positioning module includes:
[0019] A pre-storage unit, used for pre-storing the quadrilateral geometric distribution model of the motor vehicle, wherein the quadrilateral geometric distribution model of the motor vehicle includes quadrilateral geometric distribution features and preset size thresholds at various angles of the motor vehicle;
[0020] A second screening unit is used to analyze all basic unit areas according to the motor vehicle quadrilateral geometric distribution model, and screen out basic unit areas that meet the motor vehicle quadrilateral geometric distribution characteristics;
[0021] A collection unit, used to select all basic unit areas belonging to the same motor vehicle quadrilateral geometric distribution feature as a collection object group, and generate a target quadrilateral that completely includes all basic unit areas of the same collection object group and meets the preset size threshold, and determine the target quadrilateral as a suspected motor vehicle area; and
[0022] The feature enhancement unit is used to enhance the features of all objects in the suspected motor vehicle area.
[0023] Furthermore, the device also includes:
[0024] A line segment arrangement module is connected between the line segment fitting module and the quadrilateral fitting module, and the line segment arrangement module further comprises:
[0025] a filtering unit, used to filter out the fitted line segments whose length or width falls outside a predetermined length threshold or a predetermined width threshold; and
[0026] The fusion unit is used to fuse at least two fitting line segments whose slope difference is less than a predetermined slope difference threshold and whose spacing is less than a predetermined spacing threshold into one fitting line segment.
[0027] On the other hand, in order to further solve the above technical problems, the embodiment of the present invention provides the following technical solution: a motor vehicle target detection method, comprising the following steps:
[0028] Extracting image frames frame by frame from real-time images collected and transmitted by a vehicle-mounted camera of a motor vehicle, and preprocessing the image frames to determine contours of various objects in the image frames, wherein the preprocessing includes at least grayscale conversion and threshold segmentation;
[0029] Segmenting the contour line and fitting each contour line segment obtained by segmentation into a corresponding fitting line segment;
[0030] Analyze the geometric arrangement relationship of all fitting line segments, select the fitting line segment combination that meets the quadrilateral relationship, and fit each fitting line segment combination into a basic unit area in the shape of a quadrilateral;
[0031] Filtering out basic unit areas that meet the motor vehicle quadrilateral geometric distribution characteristics according to a pre-stored motor vehicle quadrilateral geometric distribution model, determining a suspected motor vehicle area that includes all basic unit areas that belong to the same motor vehicle quadrilateral geometric distribution characteristics, and enhancing the features of all objects in the suspected motor vehicle area; and
[0032] A pre-trained motor vehicle detection model is used to detect all objects in the suspected motor vehicle area to determine the motor vehicle target.
[0033] Furthermore, segmenting the contour line and fitting each contour line segment obtained by segmentation into a corresponding fitting line segment specifically includes:
[0034] Segmenting the contour line into a plurality of contour line segments according to a predetermined segmentation criterion; and
[0035] For each contour line segment, a line segment is proposed as the fitting line segment, and the contour line segment and the corresponding fitting line segment meet the following relationship: the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment is less than a first predetermined distance threshold; or the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment is greater than or equal to the first predetermined distance threshold and less than a second predetermined distance threshold, and at the same time, the curvature at the coordinate point is less than the predetermined curvature threshold.
[0036] Furthermore, the analyzing the geometric arrangement relationship of all the fitting line segments, selecting the fitting line segment combination that meets the quadrilateral relationship, and fitting each fitting line segment combination into a quadrilateral basic unit area specifically includes:
[0037] Analyze and determine the spatial position of each fitting line segment;
[0038] Selecting one of the fitting line segments in turn as a basic line segment, and correspondingly selecting three different fitting line segments whose geometric arrangement relationship with the basic line segment satisfies the geometric characteristics of a quadrilateral, and combining the three different fitting line segments with the basic line segment as the fitting line segment; and
[0039] The three different fitting line segments contained in each fitting line segment combination and the basic line segment are fitted to form the basic unit area.
[0040] Further, the method of screening out basic unit areas that meet the quadrilateral geometric distribution characteristics of motor vehicles according to the pre-stored motor vehicle quadrilateral geometric distribution model, and determining a suspected motor vehicle area that includes all basic unit areas that belong to the same motor vehicle quadrilateral geometric distribution characteristics, and enhancing the characteristics of all objects in the suspected motor vehicle area specifically includes: pre-store the motor vehicle quadrilateral geometric distribution model, the motor vehicle quadrilateral geometric distribution model includes quadrilateral geometric distribution characteristics of motor vehicles at various angles and preset size thresholds;
[0041] Analyze all basic unit areas according to the motor vehicle quadrilateral geometric distribution model, and select basic unit areas that meet the motor vehicle quadrilateral geometric distribution characteristics;
[0042] Selecting all basic unit areas belonging to the same motor vehicle quadrilateral geometric distribution feature as a collection object group, generating a target quadrilateral that completely includes all basic unit areas of the same collection object group and meets the preset size threshold, and determining the target quadrilateral as a suspected motor vehicle area; and
[0043] The features of all objects in the suspected motor vehicle area are enhanced.
[0044] Furthermore, the method further comprises:
[0045] Filter out the fitted line segments whose length or width falls outside a predetermined length threshold or a predetermined width threshold; and
[0046] At least two fitting line segments whose slope difference is less than a predetermined slope difference threshold and whose distance is less than a predetermined distance threshold are merged into one fitting line segment.
[0047] After adopting the above technical scheme, the embodiment of the present invention has at least the following beneficial effects: the embodiment of the present invention first performs line segment fitting on the preprocessed image frame, and then further fits the corresponding basic unit area in a quadrilateral according to the fitted line segment, and then screens out the basic unit area that meets the quadrilateral geometric distribution characteristics of the motor vehicle according to the pre-stored motor vehicle quadrilateral geometric distribution model and determines the suspected motor vehicle area that contains all the basic unit areas belonging to the same motor vehicle quadrilateral geometric distribution characteristics. It only needs to enhance the objects in the suspected motor vehicle area, which can effectively reduce the number of objects that need to be enhanced, improve data processing efficiency, and effectively improve the detection efficiency of motor vehicle targets. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a principle structural block diagram of an optional embodiment of the motor vehicle target detection device of the present invention.
[0049] Figure 2 This is a schematic diagram of detecting the front direction of a motor vehicle according to an optional embodiment of the motor vehicle target detection device of the present invention.
[0050] Figure 3 This is a schematic diagram of detecting the side of a motor vehicle according to an optional embodiment of the motor vehicle target detection device of the present invention.
[0051] Figure 4 This is a specific principle structure block diagram of a line segment fitting module of an optional embodiment of the motor vehicle target detection device of the present invention.
[0052] Figure 5 This is a specific principle structure block diagram of a quadrilateral fitting module of an optional embodiment of the motor vehicle target detection device of the present invention.
[0053] Figure 6This is a specific principle structure block diagram of a preliminary positioning module of an optional embodiment of the motor vehicle target detection device of the present invention.
[0054] Figure 7 This is a principle structural block diagram of another optional embodiment of the motor vehicle target detection device of the present invention.
[0055] Figure 8 The following is a flowchart of an optional embodiment of the motor vehicle target detection method of the present invention.
[0056] Fig. 9 This is a specific flow chart of step S2 of an optional embodiment of the motor vehicle target detection method of the present invention.
[0057] Fig.10 This is a specific flow chart of step S3 of an optional embodiment of the motor vehicle target detection method of the present invention.
[0058] Fig.11 This is a specific flow chart of step S4 of an optional embodiment of the motor vehicle target detection method of the present invention.
[0059] Fig.12 This is an application diagram of an actual scenario in which a fitting line segment is obtained in an image frame according to an optional embodiment of the motor vehicle target detection method of the present invention.
[0060] Fig.13 This is an application diagram of an actual scene in which a basic unit area is obtained in an image frame according to an optional embodiment of the motor vehicle target detection method of the present invention.
[0061] Fig.14 An optional embodiment of the motor vehicle target detection method of the present invention is an application diagram of obtaining a suspected motor vehicle area in an image frame and detecting a motor vehicle target in an actual scene. DETAILED DESCRIPTION
[0062] The present application is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following illustrative embodiments and descriptions are only used to explain the present invention and are not intended to limit the present invention. In addition, the embodiments and features in the embodiments of the present application may be combined with each other without conflict.
[0063] like Figures 1 to 3 As shown, an optional embodiment of the present invention provides a motor vehicle target detection device, comprising:
[0064] A preprocessing module 1 is connected to a vehicle-mounted camera 2 of a motor vehicle, and is used to extract image frames frame by frame from the real-time images collected and transmitted by the vehicle-mounted camera 2, and preprocess the image frames to determine the contours of each object in the image frames, wherein the preprocessing includes at least grayscale conversion and threshold segmentation;
[0065] A line segment fitting module 3, connected to the preprocessing module 1, is used to segment the contour line a and fit each contour line segment b obtained by segmentation into a corresponding fitting line segment c;
[0066] A quadrilateral fitting module 5 is connected to the line segment fitting module 3 and is used to analyze the geometric arrangement relationship of all the fitting line segments c, select the combination of fitting line segments c that meets the quadrilateral relationship, and fit each combination of fitting line segments c into a basic unit area A in a quadrilateral shape;
[0067] A preliminary positioning module 7, connected to the quadrilateral fitting module 5, is used to screen out a basic unit area A that meets the quadrilateral geometric distribution characteristics of a motor vehicle according to a pre-stored motor vehicle quadrilateral geometric distribution model, and determine a suspected motor vehicle area B that includes all basic unit areas A that belong to the same motor vehicle quadrilateral geometric distribution characteristics, and enhance the features of all objects in the suspected motor vehicle area B; and
[0068] The target final detection module 8 is connected to the preliminary positioning module 7 and is used to detect all objects in the suspected motor vehicle area B using a pre-trained motor vehicle detection model to determine the motor vehicle target.
[0069] The embodiment of the present invention first performs line segment fitting on the preprocessed image frame, and then further fits the corresponding basic unit area A in the form of a quadrilateral according to the fitted line segment, and then screens out the basic unit area A that meets the quadrilateral geometric distribution characteristics of the motor vehicle according to the pre-stored motor vehicle quadrilateral geometric distribution model, and determines the suspected motor vehicle area B that contains all the basic unit areas A belonging to the same motor vehicle quadrilateral geometric distribution characteristics. Only the objects in the suspected motor vehicle area B need to be enhanced, which can effectively reduce the number of objects that need to be enhanced, improve data processing efficiency, and effectively improve the detection efficiency of motor vehicle targets.
[0070] In the specific implementation, considering that different parts of the vehicles traveling on the road experience different lighting in the three-dimensional space, the segmentation achieved by using the global threshold segmentation cannot meet the requirements of the subsequent detection of the main contour of the vehicle target in the key image. Therefore, the threshold segmentation is implemented by using the local adaptive threshold segmentation method; in addition, the motor vehicle detection model uses a motor vehicle target detection classifier or classification template, and the classifier and classification template can use an AdaBoost classifier based on HOG or a template matching unit based on generalized hough transform.
[0071] In an optional embodiment of the present invention, Figure 4 As shown, the line segment fitting module 3 includes:
[0072] a segmentation unit 30, configured to segment the contour line a into a plurality of contour line segments b according to a predetermined segmentation criterion; and
[0073] The first fitting unit 32 is configured to fit a line segment as the fitting line segment c for each contour line segment b, and the contour line segment b and the corresponding fitting line segment c satisfy the following relationship: the distances from the coordinate points on the same contour line segment b to the corresponding fitting line segment c are all less than the first predetermined distance threshold; or the distances from the coordinate points on the same contour line segment b to the corresponding fitting line segment c are greater than or equal to the first predetermined distance threshold and less than the second predetermined distance threshold, and at the same time, the curvature at the coordinate point is less than the predetermined curvature threshold.
[0074] In this embodiment, the segmentation unit 30 segments the contour line a into several contour line segments b, and then the first fitting unit 32 fits a line segment as the fitting line segment c for each contour line segment b. The contour line segment b and the corresponding fitting line segment c satisfy the following relationship: the distances from the coordinate points on the same contour line segment b to the corresponding fitting line segment c are all less than the first predetermined distance threshold; or the distances from the coordinate points on the same contour line segment b to the corresponding fitting line segment c are greater than or equal to the first predetermined distance threshold and less than the second predetermined distance threshold, and at the same time, the curvature at the coordinate point is less than the predetermined curvature threshold, so as to realize the fitting of the contour line a and effectively fit the contour line a into the fitting line segment c.
[0075] In specific implementation, the predetermined segmentation criterion may be segmentation according to a predetermined length; when fitting a line segment as the fitting line segment c for each contour line a segment, the slope and intercept of the fitting line segment c can be set as k and b respectively, then the distance D from a point P(i, j) on the contour line a segment to the fitting line segment c (i,j) can be expressed as Set the curvature at the point P(i, j) as A (i,j) , then D (i,j) <T_D0 or T_D0 ≤ D (i,j) <T_D1, and at the same time A (i,j) <T arc , where T_D0 and T_D1 respectively represent the first predetermined distance threshold and the second predetermined distance threshold, and T arc represents the predetermined curvature threshold.
[0076] In another alternative embodiment of the present invention, as Figure 5 shown, the quadrilateral fitting module 5 includes:
[0077] An analysis unit 50, configured to analyze and determine the spatial positions of the fitting line segments c;
[0078] The first screening unit 52 is configured to sequentially select one of the fitting line segments c as the base line segment, and correspondingly screen out three different fitting line segments c whose geometric arrangement relationship with the base line segment satisfies the geometric characteristics of a quadrilateral, and use the three different fitting line segments c and the base line segment as the fitting line segment c combination; and
[0079] The second fitting unit 54 is configured to fit the three different fitting line segments c and the base line segment included in each fitting line segment c combination to form the basic unit area A.
[0080] In this embodiment, the analysis unit 50 first analyzes and determines the spatial positions of the fitting line segments c. Then, the first screening unit 52 correspondingly screens out three different fitting line segments c whose geometric arrangement relationship with the base line segment satisfies the geometric characteristics of a quadrilateral, and uses the three different fitting line segments c and the base line segment as the fitting line segment c combination. Finally, the second fitting unit 54 fits the three different fitting line segments c and the base line segment included in each fitting line segment c combination to form the basic unit area A, which can effectively determine the quadrilateral area composed of the four fitting line segments c as the basic unit area A, and use the basic unit area A as the recognition feature of the motor vehicle target.
[0081] In specific implementation, first select a fitting line segment c as the base line segment, and set the base line segment as L1(k1, b1), where k1 and b1 represent the slope and intercept of the base line segment L1. Then, select the adjacent side L1_neighbor(k1_n, b1_n) of L1 from the remaining fitting line segments c. The selection conditions include: on the one hand, the angle Ang(L1, L1 n ) < T_angle between L1 and L1_neighbor, where Ang(L1, L1 n ) represents the angle between L1 and L1_neighbor, and T_angle represents the predetermined angle threshold that satisfies the adjacent side angle requirement of the quadrilateral; on the other hand, set the closest distance between the focus P_cross of L1 and L1_neighbor and the endpoint of L1 as DisL1, and the closest distance to the endpoint of L1_neighbor as Dis_L1_n, then it is required to satisfy: Dis L1 <T dis0 and Dis_L1_n < T dis0 , T dis0 represents the predetermined point distance threshold from point to point of the quadrilateral. Subsequently, sequentially select the corresponding adjacent sides until the sum of the angles of the selected fitting line segments c is 360 degrees, and the distance between the endpoints and the corner points of the quadrilateral satisfies the maximum distance limit, that is, the basic unit area A is determined.
[0082] In another alternative embodiment of the present invention, as Figure 6As shown, the preliminary positioning module 7 includes:
[0083] A pre-storage unit 70 is used to pre-store the quadrilateral geometric distribution model of the motor vehicle, wherein the quadrilateral geometric distribution model of the motor vehicle includes quadrilateral geometric distribution features and preset size thresholds at various angles of the motor vehicle;
[0084] A second screening unit 72 is used to analyze all basic unit areas A according to the motor vehicle quadrilateral geometric distribution model, and screen out basic unit areas A that meet the motor vehicle quadrilateral geometric distribution characteristics;
[0085] The collection unit 74 is used to select all basic unit areas A belonging to the same motor vehicle quadrilateral geometric distribution feature as a collection object group, and generate a target quadrilateral that completely includes all basic unit areas A of the same collection object group and meets the preset size threshold, and determine the target quadrilateral as a suspected motor vehicle area B; and
[0086] The feature enhancement unit 76 is used to enhance the features of all objects in the suspected motor vehicle area B.
[0087] This embodiment analyzes all basic unit areas A according to the motor vehicle quadrilateral geometric distribution model, and screens out basic unit areas A that meet the motor vehicle quadrilateral geometric distribution characteristics, selects all basic unit areas A belonging to the same motor vehicle quadrilateral geometric distribution characteristics as a collection object group, and generates a target quadrilateral that completely includes all basic unit areas A of the same collection object group and meets the preset size threshold, determines the target quadrilateral as a suspected motor vehicle area B, and determines the area that meets the quadrilateral geometric distribution characteristics of the motor vehicle at various angles and the preset size threshold as a suspected motor vehicle area B, and finally enhances the features of all objects in the suspected motor vehicle area B. Only the objects in the suspected motor vehicle area B need to be enhanced, which can effectively reduce the number of objects that need to be enhanced.
[0088] In specific implementation, enhancing the features of all objects in the suspected motor vehicle area B specifically refers to sharpening and enhancing the blurred boundaries and texture information in the suspected motor vehicle area B. The extent of the sharpening enhancement is adaptively set based on the image quality of the target area itself, such as Unsharp mark filtering.
[0089] In another optional embodiment of the present invention, Figure 7 As shown, the device also includes:
[0090] The line segment arrangement module 9 is connected between the line segment fitting module 3 and the quadrilateral fitting module 5, and the line segment arrangement module 9 further comprises:
[0091] A filtering unit 90 is used to filter out the fitting line segments c whose length or width falls outside a predetermined length threshold or a predetermined width threshold; and
[0092] The fusion unit 92 is used to fuse at least two fitting line segments c whose slope difference is less than a predetermined slope difference threshold and whose spacing is less than a predetermined spacing threshold into one fitting line segment c.
[0093] In this embodiment, the filtering unit 90 also filters out the fitting line segments c whose length or width falls outside the predetermined length threshold or the predetermined width threshold, and the fusion unit 92 fuses at least two fitting line segments c whose slope difference is less than the predetermined slope difference threshold and whose spacing is less than the predetermined spacing threshold into one fitting line segment c, thereby pre-eliminating the fitting line segments c that do not meet the requirements and improving the data processing and recognition efficiency.
[0094] In the specific implementation, set the length of the fitting line segment c to Line length , width is Line width , set the predetermined length threshold to [Length_min Length_max], the predetermined width threshold to [Width_min Width_max], and judge Thus, the fitting line segments c that do not meet the requirements are eliminated.
[0095] On the other hand, Figure 8 As shown, an embodiment of the present invention provides a motor vehicle target detection method, comprising the following steps:
[0096] S1: extracting image frames frame by frame from the real-time images collected and transmitted by the vehicle-mounted camera 2 of the motor vehicle, and preprocessing the image frames to determine the contour lines a of each object in the image frames, wherein the preprocessing at least includes grayscale conversion and threshold segmentation;
[0097] S2: segmenting the contour line a and fitting each contour line segment b obtained by segmentation into a corresponding fitting line segment c;
[0098] S3: Analyze the geometric arrangement relationship of all fitting line segments c, select the combination of fitting line segments c that meets the quadrilateral relationship, and fit each combination of fitting line segments c into a basic unit area A in a quadrilateral shape;
[0099] S4: screening out basic unit regions A that meet the motor vehicle quadrilateral geometric distribution characteristics according to the pre-stored motor vehicle quadrilateral geometric distribution model, determining suspected motor vehicle regions B that include all basic unit regions A that belong to the same motor vehicle quadrilateral geometric distribution characteristics, and enhancing the features of all objects in the suspected motor vehicle regions B; and
[0100] S5: Using a pre-trained motor vehicle detection model to detect all objects in the suspected motor vehicle area B to determine the motor vehicle target.
[0101] The embodiment of the present invention uses the above method to first perform line segment fitting on the preprocessed image frame, and then further fit the corresponding quadrilateral basic unit area A according to the fitted line segment, and then screen out the basic unit area A that meets the quadrilateral geometric distribution characteristics of the motor vehicle according to the pre-stored motor vehicle quadrilateral geometric distribution model, and determine the suspected motor vehicle area B that contains all the basic unit areas A belonging to the same motor vehicle quadrilateral geometric distribution characteristics. It only needs to enhance the objects in the suspected motor vehicle area B, which can effectively reduce the number of objects that need to be enhanced, improve data processing efficiency, and effectively improve the detection efficiency of motor vehicle targets.
[0102] In another optional embodiment of the present invention, Fig. 9 As shown, the step S2 specifically includes:
[0103] S21: dividing the contour line a into a plurality of contour line segments b according to a predetermined segmentation standard; and
[0104] S22: For each contour line segment b, a line segment is prepared as the fitting line segment c, and the contour line segment b and the corresponding fitting line segment c meet the following relationship: the distance from each coordinate point on the same contour line segment b to the corresponding fitting line segment c is less than a first predetermined distance threshold; or the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment c is greater than or equal to the first predetermined distance threshold and less than the second predetermined distance threshold, and at the same time, the curvature at the coordinate point is less than the predetermined curvature threshold.
[0105] In this embodiment, the contour line a is divided into a number of contour line segments b through the above method, and then a line segment is proposed for each contour line segment b as the fitting line segment c. The contour line segment b and the corresponding fitting line segment c meet the following relationship: the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment c is less than the first predetermined distance threshold; or the distance from each coordinate point on the same contour line segment b to the corresponding fitting line segment c is greater than or equal to the first predetermined distance threshold and less than the second predetermined distance threshold, and at the same time, the curvature at the coordinate point is less than the predetermined curvature threshold, thereby achieving the fitting of the contour line a, and the contour line a can be effectively fitted into the fitting line segment c.
[0106] In another optional embodiment of the present invention, Fig.10 As shown, the step S3 specifically includes:
[0107] S31: Analyze and determine the spatial position of each fitting line segment c;
[0108] S32: sequentially selecting one of the fitting line segments c as a basic line segment, and correspondingly selecting three different fitting line segments c whose geometric arrangement relationship with the basic line segment satisfies the geometric characteristics of a quadrilateral, and combining the three different fitting line segments c with the basic line segment as the fitting line segment c; and
[0109] S33: Fitting the three different fitting line segments c and the basic line segment contained in each fitting line segment c combination to form the basic unit area A.
[0110] This embodiment uses the above method to first analyze and determine the spatial position of each fitting line segment c, then select three different fitting line segments c whose geometric arrangement relationship with the basic line segment satisfies the geometric characteristics of the quadrilateral, and use the three different fitting line segments c and the basic line segment as the fitting line segment c combination. Finally, the three different fitting line segments c and the basic line segment contained in each fitting line segment c combination are fitted to form the basic unit area A, so that the quadrilateral area composed of four fitting line segments c can be effectively determined as the basic unit area A, and the basic unit area A can be used as the recognition feature of the motor vehicle target.
[0111] In another optional embodiment of the present invention, Fig.11 As shown, the step S4 specifically includes:
[0112] S41: pre-storing the quadrilateral geometric distribution model of the motor vehicle, wherein the quadrilateral geometric distribution model of the motor vehicle includes quadrilateral geometric distribution features of the motor vehicle at various angles and a preset size threshold;
[0113] S42: analyzing all basic unit regions A according to the motor vehicle quadrilateral geometric distribution model, and selecting basic unit regions A that meet the motor vehicle quadrilateral geometric distribution characteristics;
[0114] S43: selecting all basic unit regions A belonging to the same motor vehicle quadrilateral geometric distribution feature as a collection object group, generating a target quadrilateral that completely includes all basic unit regions A of the same collection object group and meets the preset size threshold, and determining the target quadrilateral as a suspected motor vehicle region B; and
[0115] S44: Enhance the features of all objects in the suspected motor vehicle area B.
[0116] This embodiment uses the above method to analyze all basic unit areas A according to the motor vehicle quadrilateral geometric distribution model, and screens out basic unit areas A that meet the motor vehicle quadrilateral geometric distribution characteristics, thereby selecting all basic unit areas A belonging to the same motor vehicle quadrilateral geometric distribution characteristics as collection objects, and generating a target quadrilateral that completely contains all collection objects and meets the preset size threshold, determining the target quadrilateral as a suspected motor vehicle area B, and determining an area that meets the quadrilateral geometric distribution characteristics of the motor vehicle at various angles and the preset size threshold as a suspected motor vehicle area B, and finally enhancing the features of all objects in the suspected motor vehicle area B. Only the objects in the suspected motor vehicle area B need to be enhanced, which can effectively reduce the number of objects that need to be enhanced.
[0117] In yet another optional embodiment of the present invention, the method further comprises:
[0118] Filter out the fitted line segments c whose length or width falls outside a predetermined length threshold or a predetermined width threshold; and
[0119] At least two fitting line segments c whose slope difference is less than a predetermined slope difference threshold and whose distance is less than a predetermined distance threshold are merged into one fitting line segment c.
[0120] In this embodiment, the above method is also used to filter out the fitting line segments c whose length or width falls outside the predetermined length threshold or the predetermined width threshold, and to merge at least two fitting line segments c whose slope difference is less than the predetermined slope difference threshold and whose spacing is less than the predetermined spacing threshold into one fitting line segment c, so as to pre-eliminate the fitting line segments c that do not meet the requirements and improve the data processing and recognition efficiency.
[0121] If the functions described in the embodiments of the present invention are implemented in the form of software function modules or units and sold or used as independent products, they can be stored in a storage medium readable by a computing device. Based on this understanding, the part of the embodiment of the present invention that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computing device (which can be a personal computer, a server, a mobile computing device or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes. In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other.
[0122] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, which all belong to the protection scope of the present invention.
Claims
1. A motor vehicle target detection device, characterized in that: The device comprises: A preprocessing module, connected to the vehicle-mounted camera of the motor vehicle, is used to extract frame by frame from the real-time image collected and transmitted by the vehicle-mounted camera to obtain image frames, and preprocess the image frames to determine the contours of each object in the image frames, wherein the preprocessing includes at least grayscale conversion and threshold segmentation; A line segment fitting module, connected to the preprocessing module, for segmenting the contour line and fitting each contour line segment obtained by segmentation into a corresponding fitting line segment; A quadrilateral fitting module, connected to the line segment fitting module, is used to analyze the geometric arrangement relationship of all fitting line segments, screen out the fitting line segment combination that meets the quadrilateral relationship, and fit each fitting line segment combination into a basic unit area in a quadrilateral shape; a preliminary positioning module, connected to the quadrilateral fitting module, for screening out basic unit areas that meet the quadrilateral geometric distribution characteristics of motor vehicles according to a pre-stored motor vehicle quadrilateral geometric distribution model, and determining a suspected motor vehicle area that includes all basic unit areas that belong to the same motor vehicle quadrilateral geometric distribution characteristics, and enhancing the features of all objects in the suspected motor vehicle area; and A target final inspection module, connected to the preliminary positioning module, is used to detect all objects in the suspected motor vehicle area using a pre-trained motor vehicle detection model to determine the motor vehicle target; Wherein, the line segment fitting module includes: a segmentation unit, configured to segment the contour line into a plurality of contour line segments according to a predetermined segmentation criterion; and A first fitting unit is used to prepare a line segment as the fitting line segment for each contour line segment, and the contour line segment and the corresponding fitting line segment meet the following relationship: the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment is less than a first predetermined distance threshold; or the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment is greater than or equal to the first predetermined distance threshold and less than a second predetermined distance threshold, and at the same time, the curvature at the coordinate point is less than a predetermined curvature threshold; The quadrilateral fitting module comprises: An analysis unit, used for analyzing and determining the spatial position of each fitting line segment; a first screening unit, configured to sequentially select one of the fitting line segments as a basic line segment, and correspondingly screen out three different fitting line segments whose geometric arrangement relationship with the basic line segment satisfies the geometric characteristics of a quadrilateral, and combine the three different fitting line segments with the basic line segment as the fitting line segment; and The second fitting unit is used to fit the three different fitting line segments contained in each fitting line segment combination and the basic line segment to form the basic unit area.
2. The motor vehicle target detection device according to claim 1, characterized in that: The preliminary positioning module includes: A pre-storage unit, used for pre-storing the quadrilateral geometric distribution model of the motor vehicle, wherein the quadrilateral geometric distribution model of the motor vehicle includes quadrilateral geometric distribution features and preset size thresholds at various angles of the motor vehicle; A second screening unit is used to analyze all basic unit areas according to the motor vehicle quadrilateral geometric distribution model, and screen out basic unit areas that meet the motor vehicle quadrilateral geometric distribution characteristics; A collection unit, used to select all basic unit areas belonging to the same motor vehicle quadrilateral geometric distribution feature as a collection object group, and generate a target quadrilateral that completely includes all basic unit areas of the same collection object group and meets the preset size threshold, and determine the target quadrilateral as a suspected motor vehicle area; and The feature enhancement unit is used to enhance the features of all objects in the suspected motor vehicle area.
3. The motor vehicle target detection device according to claim 1, characterized in that: The device also includes: A line segment arrangement module is connected between the line segment fitting module and the quadrilateral fitting module, and the line segment arrangement module further comprises: a filtering unit, used to filter out the fitted line segments whose length or width falls outside a predetermined length threshold or a predetermined width threshold; and The fusion unit is used to fuse at least two fitting line segments whose slope difference is less than a predetermined slope difference threshold and whose spacing is less than a predetermined spacing threshold into one fitting line segment.
4. A motor vehicle target detection method, characterized in that: The method comprises the following steps: Extracting image frames frame by frame from real-time images collected and transmitted by a vehicle-mounted camera of a motor vehicle, and preprocessing the image frames to determine contours of various objects in the image frames, wherein the preprocessing includes at least grayscale conversion and threshold segmentation; Segmenting the contour line and fitting each contour line segment obtained by the segmentation into a corresponding fitting line segment, specifically comprising: segmenting the contour line into a plurality of contour line segments according to a predetermined segmentation standard; preparing a line segment for each contour line segment as the fitting line segment, wherein the contour line segment and the corresponding fitting line segment meet the following relationship: the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment is less than a first predetermined distance threshold; or the distance from each coordinate point on the same contour line segment to the corresponding fitting line segment is greater than or equal to the first predetermined distance threshold and less than a second predetermined distance threshold, and at the same time, the curvature at the coordinate point is less than a predetermined curvature threshold; Analyze the geometric arrangement relationship of all fitting line segments, select the fitting line segment combination that meets the quadrilateral relationship, and fit each fitting line segment combination into a basic unit area in a quadrilateral shape, specifically including: analyzing and determining the spatial position of each fitting line segment; sequentially selecting one of the fitting line segments as a basic line segment, and correspondingly selecting three different fitting line segments whose geometric arrangement relationship with the basic line segment meets the geometric characteristics of the quadrilateral, and using the three different fitting line segments and the basic line segment as the fitting line segment combination; fitting the three different fitting line segments contained in each fitting line segment combination and the basic line segment to form a basic unit area; Filtering out basic unit areas that meet the motor vehicle quadrilateral geometric distribution characteristics according to a pre-stored motor vehicle quadrilateral geometric distribution model, determining a suspected motor vehicle area that includes all basic unit areas that belong to the same motor vehicle quadrilateral geometric distribution characteristics, and enhancing the features of all objects in the suspected motor vehicle area; and A pre-trained motor vehicle detection model is used to detect all objects in the suspected motor vehicle area to determine the motor vehicle target.
5. The motor vehicle target detection method according to claim 4, characterized in that: The method of selecting basic unit areas that meet the motor vehicle quadrilateral geometric distribution characteristics according to the pre-stored motor vehicle quadrilateral geometric distribution model, determining a suspected motor vehicle area that includes all basic unit areas that belong to the same motor vehicle quadrilateral geometric distribution characteristics, and enhancing the characteristics of all objects in the suspected motor vehicle area specifically includes: Pre-storing the quadrilateral geometric distribution model of the motor vehicle, wherein the quadrilateral geometric distribution model of the motor vehicle includes quadrilateral geometric distribution features and preset size thresholds at various angles of the motor vehicle; Analyze all basic unit areas according to the motor vehicle quadrilateral geometric distribution model, and select basic unit areas that meet the motor vehicle quadrilateral geometric distribution characteristics; Selecting all basic unit areas belonging to the same motor vehicle quadrilateral geometric distribution feature as a collection object group, generating a target quadrilateral that completely includes all basic unit areas of the same collection object group and meets the preset size threshold, and determining the target quadrilateral as a suspected motor vehicle area; and The features of all objects in the suspected motor vehicle area are enhanced.
6. The motor vehicle target detection method according to claim 4, characterized in that: The method further comprises: Filter out the fitted line segments whose length or width falls outside a predetermined length threshold or a predetermined width threshold; and At least two fitting line segments whose slope difference is less than a predetermined slope difference threshold and whose distance is less than a predetermined distance threshold are merged into one fitting line segment.
