Image Segmentation Method for Complex Vehicle Lights Based on Adaptive Significance Level Set
2014-04-18JiaDongyaoZhuHuaihuaAiYankeandZouShengxiong
Jia DongyaoZhu HuaihuaAi Yanke and Zou Shengxiong
1 Introduction
Vehicle identification technology is a key technology to intelligent traffic management system.The current vehicle recognitions are mostly based on the vehicle license and overall appearance of the car.In addition,studies about other features of cars are relatively insufficient.With the development of ITS(Intelligent Transport System),a more precise classification model is urgently needed in order to meet the requirements of the police surveillance,transport and logistics,pub-lic safety,management and so on.Considering that the car designers of different brands and different models design the car’s headlights distinctively and auto headlights have many good features such as position-clear,less susceptible to contamination,vehicle identification technology based on different characteristics of the car headlights region has important theoretical and practical significance to solve such problems.Thus an accurate detection of the contour of headlights is the key of this work.After getting a precise outline of the headlights and on the basis of the characteristic parameters of headlight area,excellent classification is designed to complete more accurate identification of the vehicle models.
Edge-based extraction plays an important role in image segmentation and in the extraction of the target area.There are several techniques to obtain the segmentation of objects represented in images;for example,those based on:image gradient[Canny(1986)],deformable models[Oliveira(2007);Taylor,Francis,Vasconcelos and Tavares(2008)];level set methods,[Wang and Wang(2006);Wang,Lim,Khoo and Wang(2007a);Wang,Lim,Khoo and Wang(2007b)];as well as physical modeling[Gonçalves,Tavares and Jorge(2008)].For a review on object segmentation see,for example[Ma,Tavares,Jorge,Mascarenhas(2010);Zhang(2001);Zhang and Lu(2004);Gonzalez and Wood(2008);Ma,Tavares,Jorge and Mascarenhas(2010)].In the presence,there are various edge contour detection algorithms,gray gradient operator(Sobel,Robert,Laplace,Canny,etc.)has been widely studied and applied practically because of the small amount of computation.However,internal reflection of the headlights is unevenly,causing a big noise inside and outside the lights,and the gray change at the edge area is not significant.When using the segmentation algorithm with gray gradient operator,it may cause targeted edge fracture and a large number of pseudo-edge phenomena which make it difficult to extract the real edge.A solution[Li,Lu and Li(2007)]based on repair method of the edge,using gray gradient operator to target the edge,is proposed to extract the target contour and then track and repair the image edge,while Canny operator is often used to get a better edge.Meanwhile,for the edge fracture problem caused by the detection,template guide method and morphological method are proposed respectively in the literature[Liang and Huang(2006)],while these methods have drawbacks such as low adaptive degree,complicated calculation and different guiding templates being applied to different applications.
Level set method[Li and Fox(2005)]proposed by Osher and Sethian has attracted attention of many scholars,since the image segmentation shows good performance and efficient numerical scheme.Compared with traditional edge contour extraction method,level set method can automatically handle changes in topology in the process of curve evolution,and can effectively detect the target object segmentation with complex shapes,and can be easily extended to multi-dimensional case.The accuracy of segmentation,anti-noise ability,stability and robustness of level set method is much better than the traditional image segmentation method,so it is widely used in the field of image processing,analyzing and understanding.However,the realization of level set method depends on the solution of partial differential equations,and the level set function is periodically re-initialized to maintain the stability in the process of curve evolution.As a result,the high computational complexity and the low efficiency greatly limit the application of the algorithm in real-time systems.Meanwhile,this method is sensitive to initial contour position,needing to manually set the initial data,which leads to low adaptive degree.Based on the analysis above,an improved level set extraction algorithm based on twodimensional convex hull contours is proposed,which can adaptively set the initial contour,protect the edge information.Finally the algorithm is verified by identifying the car headlights’contour curve correctly.
2 Level set evolution algorithm based on Li model
In the process of curve evolution,due to the interference of the noise and discrete of the images,the level set function vibrates over a period of time and gradually loses its smoothness and the characteristics of the distance function,resulting in sharp angle or flat phenomenon,thus the final calculation results deviate from the true circumstances.Therefore,the level set function must be re-initialized to get close to the signal distance function so as to ensure the stability of the numerical solution.The method proposed by Li in 2010 in this paper imitates the level set evolution algorithm without re-initialization[Li,Xu and Gui(2010)].Embedding an energy penalty term in the energy function and adding constraint information to the energy level function of the active contour model,the level set function can quickly be driven close to a signal distance function without re-initializing the level set function.
With the defined functionalP(φ)above,the following variational formulation is proposed:
Whereµ>0,µP(φ)is used to punish the deviation between the signal distance function andφ(x,y,t),εg.λ.v(φ)is an external energy function,driving the level set function moving to the targeted zero boundary.
The equation(2)is the gradient flow that minimizes the functionalε.For a particular functionalε(φ)defined explicitly in terms ofφ,the Gateaux derivative can be computed and expressed in terms of the functionφand its derivatives.
The variational formulation in(1)is applied to active contours for image segmentation so that the zero level curve ofφcan evolve to the desired features in the image.For this purpose,the energyεmis defined as a functional that depends on image data,and therefore it is called the external energy.Accordingly,the energyP(φ)is called the internal energy of the functionφ,since it is a function ofφonly.
According to the gradient flow(2)that minimizes the functional(1),the zero level curve is moved by the external energyεmduring the evolution ofφ.Meanwhile,due to the penalizing effect of the internal energy,the evolving functionφis automatically maintained as an approximate signed distance function during the evolution according to the evolution(2).Therefore the re-initialization procedure is completely eliminated in the proposed formulation.
whereGδis the Gaussian kernel with standard deviationδ.An external energy for a functionφ(x,y)is defined as below:
whereλ>0 andvare constants,and the termsLg(φ)andAg(φ)are defined by
It is well known that the energy functionalLg(φ)in(4)computes the length of the zero level curve ofφin the conformal metricds=g(C(p))|C(p)|dp.The energy functionalAg(φ)in(5)is introduced to speed up curve evolution.Note that,when the function g is a constant,the energy functional in(5)is the area of the regionΩ−φ={(x,y)|φ(x,y)<0}.The energy functionalAg(φ)in(5)can be viewed as the weighted area of Ω−φ.The coefficientvof Ag can be positive or negative,depending on the relative position of the initial contour to the object of interest.For example,if the initial contours are placed outside the object,the coefficientvin the weighted area term should take positive value so that the contours can shrink faster.If the initial contours are placed inside the object,the coefficientvshould take negative value to speed up the expansion of the contours.
In practice,the Dirac delta functionδand Heaviside functionHin the functionalsLg(φ)andAg(φ)are approximated by the following smooth functionsδε(x)andHε(x)as in many level set methods,defined by:
With the Dirac delta functionδand Heaviside functionHin(4)and(5)being replaced byδε(x)andHε(x),the energy functional is then approximated by
This energy functional(8)can be minimized by solving the following gradientflow:
This gradient flow is the evolution equation of the level set function in the proposed method.The first term on the right hand side in(9)is associated with the distance regularization energyP(φ),The second and the third term in the right hand side of(9)correspond to the gradient flows of the energy functionalLg(φ)andAg(φ)respectively,and are responsible for driving the zero level curve towards the object boundaries.
3 Image segmentation method based on adaptive significance level set
When level set algorithm based on Li-model is used for image segmentation,the initial defined curve can be driven to evolve in the normal direction,and it quickly detects the image edge of the target to stop the evolution so as to position the outline edge region of the image.In the car image,it is obvious to find that the contour lines of the edge are clear and easy to distinguish,therefore this algorithm can be free from the interference of the body and its background color while extracting the edge of the lights.While it has achieved good results in image segmentation,the level set algorithm based on Li-models also has some problems at the same time:
2.The initial curve needs to be defined when level set model is adopted to segment the image.As the conventional active contour model containing the Li-based model level set algorithm is used,the position of the initial curve and the sign of evolution velocity of the constant need to be manually set(The initial curve required to encircle or be embedded inside the target boundary).As a result,the image segmentation is hard to be adaptive,and has more iterations and longer computing time.
To solve these problems,some improvements are put forward in the following aspects:
3.1 Improvement in filtering function
In order to filter out noise while effectively protecting the image edge information,the above model Gaussian filter function is improved to a regularized nonlinear anisotropic diffusion equation(PM equation)[Liu,Zhang and Wu(2013);Zhou,He and Yuan(2010)]:
I(x,y)andGσin this equation are the same as those stated above.This equation utilizes the gradient magnitude values of the images to combine the detection of the image edge and the filtering while ensuring filtering so thatthe Diffusion coefficientg(|∇Iδ|)can be changed according to the image information,and the Diffusion coefficient reaches its minimum value at the edge of the image.
This method combines the single-scale gaussian smoothing with the regularized PM equation.Firstly,the gradient modulus values are obtained after Gaussian filtering is applied to the image,and then the edge is judged on the basis of the size of iteration gradient|∇Iδ|,after which the regularized PM equation is adopted to get the image that already applied nonlinear diffusion filtering.The solution of the calculation above is the image after regularized PM equation filtering.Consequently,this method can remove the noise as well as maintaining the edge information,which can help calculate the gradient modulus values of the image accurately.
3.2 Adaptive positioning of the significant initial contour evolution curve
For the level set active contour models,the initial closure contour evolution curve should be around the headlights area and approach the true edge in order to get contour detection results of the level set algorithm with the fastest speed,the highest accuracy and the least iterations.After a comparative investigation on a large number of the light edges,it is easy to find that the edge located at the bottom of the real edge is basically a straight line,and the real edges on the right and the top are also close to straight lines[Zhang,Song and Zhang(2010)].However,the simulation results show that the shape of Pseudo-edges extracted,using edge detection algorithm,is usually irregular.On the basis of the content above,this paper presents an adaptive positioning algorithm of significant initial contour curve grounded on two-dimensional convex hull.Firstly,the edge images initially extracted are to be transformed by Hough Transform in order to enhance the true edges of the target image.Then,the two-dimensional convex hull algorithm based on angle is used to obtain a preliminary closure contour evolution curve.In this process,algorithms are designed to amend the concave region of the target image,in order to make sure that the initial outline of the evolution curve is closer to the true image edge and minimize iterations to improve the approximation level and accuracy rate.
The overall algorithm flow is showed in Figure 1.
3.2.1Target real edge enhancement algorithm
Steps of the algorithm are as follows:
Step 1:Canny operator having a meticulous edge detection effect is used to process the initial imageI1(x,y),and then filtering and morphological processing are applied to the results effectively to minimize the noise disturbance,and finally binarization is adopted to get the imageI1(x,y).
Step 2:The arithmetic idea of Hough transform introduces the correspondence between points and lines in the Cartesian and polarcoordinate system thata pointof the Polar coordinates corresponds to a straight line in the original image coordinate system and a point of the original image coordinates changes to a straight line in the Polar coordinates.So after Hough transform is applied to the non-zero linear point inI1(x,y),several corresponding contour segments lead to a larger local maximum in spaceθ−ρ.And the coordinates of local maximum can be obtained,finally corresponding line segments can be drawn in the original binary imageI1(x,y)after inverse Hough transform;
Step 3:The straight edges extracted after the Hough transform are detected one by one and the midpoints of all the line segments above can be the starting point of detection.Then the line segments are scanned gradually from the starting point to the two ends until the intersection of line segments inI1(x,y)appears.And then make this intersection as the endpoint of the straight line edge.With a cycle process sequentially,one part of the initial contour area can be detected.
3.2.2Determine the initial evolution curve with Two-dimensional convex hull algorithm based on the angle
Two-dimensional convex hull is the minimum simple convex polygon containing allpointswithin the planarpointsetand its Vertex isin the setaswell.In the convex hull,the points located on the straight line between the two convex points is also on the convex hull,but they are not the convex points.And how to find the convex point is the key for the convex hull algorithm[Wu and Wang(2007);Jiang and Feng(2012);Achanta,Hemami and Estrada(2009);Bai,wang and liang(2012)].Therefore the improved planar point set convex hull algorithm based on angle is put forward in this paper,and all the convex points is obtained with the largest angle and by a clockwise direction,finally the initial contour evolution curve can be drawn.
Figure 1:Adaptive positioning of the significant initial contour evolution curve based on two-dimensional convex.
The steps of this algorithm are as follows:
Step1:Determine the midpoints of N edged line segments of headlight imagemiddle(i,N)(i=1,2...N);
Step2:Scan each edge segment sequentially from its midpoint to the two ends along the respective edge line in order to get the two endpointsdi1anddi2.Totally 2N endpoints can be obtained;
Step4:Determine the second convex point T2 by the maximum angle between the (2N−1)lines formed by the rest of the(2N−1)points withT1and the level line;
Step5:Determine the next convex point by the maximum angle between the(2N−
1)lines formed by the rest of the(2N−2)points withT2and the line formed byT2andT1.When a point to meet the maximum angle is not unique,make farthest point with the last convex point as the convex point here.
Processing every edge segmentby clockwise direction,the polygonalY(x,y)formed is the initial contour area of the level set model after every convex point is connected.
Simulation results of the above steps are shown in Figure 2.
3.2.3Concave area determination and automatic correction of the initial evolution curve
On the basis of the procedure above,morphological filtering and region filling technologies are adopted to the image calculated by the convex hull algorithm and the image afteredged detection so asto determine the degree ofapproximation between the convex hull of the original target and the original target image.
Wherenrepresents the total number of pixels of the image,Xirepresents the gray value of the points in target convex hull filled area of the original image andYirepresents the gray value of the filled image of original headlights.
Evaluate the degree of approximation by the size ofD,and preset a certain Thresholdk:
(1)IfD>k,it is determined that the original target is convex.The initial curveY(x,y)extracted by the improved two-dimensional convex hull algorithm based on the angle can accurately approximate the true boundary target;
Figure 2:Significant initial contour adaptive locating results.
(2)If D<k,it is determined that there is Concave area in the original target image.For concave region,there are various methods of Concave point detection,but these methods over-rely on the original image pixel units in accuracy,resulting to many calculation errors.Therefore,in this paper,the Image convex regionI2(x,y)is defi ned as below:
WhereY(x,y)is the initial evolution curve of the target image and the definition ofI1(x,y)is the same as above.
And then convex point detection toI2(x,y)is carried out with the improved twodimensional convex hull algorithm based on the angle.By converting the Concave area to the convex point detection problem,the accuracy of Concave point detection is improved,and the initial closure contour curve is closer to the true target edges.
The steps of the algorithm are as follows:
Step1:Getthe convex hullY1(X,Y)ofthe targetarea using improved two-dimensional convex hull algorithm based on the angle;
Step 2:Subtract the convex hull of the target image of the Concave area with the original target area to obtain the Inner weld convex region and deal this region with two-dimensional convex hull detection;
Step 3:Determine whether the coordinate of the candidate of the Coordinate convex point collection is in the boundary of the convex hull of the target area obtained in Step 2,thereby removing the pseudo-convex point;
Step 4:Calculate the distancedisbetween points within the same Inner weld convex region,ifdis<3,they are considered as the same convex point,then merger those convex points;
Step 5:Correct convex borders obtained in the first step one by one to guarantee them to approach the boundary of the concave area.Thus they can be more closer to the true object boundary.
3.3 The improved level set model
The regularized nonlinear anisotropic diffusion equation and the initial contour evolution curveof adaptive positioning are combined to construct a new level set evolution equation:
whereg′=1/(1+|∇I′|2),I′isthe image filtered by regularized nonlinearanisotropic diffusion equation.φ′is the initial contour evolution curve of adaptive positioning.After finite iterations,the zero level set ofφ′(x,y)is the final contour detection result.
4 Experiments and comparative analysis
The imagesin the article are taken ata certain distance from the rightside ofthe still automotive vehicle to ensure that the car headlights in the image can be represented as a whole and it is not obscured by other area of the vehicle.In order to ensure the validity and accuracy of this method,we randomly choose 10 different models with the male and female headlamps separately in a large parking lot,and each one is taken 5 pictures for processing to observe the effect.For your convenience,only two of the many headlamps of the two kinds are illustrated below.
The experimental environment is a PC of Intel core i5-2430M 2.4GHz CPU,2GB DDR,Windows 7 OS.The software is Matlab 2010a.The Experimental images are the car headlights image with different shape whose size is 320*200.To ensure the scientific results,the comparative experiment parameters are the same.And the variables of Dirac function,ε=1.5,µ=0.04,λ=5,v=1.5 form the distance constraint information and then are added to the level energy function of the active Contour Models.Selection of the values of the parameters is based on a priori knowledge,then the optimal parameters to depict the lights outline curve are selected by constantly adjusting the parameters.
Comparison of the different segmentation effects in the noise-free case between the level set algorithm based on the Li-model and the improved algorithm for image segmentation is shown in Figure 3;Figure 4 shows the different segmentation results after Gaussian white noise with average zero and variance of 0.2 is added to the original headlights image.The yellow solid line is the initial evolution curve.When determining the initial artificial evolution curve,a rectangular area in the center of the lights is selected according to the area of lights.For convenient contrast,the same artificial initial evolution curve is used.The experimental results also show that adaptive evolution curve is basically the same before and after the white noise is added,which means that adaptive method for determining the evolution curve has some anti-jamming capability.
Figure 3:Contrast of punch lights segmentation between the original model and the proposed model of in noise-free conditions.
Comparison of the segmentation results in Figures 3 and 4 shows that the lamp’s vertex angle cannot be segmented accurately with the set algorithm based on Li model under the influence of the bad illumination condition and the noise.And it seriously affects the accuracy of the vehicle identification based on the lights’characteristic parameters,since the vertex angle is an important feature of lights.Also,A2 and A3,B2 and B3 in figure 3,C2 and C3,D2 and D3 in figure 4 show that the improved model can better describe the lamp,when taking lamp image segmentation effect into consideration.
Figure 4:Contrast of punch lights segmentation between the original model and the proposed model of in Gaussian white noise.
4.1 Segmentation accuracy comparison of different models
In order to compare the segmentation results of different models more precisely,DSC indicator is used to measure the accuracy of segmentation.DSC indicator is defined as follows[Balla-Arabe and Gao(2012);Shattuck,Sandor-Leahy and Chapers(2001)]:
whereS1andS2represent the segmentation results and actual results,N(·)is the number of pixels in the image.The more the DSC indicator tends to 1,the more the segmentation is accurate.
Comparison between Li-model and the improved model in the accuracy of segmentation is shown in Table 1.From Table 1,in the absence of the noise,the gap of the segmentation accuracy rates of two models is narrow.But when there is noise,the segmentation accuracy of improved algorithm proposed in this paper has increased significantly,by an average of more than 5%.Results show that the improved model proposed in this paper can significantly improve the accuracy of image segmentation,further improve the filter function and effectively protect the information of edges.Note that,the improved model have a better anti-jamming capability than Li-modal with or without noise.
Table 1:Comparison between Li-models and the improved model in the accuracy of segmentation.
4.2 Comparison of different models in segmentation efficiency
Comparison between Li-model and the improved model in segmentation efficiency is shown in Table 2.Under the noisy and noise-free conditions,the proposed improved level set contours algorithm based on the two-dimensional convex hull has been improved in iterations and the running time compared with the Li model,which can meet the real-time requirements of headlight image segmentation.This further demonstrates that the improved algorithm proposed in this paper can significantly improve the efficiency of the algorithm,due to fully consideration of the regional characteristics information of the image,and adaptively locate the initial evolution curve.Note that,the improved model have a better anti-jamming capability than Li-modal with or without noise.
Table 2:Comparison between Li-model and the improved model in segmentation efficiency.
5 Conclusion
This paper analyzed the headlights image segmentation method based on adaptive significant level set contour model,it has the following innovations and benefits:
(1)To solve the blurred image problem arose when using Gaussian filter to remove image noise in the level set of Li model,the regularized P-M equation is put forward,which can remove the noise and effectively protect the edge information of image at the same time;
(2)As the level set model for image segmentation lights need to manually determine the initial evolution curve,Adaptive positioning algorithm of the significant initial contour based on two-dimensional convex hull is designed to improve the automation level of the model.
Simulation results show that the improved model is of better anti-interference ability,higher accuracy and segmentation efficiency.And it can accurately segment images of different lights,which has great practical value for the development of intelligent transportation systems.Based on the proposed algorithm,our next target is to design optimized classifier,and to complete the accurate classification of car models.
Achanta,R.;Hemami,S.;Estrada,F.et al.(2009):Frequency-tuned Salient Region Detection.IEEE International Conference on Computer Vision and pattern Recognition(CVPR2009),pp.1597-1604.
Bai,X.;Wang,W.;Liang,J.(2012):An Active Contour Model Based on Region Saliency for Image Segmentation.Journal of Computer Research and Development,vol.49,no.12,pp.2686-2695.
Balla-Arabe,S.;Gao,X.(2012):Image multi-thresholding by combining the lattice Boltzmann model and a localized level set algorithm.Neurocomputing,vol.93,no.9,pp.106-114.
Canny,J.(1986):A computational approach to edge detection.IEEE Transactions Pattern Analysis and Machine Intelligence,vol.8,no.6,pp.679-698.
Gonçalves,P.C.T.;Tavares,J.M.R.S.;Jorge,R.M.(2008):Natal Segmentation and simulation of objects represented in images using physical principles.CMES:Comput.Model.Eng.Sci.,vol.32,no.1,pp.45–55.
Jiang,H.;Feng,R.(2012):Image Segmentation Method Research Based on Improved Variational Level Set and Region Growth.Acta Electronica Sinica,vol.40,no.8,pp.1659-1664.
Li,X.;Lu,C.;Li G.(2007):A Patching Method for Edges Detected by Canny Detector Based on Two-step Gradient Image.Journal of Optoelectronics laser,vol.18,no.3,pp.377-380.
Liang,L.;Huang,Y.(2006):Path Recognition by Fusing Canny Operator and Morphology.Computer Engineering,vol.32,no.21,pp.200-202.
Li,C.;Fox,M.D.(2005):Level set evolution without re-initialization:a new variational formulation.Proc of IEEE Computer Society Conference on Computer Vision and Pattern Recognition,pp.430-436.
Li,C.;Xu,C.;Gui,C.(2010):Distance regularized level set evolution and its application to image segmentation.IEEE Trans on Image Process,vol.12,no.19,pp.3243-3254.
Liu,L.;Zhang,Q.;Wu,M.et al.(2013):Adaptive segmentation of magnetic resonance images with intensity inhomogeneity using level set method.Magnetic Resonance Imaging,vol.31,no.4,pp.567-574.
Ma,Z.;Tavares,J.M.;Jorge,R.N.;Mascarenhas,T.(2010):A Review of Algorithms for Medical Image Segmentation and their Applications to the Female Pelvic Cavity.Computer Methods in Biomechanics and Biomedical Engineering,vol.13,no.2,pp.235-246.
Oliveira,F.P.M.;Tavares,J.M.R.S.(2009):Matching Contours in Images through the use of Curvature,Distance to Centroid and Global Optimization with Order-Preserving Constraint.CMES:Comput.Model.Eng.Sci.,vol.43,pp.91-110.
Shattuck,D.K.;Sandor-Leahy,S.R.;chapers,K.A.et al.(2001):Magnetic resonance image tissue classification using a partial volume mode.Neuroimage,vol.13,no.5,pp.856-876.
Vasconcelos,M.J.M.;Tavares,J.M.R.(2008):Methods to automatically built point distribution models for objects like hand palms and faces represented in images.CMES Computer Modeling in Engineering&Sciences,vol.36,no.3,pp.213-241.
Wu,C.;Wang,Z.(2007):An Improved Algorithm of Two Dimensional Convex Hull Based on Included Angle.Journal of Xinyang Teachers College(Natural Science Edition),vol.20,no.4,pp.508-510.
Wang,S.;Lim,K.;Khoo,B.;Wang,M.(2007a):A geometric deformation constrained level set method for structural shape and topology optimization.CMES:Computer Modeling in Engineering&Sciences,vol.18,no.3,pp.155-181.
Wang,S.;Lim,K.;Khoo,B.;Wang,M.(2007b):An unconditionally time-stable level set method and its application to shape and topology optimization.CMES:Computer Modeling in Engineering&Sciences,vol.21,no.1,pp.1-40.
Zhang,K.H.;Song,H.H.;Zhang,L.(2010):Active contours with selective local or global segmentation:a new formulation and level set method.Journal of Image and Vision Computing,vol.28,no.4,pp.668-676.
Zhou,B.;He,C.;jiang,Y.(2012):Edge-based active contourmodelwith adaptive varying stopping function.Application Research of Computers,vol.29,no.1,pp.366-368.