CN113655791B - Vehicle tracking method and system based on linear CCD camera - Google Patents

Vehicle tracking method and system based on linear CCD camera Download PDF

Info

Publication number
CN113655791B
CN113655791B CN202110906293.XA CN202110906293A CN113655791B CN 113655791 B CN113655791 B CN 113655791B CN 202110906293 A CN202110906293 A CN 202110906293A CN 113655791 B CN113655791 B CN 113655791B
Authority
CN
China
Prior art keywords
ccd camera
vehicle tracking
pixel points
pixel
voltage deviation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110906293.XA
Other languages
Chinese (zh)
Other versions
CN113655791A (en
Inventor
宋秀兰
李永博
胡志强
陈雨
卢为党
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN202110906293.XA priority Critical patent/CN113655791B/en
Publication of CN113655791A publication Critical patent/CN113655791A/en
Application granted granted Critical
Publication of CN113655791B publication Critical patent/CN113655791B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/02Control of position or course in two dimensions
    • G05D1/021Control of position or course in two dimensions specially adapted to land vehicles
    • G05D1/0231Control of position or course in two dimensions specially adapted to land vehicles using optical position detecting means
    • G05D1/0246Control of position or course in two dimensions specially adapted to land vehicles using optical position detecting means using a video camera in combination with image processing means
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/02Control of position or course in two dimensions
    • G05D1/021Control of position or course in two dimensions specially adapted to land vehicles
    • G05D1/0212Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/50Control of the SSIS exposure
    • H04N25/53Control of the integration time
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Remote Sensing (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Signal Processing (AREA)
  • Electromagnetism (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Studio Devices (AREA)

Abstract

The invention discloses a vehicle tracking method and a system based on a linear CCD camera, wherein the vehicle tracking method based on the linear CCD camera comprises the following steps: s1, acquiring exposure feedback quantity of a CCD camera when vehicle tracking is performed, and acquiring exposure time of the CCD camera according to the acquired exposure feedback quantity; s2, calculating a binarization threshold value corresponding to the CCD camera by a peak value method, and carrying out binarization processing on pixel points of the CCD camera based on the calculated binarization threshold value; s3, screening left and right boundaries of the track when the CCD camera performs vehicle tracking, and traversing the pixel points subjected to binarization processing to obtain a center line position of the track; s4, judging whether the vehicle tracking is finished, if not, repeating the steps S1-S3 until the vehicle tracking is finished. The vehicle tracking method based on the linear CCD camera is simple, convenient to understand, few in adjustment parameters, high in data processing efficiency, high in instantaneity and strong in practicality and adaptability.

Description

Vehicle tracking method and system based on linear CCD camera
Technical Field
The invention relates to the technical field of vehicle cruise automatic control, in particular to a vehicle tracking method and system based on a linear CCD camera.
Background
Automatic control and stable operation of cruising of a vehicle require that the vehicle be able to accurately extract road information and accurately perform tracking. The track of the vehicle can be accurately identified to find the advancing direction, so that tasks such as autonomous transportation or automatic monitoring can be completed. In the environment that the production technology of enterprises is continuously improved and the requirements for automation technology are continuously increased, the technology is more and more focused and researched. The basis of accurately extracting the road information is whether the target color and the background color of the track to be tracked can be accurately distinguished. For the tracking system, there are many sensors for tracking, but in view of cost, resolution and prospective factors, a linear CCD camera is used as the tracking sensor.
Because the track is affected by various factors, especially light intensity, in the track seeking process, a large error can occur in the judgment of the track boundary of the vehicle. At present, aiming at a linear CCD camera tracking system, data acquisition, data processing and binarization are mostly adopted for track extraction. Wherein, an important part in the data acquisition is to acquire data stably under any light intensity, and the current countermeasure mainly comprises adaptive adjustment of exposure time, kalman filtering and the like. In the binarization process, the main methods at present are a gray level average method, an oxford method, an optimal iteration method and the like. The method is complex, and is not beneficial to giving more energy to the singlechip to process other complex tasks such as communication, transmission and the like. Therefore, as the functions of the intelligent vehicle become more powerful and the complexity becomes higher, a simple and quick tracking method is explored, and the method becomes a research direction which has very theoretical significance and practical value in the field of vehicle cruise automatic control.
Disclosure of Invention
The invention aims at overcoming the defects of the prior art, and provides a vehicle tracking method and system based on a linear CCD camera.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
a vehicle tracking method based on a linear CCD camera comprises the following steps:
s1, acquiring exposure feedback quantity of a CCD camera when vehicle tracking is performed, and acquiring exposure time of the CCD camera according to the acquired exposure feedback quantity;
s2, calculating a binarization threshold value corresponding to the CCD camera by a peak value method, and carrying out binarization processing on pixel points of the CCD camera based on the calculated binarization threshold value;
s3, screening left and right boundaries of the track when the CCD camera performs vehicle tracking, and traversing the pixel points subjected to binarization processing to obtain a center line position of the track;
s4, judging whether the vehicle tracking is finished, if not, repeating the steps S1-S3 until the vehicle tracking is finished.
Further, before the step S1, the method further includes:
s0. the exposure time of the CCD camera is preset.
Further, the step S1 specifically includes:
s11, taking the weighted average pixel gray value of the pixel points when the CCD camera performs vehicle tracking as the current exposure feedback quantity;
s12, calculating actual voltage deviation of the pixel point according to the exposure feedback quantity;
s13, judging whether the absolute value of the calculated actual voltage deviation is smaller than the allowable voltage deviation, if so, the exposure time of the CCD camera is not changed; if not, executing step S14;
s14, judging whether the calculated actual voltage deviation is larger than the allowable voltage deviation, if so, increasing the exposure time; if not, the exposure time is reduced.
Further, in the step S12, the actual voltage deviation of the pixel is calculated, which is expressed as:
error=M value -A value
wherein error represents the actual voltage deviation of the pixel points acquired by the CCD camera; m is M value Representing an average voltage value representing a pixel under normal illumination; a is that value Representing the voltage of the calculated weighted average pixel value.
Further, the steps S13 and S14 specifically include:
where Time represents the exposure Time of the CCD camera.
Further, the step S2 specifically includes:
s21, traversing the CCD camera to carry out gray values of pixel points when the vehicle is tracked;
s22, grouping gray values, and calculating the frequency of pixel points appearing in each group;
s23, screening two groups with the most densely distributed pixel points by a histogram analysis method;
s24, calculating a binarization threshold value according to the two screened groups;
s25, performing binarization processing on the pixel points according to the binarization threshold value.
Further, the binarized threshold value in step S24 is expressed as:
wherein TS value A threshold representing binarization; a is that 1 、A 2 Respectively representing gray scale start and end values for grouping gray scale values; delta and n respectively represent the interval of the grouping and the number of the grouping; a is that s An intermediate value representing a first set of gray levels; peak [0]]、peak[1]Two groups (initial group number 0) where pixel distribution is most dense are shown.
Further, in the step S25, the binarization processing is performed on the pixel points, which is expressed as:
wherein Pixel represents the gray value of the Pixel point collected by the CCD camera.
Correspondingly, a vehicle tracking system based on a linear CCD camera is also provided, comprising:
the acquisition module is used for acquiring exposure feedback quantity when the CCD camera performs vehicle tracking, and acquiring exposure time of the CCD camera according to the acquired exposure feedback quantity;
the first processing module is used for calculating a binarization threshold value corresponding to the CCD camera through a peak value method and carrying out binarization processing on pixel points of the CCD camera based on the calculated binarization threshold value;
the first screening module is used for screening left and right boundaries of the track when the CCD camera carries out vehicle tracking, and traversing the pixel points subjected to binarization processing to obtain a center line position of the track;
and the first judging module is used for judging whether the vehicle tracking is finished.
Further, the obtaining module specifically includes:
the setting module is used for taking the weighted average pixel gray value of the pixel points when the CCD camera carries out vehicle tracking as the current exposure feedback quantity;
the first calculation module is used for calculating the actual voltage deviation of the pixel point according to the exposure feedback quantity;
the second judging module is used for judging whether the absolute value of the calculated actual voltage deviation is smaller than the allowable voltage deviation or not;
and the third judging module is used for judging whether the calculated actual voltage deviation is larger than the allowable voltage deviation.
Compared with the prior art, the invention has the beneficial effects that:
1. in the process of data acquisition and processing, the singlechip resource is saved, and the data acquisition and processing of the linear CCD camera are optimized on the premise of not reducing the stability of acquired data;
2. the vehicle tracking method based on the linear CCD camera is simple, convenient to understand, few in adjustment parameters, high in data processing efficiency, high in instantaneity, and strong in practicality and adaptability.
Drawings
Fig. 1 is a flowchart of a vehicle tracking method based on a linear CCD camera according to a first embodiment;
FIG. 2 is a flowchart of a method for acquiring exposure time according to a first embodiment;
FIG. 3 is a flowchart of a binarization process according to the first embodiment;
fig. 4 is a schematic diagram of a distribution situation of pixel gray values of collected pixel points when the pixel points are subjected to stronger illumination on the premise of adjusting exposure time in real time;
FIG. 5 is a schematic diagram showing a method for calculating a suitable threshold value for binarization according to the peak method according to the second embodiment;
fig. 6 is a diagram illustrating a distribution of binarized pixel gray values according to the second embodiment.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present invention with reference to specific examples. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict.
The invention aims at overcoming the defects of the prior art, and provides a vehicle tracking method and system based on a linear CCD camera.
Example 1
The present embodiment provides a vehicle tracking method based on a linear CCD camera, as shown in fig. 1, including:
s1, acquiring exposure feedback quantity of a CCD camera when vehicle tracking is performed, and acquiring exposure time of the CCD camera according to the acquired exposure feedback quantity;
s2, calculating a binarization threshold value corresponding to the CCD camera by a peak value method, and carrying out binarization processing on pixel points of the CCD camera based on the calculated binarization threshold value;
s3, screening left and right boundaries of the track when the CCD camera performs vehicle tracking, and traversing the pixel points subjected to binarization processing to obtain a center line position of the track;
s4, judging whether the vehicle tracking is finished, if not, repeating the steps S1-S3 until the vehicle tracking is finished.
Aiming at the complex vehicle tracking method at present, the embodiment provides a vehicle tracking method which is intuitive to understand, simple in design and easy to realize, is based on linear CCD camera shooting, has simple and optimized data acquisition and processing processes, and can accurately find the central line of a track.
The main execution part of the embodiment is operated and implemented on a singlechip for automatic cruise control of a vehicle, and acquired and processed data can be acquired in real time through a remote upper computer.
The method further comprises the following steps before the step S1: s0. the exposure time of the CCD camera is preset.
In step S1, an exposure feedback amount of the CCD camera during vehicle tracking is acquired, and an exposure time of the CCD camera is acquired according to the acquired exposure feedback amount.
The existing method for adjusting the exposure time is complicated and complex in processing and cannot meet the universal application of equipment, and the embodiment utilizes a simple closed-loop control to adjust the exposure time in real time by finding a proper feedback quantity.
Firstly, setting a fixed exposure time, and then, acquiring the actual exposure of the linear CCD camera by adjusting the exposure time in real time, wherein the exposure parameter adjustment basis is fed back by the current exposure of the linear CCD camera; however, in most of the existing methods, the average pixel value of the captured pixel point is selected as the exposure feedback quantity, but the embodiment finds that when the light difference on the track is large, the average pixel gray value of the captured pixel point may not be changed greatly, so that the exposure time cannot be adjusted timely, and the phenomena of deviation from the track and the like occur; in contrast, the weighted average adopted in this embodiment can reflect the centralized condition of the data, that is, the change condition of the illumination, and also changes when an obvious illumination difference occurs, so in this embodiment, the weighted average pixel gray value of the pixel point adopted last time is selected as the exposure feedback amount at this time, and the exposure time of the CCD camera is further obtained.
Fig. 2 is a flowchart of a method for acquiring exposure time, which specifically includes:
s11, taking the weighted average pixel gray value of the pixel points when the CCD camera performs vehicle tracking as the current exposure feedback quantity;
s12, calculating actual voltage deviation of the pixel point according to the exposure feedback quantity; expressed as:
error=M value -A value (1)
wherein error represents the actual voltage deviation of the pixel points acquired by the CCD camera; m is M value Representing an average voltage value representing a pixel under normal illumination; a is that value Representing the voltage of the calculated weighted average pixel value.
The values in this embodiment are all voltage values, because processing the pixel values into voltage values can improve accuracy by multiplying the ratio of the pixel value to 255 (pixel maximum value) by the total voltage (taking 50V to expand the data to improve accuracy); m is M value The voltage value corresponding to the captured pixel value is obtained by averaging in a uniform illumination environment for a plurality of times, and the change condition of the current illumination can be obtained by comparing the voltage value with the voltage value.
Wherein M is value 、A value The calculation of (2) needs to be based on the following binarized grouping parameters, specifically calculated as:
wherein delta and n respectively represent the interval of the groups and the number of the groups; a is that s An intermediate value representing a first set of gray levels; mean [ i ]]Representing the product of the gray value corresponding to each group and the weight occupied by the pixel points of the group (the gray value of each group is represented by the intermediate value of each group); y [ i ]]For the weight of each group of pixel points, counting the number of the points in the group range by traversing all the pixel points, wherein the ratio of the number of the points to the total number of the pixel points is Y [ i ]];W mean Mean [ i ] representing all groups to be grouped]Summing to obtain a weighted value; a is that value The ratio of the weighted value to the gray total value is multiplied by the total voltage of 50V set by us.
Wherein A is mean The average value of the pixel values of all the pixel points; m is M value Representing the average voltage value calculated under normal uniform illumination, we actually obtain the final M by calculating multiple times and averaging it value And is determined.
S13, judging whether the absolute value of the calculated actual voltage deviation is smaller than the allowable voltage deviation, if so, the exposure time of the CCD camera is not changed; if not, executing step S14;
s14, judging whether the calculated actual voltage deviation is larger than the allowable voltage deviation, if so, increasing the exposure time; if not, the exposure time is reduced.
The embodiment is provided with A error To allow the voltage deviation, the actual voltage deviation error calculated by the formula (1) is compared with the preset allowable voltage deviation A error The comparison is made to obtain the final exposure time, expressed as:
wherein A is error The preset allowable voltage deviation is indicated to be used for measuring the variation range of the allowable illumination; time represents the exposure Time of a linear CCD camera and defines the upper and lower limits of Time min 、Time max
When error is < -A error When the feedback quantity is too large, the pixel value is too large, namely the illumination is strong, so the exposure time is reduced; when error > A error When the feedback quantity is too small, the pixel value is too small, namely the illumination is weaker, so the exposure time is increased; other cases show that the light is better and the exposure time is unchanged; time min 、Time max For protecting the exposure time from being too large or too small.
In step S2, a binarization threshold corresponding to the CCD camera is calculated by a peak method, and binarization processing is performed on the pixel points of the CCD camera based on the calculated binarization threshold.
The binarization effect is mainly characterized in that the advantages and disadvantages of the selected threshold value are mainly characterized in that in most of the trace finding binarization methods of the linear cameras, the threshold value selection is performed on the maximum pixel value and the minimum pixel value of the captured pixel point, but the situation that a lot of rest pixel point information is ignored in this way is found, and in some environment which is not friendly, the binarization effect is not ideal; meanwhile, due to the limitation of the performance of the linear CCD camera and the irregularity of the distribution of the pixel points, there is no method for analyzing the relation among the pixels by taking a single pixel point as a unit; therefore, the embodiment respectively finds out the gray values represented by the representative target color and the background color by a similar histogram analysis method through optimizing and simplifying the peak analysis method in the image processing; therefore, in this embodiment, by determining a proper start gray value, a proper end gray value and a proper interval, grouping gray values within a range, traversing the collected pixel values of all the pixels, counting the occurrence frequency of the pixel values in each group, finding out two groups with the most dense pixel distribution, namely, the groups of the pixel gray values represented by the target color and the background color, by using the histogram analysis, determining a threshold value for binarization, and finally performing binarization processing on the pixel points based on the binarization threshold value.
As shown in fig. 3, a flowchart of a method for performing binarization processing specifically includes:
s21, traversing a CCD camera to carry out the gray value ADV 128 of a pixel point when the vehicle is tracked;
s22, grouping gray values, and calculating the frequency Y [ i ] of pixel points appearing in each group;
s23, screening two groups with the most densely distributed pixel points by a histogram analysis method;
s24, calculating a binarization threshold value according to the two screened groups; expressed as:
wherein TS value A threshold representing binarization; a is that 1 、A 2 Respectively representing gray scale start and end values for grouping gray scale values; delta and n respectively represent the interval of the grouping and the number of the grouping; a is that s An intermediate value representing a first set of gray levels; peak [0]]、peak[1]Two groups with the most densely distributed pixel points are represented, namely, two peak values (the initial group number is 0) which are obtained by counting the number of the pixel points in different groups are counted.
In this embodiment, peak [0], peak [1] are determined by calculating the frequencies of the corresponding pixels included in each group, traversing the n groups of frequencies, and finding out the two groups with the largest occurrence of pixels.
S25, carrying out binarization processing on the pixel points according to a binarization threshold, wherein the binarization processing is expressed as follows:
wherein Pixel represents the gray value of the Pixel point collected by the CCD camera.
In step S3, the left and right boundaries of the track are screened when the CCD camera performs vehicle tracking, and the pixel points after binarization processing are traversed to obtain the center line position of the track.
The central line of the track is determined by searching the left and right boundaries of the track, 128 pixel points after binarization are traversed, the position where 3 points are equal to 0 and 2 points are equal to 250 is determined as the left boundary, the position where 2 points are equal to 0 and 3 points are equal to 250 is similarly determined as the right boundary, and the central position of the two is taken as the central line position of the track.
In step S4, it is determined whether the vehicle tracking is completed, and if not, steps S1 to S3 are repeatedly executed until the vehicle tracking is completed.
The weighted average voltage value of the pixel points is obtained through the last data acquisition and is used as a feedback quantity, the actual voltage deviation of the 128 pixel points is calculated according to the formula (1), and the exposure time of the linear CCD camera is adjusted in real time according to the formula (2) to obtain stable data; based on stable data, obtaining a proper threshold value according to a formula (3) to binarize the gray values of 128 pixels, and further finding the left and right boundaries of the track to determine the central line of the track; and each data acquisition period is used for adjusting the exposure time until the exposure time reaches, starting the exposure acquisition data by the linear CCD camera, performing binarization after calculating a threshold value, and finding the left and right boundaries of the track to determine the track center line until the vehicle tracking is finished.
The beneficial effects of this embodiment are:
1. in the process of data acquisition and processing, the singlechip resource is saved, and the data acquisition and processing of the linear CCD camera are optimized on the premise of not reducing the stability of acquired data;
2. the vehicle tracking method based on the linear CCD camera is simple, convenient to understand, few in adjustment parameters, high in data processing efficiency, high in instantaneity, and strong in practicality and adaptability.
Correspondingly, the embodiment also provides a vehicle tracking system based on the linear CCD camera, which comprises:
the acquisition module is used for acquiring exposure feedback quantity when the CCD camera performs vehicle tracking, and acquiring exposure time of the CCD camera according to the acquired exposure feedback quantity;
the first processing module is used for calculating a binarization threshold value corresponding to the CCD camera through a peak value method and carrying out binarization processing on pixel points of the CCD camera based on the calculated binarization threshold value;
the first screening module is used for screening left and right boundaries of the track when the CCD camera carries out vehicle tracking, and traversing the pixel points subjected to binarization processing to obtain a center line position of the track;
and the first judging module is used for judging whether the vehicle tracking is finished, if not, repeating the steps S1-S3 until the vehicle tracking is finished.
Further, the obtaining module specifically includes:
the setting module is used for taking the weighted average pixel gray value of the pixel points when the CCD camera carries out vehicle tracking as the current exposure feedback quantity;
the first calculation module is used for calculating the actual voltage deviation of the pixel point according to the exposure feedback quantity;
the second judging module is used for judging whether the absolute value of the calculated actual voltage deviation is smaller than the allowable voltage deviation or not;
and the third judging module is used for judging whether the calculated actual voltage deviation is larger than the allowable voltage deviation.
Example two
The vehicle tracking method based on the linear CCD camera provided by the embodiment is different from the first embodiment in that:
the implementation process of the embodiment is divided into the following three stages:
1. parameter setting: in the parameter setting interface, parameters are input as follows: allowable voltage deviation A error =2, the average voltage value M of the given pixel point calculated in earlier stage value =25v (data is expanded by 10 times to reduce the error in calculation), exposure Time of linear CCD camera initial value=10ms, upper and lower limit Time of Time min =1s、Time max Gray start and end values of the grouping a1=11, a=20s, respectively 2 =160, group number of packets n=30; the upper computer sends the setting data into the RAM of the singlechip storage unit for storage;
2. offline debugging: the data transmission interface of the control singlechip is connected to the upper computer at the computer end through a data line, the upper computer clicks the Go button to enter the debugging interface, the CPU of the master singlechip is started to call the linear CCD camera tracking program downloaded in advance, and the tracking result of the linear CCD camera can be obtained, and the specific implementation process is as follows:
1) According to a given allowable voltage deviation A error Average voltage value M of given pixel point value Calculating a current exposure Time Time using equation (2);
2) By grouping the gradation start and end values A 1 =11、A 2 The group number n=160 and the grouping number n=30, the threshold value for binarization is calculated according to equation (3), the group number n can be adjusted through the distribution effect of the gray values of the pixel points displayed in the upper computer, the good group number n for grouping the gray values is determined, and binarization is performed according to equation (4) after the threshold value is determined;
3) According to the distribution of the binarized pixel points, determining the left and right boundaries of the track, and taking the average value of the left and right boundaries as the central line of the track;
4) And saving the calculation result into a RAM of the singlechip storage unit.
3. And (3) online operation: starting CPU reading parameters of the main control singlechip, obtaining weighted average voltage values of the pixel points through the last data acquisition as feedback quantity, calculating actual voltage deviations of 128 pixel points according to a formula (1), and adjusting the exposure time of the linear CCD camera in real time according to a formula (2) to obtain stable data; based on stable data, obtaining a proper threshold value according to a formula (3) to binarize the gray values of 128 pixels, and further finding the left and right boundaries of the track to determine the central line of the track; and each data acquisition period is used for adjusting the exposure time until the exposure time reaches, starting the exposure acquisition data by the linear CCD camera, calculating to obtain a threshold value, binarizing, and searching the left and right boundaries of the track to determine the track center line.
Fig. 4 is a distribution of pixel gray values of the collected pixel points when the vehicle tracking method based on the linear CCD camera is under strong illumination on the premise of adjusting the exposure time in real time. Fig. 5 shows a method for calculating a suitable threshold value for binarization by using a peak method in a vehicle tracking method based on a linear CCD camera. Fig. 6 shows a distribution of binarized pixel gray values in a vehicle tracking method based on a linear CCD camera.
The beneficial effects of this embodiment are:
1. in the process of data acquisition and processing, the singlechip resource is saved, and the data acquisition and processing of the linear CCD camera are optimized on the premise of not reducing the stability of acquired data;
2. the vehicle tracking method based on the linear CCD camera is simple, convenient to understand, few in adjustment parameters, high in data processing efficiency, high in instantaneity, and strong in practicality and adaptability.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (8)

1. A vehicle tracking method based on a linear CCD camera is characterized by comprising the following steps:
s1, acquiring exposure feedback quantity of a CCD camera when vehicle tracking is performed, and acquiring exposure time of the CCD camera according to the acquired exposure feedback quantity;
the step S1 specifically comprises the following steps:
s11, taking the weighted average pixel gray value of the pixel points when the CCD camera performs vehicle tracking as the current exposure feedback quantity;
s12, calculating actual voltage deviation of the pixel point according to the exposure feedback quantity;
s13, judging whether the absolute value of the calculated actual voltage deviation is smaller than the allowable voltage deviation, if so, the exposure time of the CCD camera is not changed; if not, executing step S14;
s14, judging whether the calculated actual voltage deviation is larger than the allowable voltage deviation, if so, increasing the exposure time; if not, reducing the exposure time;
s2, calculating a binarization threshold value corresponding to the CCD camera by a peak value method, and carrying out binarization processing on pixel points of the CCD camera based on the calculated binarization threshold value;
the step S2 specifically comprises the following steps:
s21, traversing the CCD camera to carry out gray values of pixel points when the vehicle is tracked;
s22, grouping gray values, and calculating the frequency of pixel points appearing in each group;
s23, screening two groups with the most densely distributed pixel points by a histogram analysis method;
s24, calculating a binarization threshold value according to the two screened groups;
s25, performing binarization processing on the pixel points according to the binarization threshold value;
s3, screening left and right boundaries of the track when the CCD camera performs vehicle tracking, and traversing the pixel points subjected to binarization processing to obtain a center line position of the track;
s4, judging whether the vehicle tracking is finished, if not, repeating the steps S1-S3 until the vehicle tracking is finished.
2. The vehicle tracking method based on the linear CCD camera according to claim 1, wherein the step S1 further includes:
s0. the exposure time of the CCD camera is preset.
3. The vehicle tracking method based on the linear CCD camera according to claim 2, wherein the actual voltage deviation of the pixel point is calculated in step S12, which is expressed as:
wherein error represents the actual voltage deviation of the pixel points acquired by the CCD camera;representing an average voltage value representing a pixel under normal illumination; />Representing the voltage of the calculated weighted average pixel value.
4. The vehicle tracking method based on the linear CCD camera according to claim 3, wherein the steps S13 and S14 specifically include:
where Time represents the exposure Time of the CCD camera.
5. The vehicle tracking method based on the linear CCD camera according to claim 1, wherein the binarized threshold value in the step S24 is expressed as:
wherein,a threshold representing binarization; />、/>Respectively representing gray scale start and end values for grouping gray scale values; n represents the interval of the group and the number of the group; />An intermediate value representing a first set of gray levels; />、/>Two groups (initial group number 0) where pixel distribution is most dense are shown.
6. The vehicle tracking method based on the linear CCD camera according to claim 5, wherein the binarizing process is performed on the pixel point in step S25, which is expressed as:
wherein,and the gray value of the pixel point acquired by the CCD camera is represented.
7. A vehicle tracking system based on a linear CCD camera, comprising:
the acquisition module is used for acquiring the exposure feedback quantity of the CCD camera when the vehicle is tracked, and acquiring the exposure time of the CCD camera according to the acquired exposure feedback quantity, and specifically comprises the following steps:
s11, taking the weighted average pixel gray value of the pixel points when the CCD camera performs vehicle tracking as the current exposure feedback quantity;
s12, calculating actual voltage deviation of the pixel point according to the exposure feedback quantity;
s13, judging whether the absolute value of the calculated actual voltage deviation is smaller than the allowable voltage deviation, if so, the exposure time of the CCD camera is not changed; if not, executing step S14;
s14, judging whether the calculated actual voltage deviation is larger than the allowable voltage deviation, if so, increasing the exposure time; if not, reducing the exposure time;
the processing module is used for calculating a binarization threshold value corresponding to the CCD camera by a peak value method, and performing binarization processing on pixel points of the CCD camera based on the calculated binarization threshold value, and specifically comprises the following steps:
s21, traversing the CCD camera to carry out gray values of pixel points when the vehicle is tracked;
s22, grouping gray values, and calculating the frequency of pixel points appearing in each group;
s23, screening two groups with the most densely distributed pixel points by a histogram analysis method;
s24, calculating a binarization threshold value according to the two screened groups;
s25, performing binarization processing on the pixel points according to the binarization threshold value;
s3, screening left and right boundaries of the track when the CCD camera performs vehicle tracking, and traversing the pixel points subjected to binarization processing to obtain a center line position of the track;
s4, judging whether the vehicle tracking is finished, if not, repeating the steps S1-S3 until the vehicle tracking is finished;
the screening module is used for screening left and right boundaries of the track when the CCD camera carries out vehicle tracking, and traversing the pixel points subjected to binarization processing to obtain a center line position of the track;
and the first judging module is used for judging whether the vehicle tracking is finished.
8. The vehicle tracking system based on a linear CCD camera according to claim 7, wherein the acquisition module is specifically:
the setting module is used for taking the weighted average pixel gray value of the pixel points when the CCD camera carries out vehicle tracking as the current exposure feedback quantity;
the calculation module is used for calculating the actual voltage deviation of the pixel point according to the exposure feedback quantity;
the second judging module is used for judging whether the absolute value of the calculated actual voltage deviation is smaller than the allowable voltage deviation or not;
and the third judging module is used for judging whether the calculated actual voltage deviation is larger than the allowable voltage deviation.
CN202110906293.XA 2021-08-09 2021-08-09 Vehicle tracking method and system based on linear CCD camera Active CN113655791B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110906293.XA CN113655791B (en) 2021-08-09 2021-08-09 Vehicle tracking method and system based on linear CCD camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110906293.XA CN113655791B (en) 2021-08-09 2021-08-09 Vehicle tracking method and system based on linear CCD camera

Publications (2)

Publication Number Publication Date
CN113655791A CN113655791A (en) 2021-11-16
CN113655791B true CN113655791B (en) 2023-12-12

Family

ID=78490463

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110906293.XA Active CN113655791B (en) 2021-08-09 2021-08-09 Vehicle tracking method and system based on linear CCD camera

Country Status (1)

Country Link
CN (1) CN113655791B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0591344A (en) * 1991-09-26 1993-04-09 Olympus Optical Co Ltd Picture encoding device
JPH0793689A (en) * 1993-09-28 1995-04-07 Isuzu Motors Ltd Lane recognizing device
CN104917975A (en) * 2015-06-01 2015-09-16 北京空间机电研究所 Adaptive automatic exposure method based on object characteristics
CN108153307A (en) * 2017-12-21 2018-06-12 中国人民解放军总参谋部第六十研究所 A kind of straight line autonomous tracing in intelligent vehicle
CN110006404A (en) * 2019-04-15 2019-07-12 深圳市卫飞科技有限公司 A kind of las er-guidance robot system and its guidance method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0591344A (en) * 1991-09-26 1993-04-09 Olympus Optical Co Ltd Picture encoding device
JPH0793689A (en) * 1993-09-28 1995-04-07 Isuzu Motors Ltd Lane recognizing device
CN104917975A (en) * 2015-06-01 2015-09-16 北京空间机电研究所 Adaptive automatic exposure method based on object characteristics
CN108153307A (en) * 2017-12-21 2018-06-12 中国人民解放军总参谋部第六十研究所 A kind of straight line autonomous tracing in intelligent vehicle
CN110006404A (en) * 2019-04-15 2019-07-12 深圳市卫飞科技有限公司 A kind of las er-guidance robot system and its guidance method

Also Published As

Publication number Publication date
CN113655791A (en) 2021-11-16

Similar Documents

Publication Publication Date Title
CN106971152B (en) Method for detecting bird nest in power transmission line based on aerial images
CN108830196A (en) Pedestrian detection method based on feature pyramid network
WO2022236876A1 (en) Cellophane defect recognition method, system and apparatus, and storage medium
CN107369635B (en) Intelligent semiconductor equipment system based on deep learning
CN114971433B (en) Quality control method, device, equipment and storage medium based on industrial internet
CN116563293B (en) Photovoltaic carrier production quality detection method and system based on machine vision
CN110738644A (en) automobile coating surface defect detection method and system based on deep learning
CN110555373A (en) Concrete vibration quality real-time detection method based on image recognition
CN113902698A (en) Unmanned aerial vehicle holder progressive target focusing method based on intelligent visual control
CN116258682A (en) PCB solder paste defect detection method based on PSPNet and improved YOLOv7
CN115661161A (en) Method, device, storage medium, equipment and program product for detecting defects of parts
CN110827355B (en) Moving target rapid positioning method and system based on video image coordinates
CN116503760A (en) Unmanned aerial vehicle cruising detection method based on self-adaptive edge feature semantic segmentation
CN114863311A (en) Automatic tracking method and system for inspection target of transformer substation robot
CN113655791B (en) Vehicle tracking method and system based on linear CCD camera
CN113012228B (en) Workpiece positioning system and workpiece positioning method based on deep learning
CN117078677B (en) Defect detection method and system for starting sheet
CN114463395A (en) Monitoring equipment offset detection method, equipment and medium
CN116168019B (en) Power grid fault detection method and system based on machine vision technology
CN117746165A (en) Method and device for identifying tire types of wheel type excavator
CN109003268B (en) Method for detecting appearance color of ultrathin flexible IC substrate
CN105205485B (en) Large scale image partitioning algorithm based on maximum variance algorithm between multiclass class
Wang et al. Assembly defect detection of atomizers based on machine vision
CN112084941A (en) Target detection and identification method based on remote sensing image
CN111259981B (en) Automatic classification system after remote sensing image processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant