Search

CN-122023904-A - Yolov 11-based vehicle detection method and system

CN122023904ACN 122023904 ACN122023904 ACN 122023904ACN-122023904-A

Abstract

The invention relates to the technical field of vehicle detection, in particular to a vehicle detection method and system based on yolov < 11 >, which comprises the steps of extracting edge gradients and color blocks to identify rectangular outlines, comparing layer overlapping with vehicle body size screening high-response areas, tracking multi-frame center point judgment track continuity according to vehicle head interval index gathering positions, merging targets with small transverse offset and high longitudinal overlapping, and outputting a stable detection result. According to the invention, image segmentation is constructed by gray gradient difference and color block clustering, the region is screened based on the area overlapping proportion and the communication path, the aggregation region is indexed by utilizing the head overlapping and spacing, the moving object is screened by tracking the track offset stability of the target center point of the continuous frame, and the overlapping frames are merged according to the structure extension stability, so that the target set is formed. The method effectively improves the boundary stability, the aggregation density adaptability and the tracking continuity reliability, effectively separates interference and keeps the structural consistency of the detection result.

Inventors

  • YANG LIU
  • Hui Jiafeng
  • MA ZHENG
  • LIU HENG

Assignees

  • 西南交通大学

Dates

Publication Date
20260512
Application Date
20260129

Claims (10)

  1. 1. A vehicle detection method based on yolov s11, comprising: Acquiring an urban road image frame pixel matrix, and identifying a vehicle body edge gradient interval by analyzing gray gradient changes; constructing a closed contour based on the gradient interval of the edge of the vehicle body, and screening based on geometric conditions to obtain a target rectangular contour; Screening based on the edge variation and the path density in the feature concentration block, and obtaining a target area value based on a screening result; According to the target area value and YOLOv model, giving out the ratio of the area value of the nearest car body frame area, and screening to obtain a coincident segment; The response fragments are obtained through screening by analyzing the continuous pixel lines in the coincident fragments; analyzing the vehicle distance in the response segment, and generating an aggregation area index according to an analysis result; extracting a head center point according to the aggregation area index, obtaining offset information between adjacent frames, screening track coherent groups based on the offset information, and generating a vehicle continuous track segment; And based on the continuous track segments of the vehicle, merging and boundary adjustment are carried out by analyzing the ratio of the transverse offset to the longitudinal overlap, so as to generate a vehicle detection result.
  2. 2. The yolov-11-based vehicle detection method according to claim 1, wherein the identifying a vehicle body edge gradient section by analyzing a gradation gradient change includes: Extracting gray values from each pixel point, and performing transverse differential operation to obtain a gradient change value matrix of the pixel points; judging whether the line average value is larger than a preset gradient activation value for each line in the gradient change value matrix, and if so, obtaining a continuous differential interval; judging whether the gray gradient change trend in the continuous differential interval accords with a preset vehicle body edge change mode or not, and obtaining a mode screening result; And screening noise areas in the result according to the pixel gray scale eliminating mode to obtain a vehicle body edge gradient interval.
  3. 3. The vehicle detection method based on yolov a11 of claim 1, wherein constructing a closed contour based on a gradient section of a vehicle body edge and screening based on geometric conditions to obtain a target rectangular contour, analyzing chromaticity of color patches in the target rectangular contour to generate a feature concentration block, comprising: generating a closed contour by connecting the gradient intervals of the edge of the vehicle body, and calculating the ratio value of the area and the perimeter of the closed contour; Calculating a matching degree coefficient of the proportional value and a preset transverse straightness index, and screening according to the matching degree coefficient to obtain a target rectangular outline; And counting the pixel distribution range of the main color blocks in the chromaticity of the color blocks in the target rectangular outline, calculating the chromaticity value of each main color block, solving the chromaticity difference between any two color blocks, marking the color blocks with the chromaticity difference within the chromaticity clustering threshold value as the same class, and generating the characteristic concentrated block.
  4. 4. The yolov 11-based vehicle detection method according to claim 1, wherein the screening based on the edge variation and the path density in the feature set block, and obtaining the target area value based on the screening result, includes: Calculating the edge variation and the path concentration of the feature concentration block, wherein the edge variation is the number of vehicle body edge gradient intervals contained in the feature concentration block, and the path concentration is obtained by dividing the total length of all contours in the feature concentration block by the coverage area of the feature concentration block; comparing the path density with the path density threshold by comparing the edge variation with the edge variation threshold, and screening to obtain a target feature concentrated block; And calculating the area of the target feature set block to obtain a target area value.
  5. 5. The yolov 11-based vehicle detection method according to claim 1, wherein the filtering to obtain the response segment by analyzing the continuous pixel line in the coincident segment includes: extracting the minimum paragraph length value of the transverse coherent pixel lines in each coincident segment, judging whether the length value is larger than a coherent length threshold value, and if so, obtaining a length screening result; Calculating the number of longitudinal endpoints in the coincident segments and the number of continuous tracks for the length screening result, wherein the number of longitudinal endpoints is the number of transverse consecutive pixel lines ending on the vertical edges of the segments, and the number of continuous tracks is the number of independent and continuous pixel lines in the segments; calculating the matching degree coefficient of the number of continuous tracks and the number of longitudinal endpoints, and screening to obtain a coincident segment with the matching degree coefficient higher than a preset track integrity threshold value, thereby obtaining a response segment.
  6. 6. The yolov-11-based vehicle detection method according to claim 1, wherein analyzing the vehicle spacing in the response piece, generating an aggregate area index according to the analysis result, includes: equally dividing the response segments according to pixel coordinate values in the transverse direction of the image frame, and detecting the longitudinal coordinate range of the headstock mark point in each divided area; Calculating an overlapping proportion value of a longitudinal coordinate range of a headstock mark point between adjacent areas, comparing the overlapping proportion value with an area width difference coefficient, and screening to obtain an overlapping block set; calculating a transverse interval mean value between the vehicle heads in the overlapped block set, and comparing the transverse interval mean value with the range of the average width ratio of the area to obtain an interval screening block; And recording the position index of each interval screening block in the original image frame, and establishing a position index table according to the sequence of the transverse equidistant division to generate an aggregation area index.
  7. 7. The yolov-11-based vehicle detection method according to claim 1, wherein extracting a head center point and obtaining adjacent inter-frame offset information according to an aggregation area index, filtering a track coherent group based on the offset information, and generating a vehicle continuous track segment includes: Extracting vehicle frame selection areas in continuous frame images according to areas corresponding to the aggregation area indexes, acquiring center point coordinates of the vehicle frame selection areas in the images, and calculating offset lengths of the center point coordinates between adjacent frames in the horizontal direction; comparing each offset length with the upper limit coefficient and the lower limit coefficient of the transverse variation reference range, and screening to obtain a primary screening vehicle track; And extracting an area value sequence of a vehicle frame selection area of the primary screening vehicle track in a corresponding continuous frame, calculating a trend stability coefficient of the area value sequence in a single direction, screening based on the trend stability coefficient to obtain a track coherent group, recording the spatial distribution data of all the vehicle tracks in the group, and generating a vehicle continuous track segment.
  8. 8. The yolov 11-based vehicle detection method according to claim 1, wherein generating a vehicle detection result set by performing merging processing and boundary adjustment by analyzing a lateral offset to longitudinal overlap ratio based on a vehicle continuous track segment includes: Calculating the offset total length value of each track in the horizontal direction based on a track coordinate set in the continuous track segment of the vehicle, calculating the boundary overlapping ratio of the tracks in the longitudinal direction in continuous frames, and generating a track stability result by threshold judgment; screening out target areas with the transverse variation amplitude lower than the average span difference coefficient and the longitudinal boundary difference fluctuation range smaller than the structure extensibility coefficient in the continuous frames according to the track stability result; position merging operation is carried out on the target area to merge the coordinate sets of the adjacent areas, and a merged area coordinate set is generated; and adjusting the positions of the upper boundary line and the lower boundary line of the merging region based on the coordinate set of the merging region, outputting the data set of the adjusted region, and generating a vehicle detection result.
  9. 9. A yolov-based vehicle detection system, comprising: The first module is used for acquiring an urban road image frame pixel matrix and identifying a vehicle body edge gradient interval by analyzing gray gradient changes; The second module is used for constructing a closed contour based on the gradient interval of the edge of the vehicle body, and screening the closed contour based on geometric conditions to obtain a target rectangular contour; the third module is used for screening based on the edge variation and the path density in the feature set block, and obtaining a target area value based on a screening result; a fourth module, configured to screen to obtain a coincident segment according to the ratio of the target area value to the area value of the closest vehicle body frame area given by the YOLOv model; a fifth module, configured to obtain a response segment by analyzing the continuous pixel lines in the overlapping segment; A sixth module, configured to analyze the vehicle distance in the response segment, and generate an aggregation area index according to an analysis result; A seventh module, configured to extract a headstock center point according to the aggregation area index and obtain offset information between adjacent frames, screen a track coherent group based on the offset information, and generate a vehicle continuous track segment; And an eighth module, configured to generate a vehicle detection result by performing merging processing and boundary adjustment by analyzing a ratio of lateral offset to longitudinal overlap based on the vehicle continuous track segment.
  10. 10. The yolov-based vehicle detection system of claim 9, wherein the first module includes: the first unit is used for extracting gray values for each pixel point and performing transverse differential operation to obtain a gradient change value matrix of the pixel point; the second unit is used for judging whether the row average value is larger than a preset gradient activation value for each row in the gradient change value matrix, and if so, a continuous differential interval is obtained; The third unit is used for judging whether the gray gradient change trend in the continuous differential interval accords with a preset vehicle body edge change mode or not, and obtaining a mode screening result; and the fourth unit is used for obtaining a vehicle body edge gradient interval according to the noise area in the pixel gray level eliminating mode screening result.

Description

Yolov 11-based vehicle detection method and system Technical Field The invention relates to the technical field of vehicle detection, in particular to a vehicle detection method and system based on yolov < 11 >. Background The existing vehicle detection technology performs classification and positioning through the integral response of a feature map, extracts image boundaries and contour features depending on a network backbone layer, lacks the primary segmentation and screening of a local structure in an input stage, is uniformly processed on boundaries between areas, cannot adapt to overlapping among multiple vehicles, is similar in color or is staggered in position, is large in area response fluctuation due to insufficient sensitivity of the map layer, is difficult to accurately identify objects which are hidden and overlapped or are not obvious in boundary, frequently happens frame body deviation among frames, obviously reduces detection continuity under typical urban traffic scenes such as lane aggregation and high-speed lane change, and influences the stable output and quantity judgment integrity of target tracking. Disclosure of Invention The present invention is directed to a vehicle detection method and system based on yolov a11 to improve the above-mentioned problems. In order to achieve the above purpose, the technical scheme adopted by the invention is as follows: In a first aspect, the present application provides a vehicle detection method based on yolov a11, including: Acquiring an urban road image frame pixel matrix, and identifying a vehicle body edge gradient interval by analyzing gray gradient changes; constructing a closed contour based on the gradient interval of the edge of the vehicle body, and screening based on geometric conditions to obtain a target rectangular contour; Screening based on the edge variation and the path density in the feature concentration block, and obtaining a target area value based on a screening result; According to the target area value and YOLOv model, giving out the ratio of the area value of the nearest car body frame area, and screening to obtain a coincident segment; The response fragments are obtained through screening by analyzing the continuous pixel lines in the coincident fragments; analyzing the vehicle distance in the response segment, and generating an aggregation area index according to an analysis result; extracting a head center point according to the aggregation area index, obtaining offset information between adjacent frames, screening track coherent groups based on the offset information, and generating a vehicle continuous track segment; And based on the continuous track segments of the vehicle, merging and boundary adjustment are carried out by analyzing the ratio of the transverse offset to the longitudinal overlap, so as to generate a vehicle detection result. In a second aspect, the present application also provides a vehicle detection system based on yolov a 11, comprising: The first module is used for acquiring an urban road image frame pixel matrix and identifying a vehicle body edge gradient interval by analyzing gray gradient changes; The second module is used for constructing a closed contour based on the gradient interval of the edge of the vehicle body, and screening the closed contour based on geometric conditions to obtain a target rectangular contour; the third module is used for screening based on the edge variation and the path density in the feature set block, and obtaining a target area value based on a screening result; a fourth module, configured to screen to obtain a coincident segment according to the ratio of the target area value to the area value of the closest vehicle body frame area given by the YOLOv model; a fifth module, configured to obtain a response segment by analyzing the continuous pixel lines in the overlapping segment; A sixth module, configured to analyze the vehicle distance in the response segment, and generate an aggregation area index according to an analysis result; A seventh module, configured to extract a headstock center point according to the aggregation area index and obtain offset information between adjacent frames, screen a track coherent group based on the offset information, and generate a vehicle continuous track segment; And an eighth module, configured to generate a vehicle detection result by performing merging processing and boundary adjustment by analyzing a ratio of lateral offset to longitudinal overlap based on the vehicle continuous track segment. The beneficial effects of the invention are as follows: In the invention, boundary abrupt change areas are identified through gray gradient difference in an image input stage, an image space segmentation basis is constructed by combining a closed contour and color block clustering, region screening is performed based on the area coincidence proportion between a layer segment and a vehicle body frame region and a communication path c