Vehicle detection method based on thermal imaging
09773174 ยท 2017-09-26
Assignee
Inventors
Cpc classification
G06V10/48
PHYSICS
G06F18/295
PHYSICS
International classification
Abstract
A vehicle detection method includes (1) vehicle likelihood region identifying step; (2) vehicle component locating step; and (3) vehicle detecting step. To reduce complexity of calculation and enhance accuracy of detection, the method uses a vehicle likelihood region identifying algorithm to eliminate background regions from a total thermal image and keep vehicle likelihood regions therein for use in further analysis and processing, detects obvious vehicle components, such as vehicle windows and vehicle bottoms, in the thermal image to thereby identify vehicle component likelihood regions, describes a space geometric relationship of vehicle components with a Markov random field model, defines vehicle detection as problems with maximum a posteriori probability, estimates the most likely configuration with an optimization algorithm, so as to effectuate vehicle detection.
Claims
1. A vehicle detection method based on thermal imaging, adapted to capture a total thermal image of a specific region, the vehicle detection method comprising: an initial vehicle likelihood region identifying step in which a signature cutting algorithm discerns initial vehicle likelihood regions and a background region in the total thermal image and deducts the background region by a background deduction technique to identify the initial vehicle likelihood region; a vehicle window locating step in which a border detection algorithm and a Hough transform detect an object component which has a feature that a pair of parallel horizontal lines are shown in a thermal image of the initial vehicle likelihood regions and a feature that a center of the thermal image is of low brightness, and the object component is regarded as a located vehicle window; a vehicle bottom locating step in which the border detection algorithm and the Hough transform detect an additional object component which has a feature that the thermal image of the initial vehicle likelihood regions is slender and a feature that the thermal image is of high brightness, and the additional object component is regarded as a located vehicle bottom; and a vehicle detecting step in which a space geometric relationship of the located vehicle window and vehicle bottom is described with a Markov random field, wherein, if the space geometric relationship conforms with a predetermined space geometric relationship, a region having the vehicle window and vehicle bottom with the space geometric relationship therebetween is regarded as an advanced vehicle likelihood region, thereby detecting a vehicle.
2. The vehicle detection method of claim 1, wherein the signature cutting algorithm comprises: a pixel point value defining step for defining numerical values of pixel points included in the total thermal image and attributed to a thermal image value larger than a least thermal image value of the vehicle likelihood region; a valid vertical area reserving step for calculating vertical projections of the numerical values of the pixel points of the total thermal image, cutting out invalid vertical areas with zero vertical projections, and reserving valid vertical areas with none-zero vertical projections; a valid horizontal area reserving step for calculating horizontal projections of the numerical values of the pixel points of the valid vertical areas, cutting out invalid horizontal areas with zero horizontal projections, and reserving valid horizontal areas with non-zero horizontal projections; and a vehicle likelihood region demarcating step for demarcating the valid horizontal areas as the vehicle likelihood regions.
3. The vehicle detection method of claim 2, wherein parameters of the vehicle window are defined as (c.sub.x, c.sub.y, w, h), wherein (c.sub.x, c.sub.y) denotes a center of the vehicle window, and (w, h) denotes width and height of the vehicle window.
4. The vehicle detection method of claim 3, wherein an upper horizontal line and a lower horizontal line are defined by equations as follows:
5. The vehicle detection method of claim 4, wherein u=(u.sub.x, u.sub.y) M.sup.(u) denotes a point of the upper horizontal line, and l=(l.sub.x, l.sub.y) M.sup.(1) denotes a point of the lower horizontal line, so as to vote for upper and lower horizontal points S={ (u, l) |u.sub.x=l.sub.x} on a vertical line and parameter space vehicle window (c.sub.y, h), wherein
6. The vehicle detection method of claim 5, wherein, before the Hough transform algorithm starts, a heat grayscale Gaussian model of the vehicle window is analyzed with a Gaussian model, and then a distance between the heat grayscale Gaussian model and a predetermined heat grayscale Gaussian model corresponding to the vehicle window is calculated, wherein, if the distance is larger than a predetermined threshold, the detection is regarded as wrong, so as to eliminate any wrongly identified vehicle window.
7. The vehicle detection method of claim 6, wherein the distance is expressed by an equation as follows:
8. The vehicle detection method of claim 7, wherein the border detection algorithm is a Sobel operator border detection algorithm.
9. The vehicle detection method of claim 1, wherein the Markov random field allows a space geometric relationship of the vehicle window and the vehicle bottom to be defined as a label problem, wherein, a graphical model G=(V, E) is provided, wherein V={v.sub.1, v.sub.2, . . . , v.sub.n} denotes vertices and corresponds to all detected components of vehicles, wherein E={e.sub.l, e.sub.2, . . . , e.sub.m} denote edges, indicating adjacent components of vehicles, wherein, according to the graphical model, a vehicle detection problem is described as how to match each vertex with one of three possible labels, namely false vertex (0), vehicle window (1), and vehicle bottom (2), wherein probability maximization-oriented labeling F={f.sub.1, f.sub.2, . . . , f.sub.n}, and is defined as follows:
Description
BRIEF DESCRIPTION
(1) Objectives, features, and advantages of the present invention are hereunder illustrated with specific embodiments in conjunction with the accompanying drawings, in which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
DETAILED DESCRIPTION
(18) Referring to
(19) A vehicle detection method based on thermal imaging disclosed in an embodiment of the present invention is adapted to perform vehicle detection. The vehicle detection method involves identifying a total thermal image TI.sub.t of a specific region R.sub.s (shown in
(20) The vehicle detection method comprises an initial vehicle likelihood region identifying step S11, a vehicle component locating step S12 and a vehicle detecting step S13, wherein the vehicle component locating step S12 further comprises a vehicle window locating step and a vehicle bottom locating step.
(21) Referring to
(22) In an ideal scenario, a traffic flow sensor (not shown) discerns the thermal images of the road R and the vehicles V.sub.1,V.sub.2 with the total thermal image TI.sub.t to thereby further calculates and determines that the number of vehicles (i.e., the number of the vehicles V.sub.1,V.sub.2) traveling on the road R per unit time is two. However, in practice, with the vehicles V.sub.1,V.sub.2 being different from each other in the surface material which they are made from, the distribution of heat on the surfaces of the vehicles V.sub.1,V.sub.2 is not uniform, and thus a portion of the thermal images of the vehicles V.sub.1,V.sub.2 is likely to mix with the thermal image of the road R. As a result, the portion of the thermal images of the vehicles V.sub.1,V.sub.2 is mistakenly attributed to the road R, and in consequence the number of vehicles traveling on the road R per unit time cannot be accurately calculated.
(23) To distinguish the thermal images of the vehicles V.sub.1,V.sub.2 from the thermal image of the road R, an embodiment of the present invention entails performing a signature cutting algorithm on the total thermal image It.
(24) Referring to
(25) Referring to
(26) The signs marked in
(27) Referring to
(28) Referring to
(29) Referring to
(30) In another embodiment, when using the signature cutting algorithm, the pixel point value defining step S21 is followed by the valid horizontal area reserving step S23, the valid vertical area reserving step S22, and the vehicle likelihood region demarcating step S24 sequentially.
(31) By following the above steps, the initial vehicle likelihood regions ROI.sub.1 can be confirmed, and thus it is confirmed that the total thermal image TI.sub.t is divided into two areas (demarcated by bold lines). After the initial vehicle likelihood regions ROI.sub.1 has been confirmed, the background region is deducted by a background deduction technique to identify the initial vehicle likelihood regions ROI.sub.1.
(32) However, the initial vehicle likelihood regions ROI.sub.1 is a piece of vehicle-related information which is not complete and correct; hence, it is necessary for the initial vehicle likelihood regions ROI.sub.1 to undergo image processing further in order to acquire complete and correct vehicle information. The aforesaid complete and correct vehicle information is hereunder known as an advanced vehicle likelihood region ROI.sub.2.
(33) To obtain the advanced vehicle likelihood region ROI.sub.2, components, such as a vehicle window and a vehicle bottom, of the vehicles V.sub.1,V.sub.2 are located to thereby further confirm the vehicles V.sub.1,V.sub.2. For example, if two vehicle bottoms are located in a locating step, it means that there are only two vehicles (because each vehicle can have only one vehicle bottom).
(34) Moreover, since vehicle windows and vehicle bottoms each have obvious features, the locating step is dedicated to locating vehicle windows and vehicle bottoms, but the present invention is not limited thereto; instead, any vehicle component can be regarded as one which can be located, provided that the vehicle component has an obvious feature.
(35) Locating a vehicle window requires that features of a thermal image of the vehicle window be defined as follows: (1) the thermal image shows a pair of parallel horizontal lines (i.e., an upper horizontal line and a lower horizontal line); and (2) the center of the thermal image is of low brightness.
(36) To find a region attributed to the initial vehicle likelihood regions ROI.sub.1 and indicative of a feature of the vehicle window, this embodiment involves performing a detection process with the border detection algorithm and the Hough transform. Specifically speaking, this embodiment entails using a Sobel operator border detection algorithm mask to detect a horizontal line, and, in particular, using the mask to calculate an x-direction gradient and a y-direction gradient to thereby detect the margin of a vehicle component having the feature. Regarding a horizontal line, since its left and right thermal image values are substantially symmetrically distributed, the mask value of its x-direction gradient value G.sub.x should approach 0, whereas the y-direction gradient value G.sub.y of the upper horizontal line of the vehicle window is a negative value because the thermal image value of its upper half is large. Conversely, the lower horizontal line of the vehicle window is a positive value
(37) The parameters of the vehicle window are defined as (c.sub.x, c.sub.y, w, h), wherein (c.sub.x, c.sub.y) denote the center of the vehicle window, and (w, h) denote the width and height of the vehicle window. The upper horizontal line and the lower horizontal line are defined by equations as follows:
(38)
(39) Then, u=(u.sub.k, u.sub.y)M.sup.(u) denotes a point of the upper horizontal line, and l=(l.sub.x, l.sub.y) M.sup.(l) denotes a point of the lower horizontal line, so as to vote for upper and lower horizontal points S={(u, l)|u.sub.x=l.sub.x} on a vertical line and parameter space vehicle window (c.sub.y, h), wherein
(40)
(41) After a parameter space voting result has been obtained, a parameter of region vote maximization is regarded as a possible candidate H={c.sub.y.sup.(i), h.sup.i}.sub.i=1.sup.N.sup.
(42)
(43) Given the processing and computation performed with the aforesaid equations, it is feasible to identify a region and position which conform with the features of the vehicle window such that the vehicle window can be clearly located.
(44) However, due to background noise and vehicle concealment, the aforesaid Hough transform algorithm yields plenty results of erroneous vehicle window detection. To solve the aforesaid problem effectively, an embodiment of the present invention entails analyzing and expressing the distribution of brightness (i.e., usually the distribution of low heat) of vehicle windows in a thermal image in advance with a Gaussian model, and calculating the distance between it and heat grayscale brightness attributed to the vehicle window region and detected with the Gaussian model. If the distance is larger than a configured threshold, the detection is regarded as wrong. Therefore, a wrongly-identified vehicle window can be efficiently ruled out.
(45) If (.sub.i, .sub.i) and (.sub.j, .sub.j) denote the means and standard deviations of the model and the vehicle window Gaussian distribution, respectively, then the distance between the two distributions is defined as the Bhattacharyya distance and expressed by the equation below.
(46)
(47) After the vehicle window has been located, the vehicle bottom has to be located. The features of the thermal image of the vehicle bottom include: (1) it is slender; and (2) the thermal image taken with a thermal imaging camera is of high brightness (because heat generated from the vehicle in operation reflects off the ground to reach the vehicle bottom).
(48) To find any feature indicative of the vehicle window in the initial vehicle likelihood regions ROI.sub.1, this embodiment involves performing a detection process with the border detection algorithm and the Hough transform too. Specifically speaking, the detection process entails detecting all the horizontal marginal points in a thermal image, recording the position of a shade with a one-dimensional flag array, wherein each element in an array is initialized to 0, moving the array in the down-to-top direction, and setting any related flag to 1 if the related position is a shaded element. If, in the array, the ratio of the flags carrying the value 1 to those not carrying the value 1 is larger than a configured threshold, the array vertical coordinate will be recorded and regarded as the vertical coordinate of the vehicle bottom.
(49) Specifically speaking, high-brightness pixel points in a foreground image are identified by thresholding as follows:
(50)
(51) After the horizontal lines of all possible vehicle bottoms have been identified, each line is regarded as a region of a vehicle bottom. Afterward, paired adjacent regions of a pair of vehicle bottoms in the y-direction are integrated to form a region of a vehicle bottom if the horizontal overlap ratio of the lines is larger than a configured threshold; this integration process will repeat until no more regions of vehicle bottoms are available for integration. l.sub.1 and l.sub.2 denote horizontal lengths of regions of two vehicle bottoms, respectively, and are defined as the lengths of their horizontal overlap lines, respectively, and thus overlap ratio OR (l.sub.1,l.sub.2) is defined with the equation below.
(52)
(53) Upon computation and processing with the above equations, the positions of the vehicle bottoms can be identified and thus clearly located.
(54) After the vehicle windows and the vehicle bottoms have been located, the vehicle detecting step S13 begins and entails detecting a space geometric relationship of the vehicle windows and the vehicle bottoms.
(55) In the vehicle detecting step S13, this embodiment entails describing, with a Markov random field, a space geometric relationship of the vehicle windows and the vehicle bottoms which have been located and then estimating the most likely configuration with an optimization algorithm whereby, if the space geometric relationship conforms with a predetermined space geometric relationship, any region where a vehicle window and a vehicle bottom associated with each other by the space geometric relationship are present is regarded as the advanced vehicle likelihood region ROI.sub.2, so as to obtain complete vehicle-related information, thereby detecting the vehicles.
(56) Furthermore, the Markov random field allows a vehicle detection problem to be defined as a label problem. The Markov random field describes a space geometric relationship of objects according to a data structure which is graphically presented. Assuming that a graphical model G=(V, E) is provided, wherein V={v.sub.1, v.sub.2, . . . , v.sub.n} denotes vertices and corresponds to all the detected components of vehicles, wherein E={e.sub.l, e.sub.2, . . . , e.sub.m} denote edges, indicating adjacent components of vehicles. According to the aforesaid model, a vehicle detection problem can be described as how to match each vertex with one of three possible labels, namely false vertex (0), vehicle window (1), and vehicle bottom (2), wherein, preferably, probability maximization-oriented labeling F={f.sub.1, f.sub.2, . . . , f.sub.n}, and it is defined as follows:
(57)
(58) Specifically speaking, the thermal image regions of vehicle windows and vehicle bottoms are presumably expressed as {H.sub.1.sup.(w), H.sub.2.sup.(w), . . . , H.sub.N.sub.
D.sub.h(H.sub.i,H.sub.j)=max(l.sub.i,l.sub.j)min(r.sub.i,r.sub.j)
D.sub.v(H.sub.i,H.sub.j)=max(t.sub.i,t.sub.j)min(b.sub.i,b.sub.j)
(59) The Markov random field describes the space geometric relationship of an object according to a data structure which is graphically presented. The aforesaid graphical representation is characterized in that each element in a vertex set corresponds to a component of the aforesaid vehicle. Each element in an edge set connects with two vertices, if there is spatial geometric dependency between the two. Referring to the left diagram of
(60) Regarding the hypothesis of the presence of a vehicle window H.sub.i.sup.(w) and a vehicle bottom H.sub.j.sup.(u), if both of them satisfy three rules defined below (as shown in
(61) (1) H.sub.j.sup.(u) is below H.sub.i.sup.(w), i.e., b.sub.i.sup.(w)<t.sub.j.sup.(u); (2) in the horizontal direction, H.sub.j.sup.(u) includes H.sub.i.sup.(w), i.e., l.sub.i.sup.(w)>l.sub.j.sup.(u) and r.sub.i.sup.(w)<r.sub.j.sup.(u); and (3) assume that the vertical distance between H.sub.i.sup.(w) and H.sub.j.sup.(u) is small and is defined as:
D.sub.v(H.sub.i.sup.(w),H.sub.j.sup.(u))4(b.sub.i.sup.(w)t.sub.j.sup.(u))
(62) Regarding the vehicle window, it is assumed that H.sub.i.sup.(w) and H.sub.j.sup.(w) must satisfy two criteria:
(63) (1) assume that H.sub.i.sup.(w) and H.sub.j.sup.(w) overlap each other in the horizontal direction, i.e., D.sub.v(H.sub.i.sup.(w),H.sub.j.sup.(w))0; and (2) assume the vertical distance between H.sub.i.sup.(w) and H.sub.j.sup.(w) is small and is defined as:
(H.sub.i.sup.(w),H.sub.j.sup.(w))max(b.sub.i.sup.(w)t.sub.i.sup.(w),b.sub.j.sup.(w)t.sub.j.sup.(w))
(64) Regarding the vehicle bottom, it is assumed that H.sub.i.sup.(u) and H.sub.j.sup.(u) must satisfy a criterion: assume that H.sub.i.sup.(u) and H.sub.j.sup.(u) overlap each other in the horizontal direction, i.e., D.sub.h(H.sub.i.sup.(u),H.sub.j.sup.(u))0
(65) Referring to
(66) Since the relationship of vehicle components is graphically expressed according to the aforesaid Markov random field, it is assumed that f.sub.i denotes a random variable for matching vertices v.sub.i with labels l.sub.i L={0.sub.u, 1.sub.u, 0.sub.w, 1.sub.w}, wherein (0.sub.u, 1.sub.u) denotes regions of false and true vehicle bottoms, respectively, and (0.sub.w, 1.sub.w) denotes regions of false and true vehicle windows, respectively. ={l.sub.1, l.sub.2, . . . , l.sub.|V|} denotes a configuration, i.e., a likelihood hypothesis, wherein a vehicle detection problem is described as putting forth a hypothesis which conforms best with existing image observations in a possible configuration of configuration space 4.sup.|V|. In this embodiment, the configuration hypothesis is defined as a maximum a posteriori probability (MAP) approach to currently observed images so as to assume a configuration {tilde over ()} for maximizing a posteriori probability as follows:
(67)
(68) To define a likelihood probability, it is necessary to define normalized average gray .sub.I and foreground ratio .sub.F:
(69)
(70)
(71) Since a region of a vehicle window differs from a region of a vehicle bottom in average brightness and foreground ratio, two sigmoid functions are defined and adapted to calculate the likelihood probability of each vehicle component as follows:
(72)
(73) The prior probability Pr() is based on the Markov random field model and adapted to define and describe a spatial dependency between vehicle components. In general, the prior probability is defined as follows:
(74)
(75) The singleton probability mainly specifies whether a vehicle component is truly probable. In this embodiment, a confidence index a of the position of a vehicle component is used as a basis of calculation and defined as follows:
(76)
(77) The pairwise probability mainly describes the hypothetic relation of mutual spatial dependency between vehicle components, wherein if e={v.sub.i, v.sub.j} and its corresponding hypothesis is about the region of a vehicle bottom, then only one of the two hypotheses is true vehicle bottom (l.sub.i=0.sub.u, l.sub.i=1.sub.u) or (l.sub.i=1.sub.u, l.sub.i=0.sub.u) with high probability, set it to 1.0; if both are wrongly identified vehicle bottom's region (l.sub.i=0.sub.u, l.sub.i=0.sub.u) with low probability, set it to 0.5; when both are true vehicle bottom's region (l.sub.i=1.sub.u, l.sub.i=1.sub.u), then the probability is inversely proportional to mutual horizontal overlap ratio and is defined by equations as follows:
(78)
(79) The above equations are illustrated with
(80) When two hypotheses mutually dependent on each other are about vehicle windows, their pairwise probability is similar to the regions of the aforesaid vehicle bottoms in terms of definition and concept. The main difference between them is as follows: if both are about vehicle window regions (l.sub.i=1.sub.w, l.sub.i=1.sub.w), then the probability is inversely proportional to their overlap ratio, wherein overlap ratio OR(.) is defined as follows:
(81)
(82) Regarding a hypothesis about vehicle windows with spatial dependency, its pairwise probability is defined as follows:
(l.sub.i=0.sub.w,l.sub.i=1.sub.w)=1.0
(l.sub.i=1.sub.w,l.sub.i=0.sub.w)=1.0
(l.sub.i=0.sub.w,l.sub.i=0.sub.w)=0.5
(l.sub.i=1.sub.w,l.sub.i=1.sub.w)=1.0OR(R(H.sub.i),R(H.sub.j))
(83) The above equations are illustrated with
(84) When two hypotheses are about regions of vehicle windows and vehicle bottoms, respectively, the pairwise probability is defined as follows:
(85)
(86) The aforesaid design concept is based on the fact that it is impossible for both to simultaneously direct to wrongly identified components of vehicles; hence, the probability is set to 0.0; the probability that both are simultaneously true is inversely proportional to the distance between the central positions of both.
(87) The above equations are illustrated with
(88) The vehicle detection method based on thermal imaging in this embodiment is further described below with an example.
(89) Referring to
(90) Hence, in this embodiment, components of vehicles are detected with the vehicle detection method according to foreground cutting results. Regions of vehicle windows and vehicle bottoms are two obvious features in thermal images of vehicles. Vehicle components in thermal images are effectively detected with the aforesaid detection algorithm. However, due to background noise, background regions are wrongly identified as vehicle components which are numbered 139 and 230 in
(91) To solve the aforesaid problems effectively, the vehicle detection method of this embodiment uses a Markov random field model in describing a spatial dependency between vehicle components with reference to a singleton probability and a pairwise probability, so as to achieve effective detection.
(92) By following the above steps, it is feasible to detect a space geometric relationship of a vehicle window and a vehicle bottom and thus identify a vehicle likelihood region, thereby estimating the number of vehicles traveling on the road R.
(93) Therefore, a vehicle detection method and a vehicle detection device for use with the vehicle detection method of the present invention enhance the stability and accuracy of thermal imaging vehicle detection by multiple different features and geometric relationships descriptive thereof
(94) The present invention is disclosed above by preferred embodiments. However, persons skilled in the art should understand that the preferred embodiments are illustrative of the present invention only, but should not be interpreted as restrictive of the scope of the present invention. Hence, all equivalent modifications and replacements made to the aforesaid embodiments should fall within the scope of the present invention. Accordingly, the legal protection for the present invention should be defined by the appended claims.