Edge binding and evaluation method for traffic expectation line

文档序号:1737525 发布日期:2019-12-20 浏览:11次 中文

阅读说明:本技术 一种交通期望线的边绑定以及评价方法 (Edge binding and evaluation method for traffic expectation line ) 是由 何兆成 罗良奎 朱依婷 于 2019-07-25 设计创作,主要内容包括:本发明涉及一种交通期望线的边绑定以及评价方法,具体的过程包括:通过利用摄像头拍摄经过各个道路交叉口的车辆信息得到车辆的行驶路径,将行驶路径的起点与终点统称为顶点,通过聚类算法从顶点中筛选出控制点;通过将控制点连接起来形成交通期望线,采用力引导模型将交通期望线进行绑定,并对对交通期望线绑定后的效果进行评价。本发明将顶点进行聚类,减少原始图输入的顶点数量,解决了边绑定技术方法在大规模交通数据集的应用难点。同时,本发明提出了边绑定的量化指标。基于像素灰度强度的差异,提取了边绑定前后图像的角点特征,结合交通数据的时间维度信息,提出图像变化强度,能够较好地反映绑定效果。(The invention relates to an edge binding and evaluation method of a traffic expectation line, which comprises the following specific processes: the method comprises the steps that a camera is used for shooting information of vehicles passing through each road intersection to obtain a driving path of the vehicles, the starting point and the end point of the driving path are collectively called as vertexes, and control points are screened out from the vertexes through a clustering algorithm; the control points are connected to form a traffic expectation line, the traffic expectation line is bound by adopting a force guidance model, and the bound effect of the traffic expectation line is evaluated. The invention clusters the vertexes, reduces the number of the vertexes input by the original graph, and solves the application difficulty of the edge binding technical method in a large-scale traffic data set. Meanwhile, the invention provides the edge binding quantization index. Based on the difference of the gray intensity of the pixels, the corner features of the images before and after edge binding are extracted, the time dimension information of traffic data is combined, the image change intensity is provided, and the binding effect can be well reflected.)

1. An edge binding and evaluation method for a traffic expectation line is characterized by comprising the following steps:

step S1: shooting the vehicle information passing through each road intersection by using a camera, and obtaining traffic information about the vehicle by combining with traffic network data;

step S2: taking a road section between a road intersection where two cameras with the minimum time difference shoot the same license plate as a running path of a vehicle with the license plate, and marking the two cameras as a starting point and an end point of the running path of the vehicle according to the morning and evening of the time when the two cameras shoot the license plate;

step S3: the starting point and the end point of the driving path are collectively called as vertexes, the vertexes are screened through a clustering algorithm, and the screened vertexes are used as control points;

step S4: connecting the control points to form a traffic expectation line, and binding the traffic expectation line by adopting a force guidance model;

step S5: rendering the bound edges to obtain a graph in an SVG format;

step S6: and evaluating the effect of the bound traffic expectation line according to the pattern in the SVG format.

2. The method for binding and evaluating the edge of the traffic expectation line according to claim 1, wherein the step S1 comprises the following steps:

the method comprises the steps of shooting information of the passing vehicle amount through a plurality of cameras arranged at the road intersections, and combining traffic network data to obtain traffic information of vehicles reaching another road intersection from one road intersection, wherein the traffic information comprises license plate numbers, departure time, starting road sections, arrival time, arrival road sections, travel time, road length and driving paths.

3. The method for binding and evaluating the edges of the traffic expectation line according to claim 2, wherein in step S3, the vertices are screened by using a K-means clustering algorithm based on mesh partition, and the specific steps are as follows:

step S301: obtaining a map of a researched city, and dividing the map of the city into 10X10 grids, wherein each grid comprises starting points or end points of a plurality of roads;

step S302: if the grid has no start point or end point of the road, the grid is abandoned; on the other grids, the coordinates of all the vertexes are weighted and averaged to generate an initial clustering center;

step S303: outputting the clustering center as a vertex for final edge binding by unsupervised training on the basis of the initial clustering center, wherein the standard of the unsupervised training output class center is determined by the following formula

Wherein the J function represents each sample point x(i)To class center muc(i) The sum of the squares of the distances of (a).

4. The method for binding and evaluating the edge of the traffic expectation line according to claim 3, wherein the step S4 comprises the following steps:

the line segments are used for connecting the control points to form a plurality of edges, each edge is a traffic expectation line, the force guidance model is used for binding the two edges together, and the two bound edges can approach each other under the action of spring force and coulomb force;

firstly, judging whether two edges can be bound together, specifically, judging by adopting a compatibility index between the edges, if the compatibility of the two edges is greater than a set threshold value, indicating that the two edges can be bound together, and calculating the compatibility index through the structure of a graph and the geometric characteristics of the edges, wherein the specific calculation mode is as follows:

(1) graph-based structure:

for two sides P and Q, Nmin(P, Q) represents any end point of the P edge, the distance from any end point of the P edge to any end point of the Q edge meets the set minimum distance, and if the number of connecting lines between two edge nodes and a node meeting the requirement is 0, c isc(P, Q) is 0; if two edges share a vertex, cc(P, Q) is 1;

(2) the method comprises the following steps of (1) edge-based geometric characteristics comprising four aspects of angle, length, position and parallel relation; the calculation of each aspect is as follows:

with respect to the angle:

ca(P,Q)=|cosα

ca(P, Q) denotes angle compatibility, and α denotes an acute angle formed by two sides.

With respect to the length:

cl(P, Q) denotes length compatibility,/PDenotes the length of the P side, lQDenotes the length of the Q side, lavgRepresents the average length of the P and Q edges.

With respect to the location:

cp(P, Q) denotes compatibility,/avgDenotes the average length of the P and Q sides, mPRepresents the midpoint of the P edge, mQRepresenting the midpoint of the Q edge.

Regarding the parallel relationship:

cv(P,Q)=min(V(P,Q),V(Q,P))

cv(P, Q) represents parallel relationship compatibility, mPRepresents the midpoint of the P edge, mIRepresents the midpoint of the I edge, and I represents the projection of the Q edge on the P edge.

Finally, the compatibility is calculated as:

C=cc(P,Q)·ca(P,Q)·cl(P,Q)·cp(P,Q)v(P,Q)

when C is larger than a set threshold value C, the two calculated edges are suitable to be bound together, and at the moment, each edge can find an edge compatible with the edge to form an edge bundle, so that each edge bundle has a main edge and a plurality of compatible edges;

in a bundle, the main edge and the compatible edge are broken into a plurality of points, wherein each point of the main edge is acted by the spring force of the adjacent point and simultaneously acted by the coulomb force of the breakpoint of the compatible edge at the corresponding position, and the calculation formula is as follows

Wherein p iskIs a p sideThe p-th point of (a); q. q.skThe q point on the q side; kpIs the elastic coefficient of the p side; lpIs the length of the p side; n is the number of p sides; s is the distance between two points when the coulomb force obtains the maximum value; kcIs the coulomb force constant; n is the number of breakpoints;

the breakpoint on the main edge can generate displacement in the direction of the force due to the combined action of the spring force and the coulomb force, a moving step length S is given, and after one iteration, a new coordinate of the breakpoint can be obtained, wherein the coordinate updating formula is as follows:

wherein S is the moving step length of the breakpoint; z is an iteration sequence;

after each iteration, the break point p on the main edge of each global bundle is calculatedkBreakpoint q corresponding to compatible edgekThe sum of the distances of the current iteration and the last iteration is smaller than a set threshold epsilon, and the binding is finished.

△D=Dz-Dz-1<ε

5. The method for binding and evaluating the edge of the traffic expectation line according to claim 4, wherein the step S5 comprises the following steps:

the bound edges are composed of a group of points, each edge is sequentially connected through line segments, the binding effect is rendered into an SVG graph by using a D3 graph library, the width of each edge is defaulted to be 1px, the color value is set to be RGB (50,50 and 150), the transparency is 0.5, and the color superposition mode is 'screen'.

6. The method as claimed in claim 5, wherein the step of evaluating the edge binding of the traffic expectation line in step S6 comprises the steps of:

step S501: a Harris corner detection-based method comprises the following steps:

respectively converting the images before and after the edge binding into gray level images, extracting the angular point characteristics of the gray level images, and detecting the angular point by calculating the curvature and gradient of pixel points; for image I (x, y), the self-similarity after translation (Δ x, Δ y) at point (x, y) can be given by the autocorrelation function:

wherein, W (x, y): a window centered at point (x, y); i (u, v): is the intensity of the grey value of the pixel; w (u, v) is a weighting function, and the sum of the weights of all the directions of the window is 1;

c (x, y; delta x, delta y) calculates the partial derivative from 1 order to N order according to Taylor series, and finally obtains a Harris matrix formula:

calculating a matrix eigenvalue according to a Harris matrix: lambda [ alpha ]1,λ2

detM=λ1λ2

traceM=λ12

Calculating a corner response value R to determine a corner:

R=detM-α(traceM)2

wherein alpha is a constant and has a value range of 0.04-0.06;

when the response value of the pixel point is greater than the threshold value t, the pixel point is an angular point:

dots={dot|Rdot>t}

step S502: calculating feature richness, namely the proportion of the angular points to all pixel points of the image:

step S503: calculating the feature change strength, and counting the variance of feature richness in all time periods in a day:

if the feature richness is larger, the feature change strength is larger, the more obvious the image corner features generated after binding are, and the better the binding effect is.

Technical Field

The invention relates to the field of data processing, in particular to an edge binding and evaluation method for a traffic expectation line.

Background

At present, an edge binding method is a research hotspot in the field of visualization, and can be used for solving the problem of visual confusion caused by excessive intersection of edges in graph visualization. The side binding method has less research in the field of urban road traffic, and mainly comprises the following methods:

(1) cui et al propose a geometric-based edge binding method, which is the first algorithm to successfully perform edge binding on a generic graph. The method comprises the following four steps: the method comprises the following steps that firstly, a uniform auxiliary network is generated on a graph, and the average trend of each network is calculated; secondly, merging grids which are adjacent in position and contain edges with similar trends; a third step of generating a control mesh on the basis of the newly generated mesh; and fourthly, guiding the edge to bend to form the final visual effect.

(2) Holten et al propose an FDEB (Force-Directed Edge Bundling) algorithm to simulate a node-link diagram into a static model with a single Edge controlled by spring Force and the edges capable of attracting each other. The FDEB algorithm is simple in concept, only the edges need to be simulated into a plurality of sections of springs, and after the elastic force reaches dynamic balance, the edges with similar directions and distances attract each other to form a binding effect.

(3) In the method, under the condition of node adhesion, the pop-up position and the pop-up direction of the nodes are given out through a random function, so that the adhered nodes are separated from each other by a certain distance, and the attraction force and the repulsion force under the condition of node adhesion can be calculated; secondly, gradient setting is adopted for the parameter delta value in the displacement calculation of the force guiding algorithm, so that oscillation is reduced and convergence is fast in the visual layout process of the graph data.

But due to the complexity of the FDEB algorithm is O (n)2) When the number of vertices and edges is increased significantly, the computational cost is high, and simulating each edge as a spring causes severe deformation of the edge and does not meet the requirement for proper deformation. The research is more directed to long-distance migration data with a small number of peaks and a small number of edges. Meanwhile, the evaluation methods adopted by the method are subjective qualitative evaluation, and the visual result is not quantitatively evaluated.

And for the evaluation aspect of the edge binding visualization result, two evaluation methods are mainly involved. One of the methods is to compare the ink ratio required by rendering effects before and after binding, the binding is tight after the sides are bound together, the less the disordered sides are, the more obvious the picture skeleton structure is, the less ink is used during printing, and the better the effect is. The other is to perform user experiments, requiring the subject to complete a specified task within a certain time, such as point-to-point tracing, delineating distinct side-bundles, and then recording and analyzing enough of the subject's performance on one or more executable, well-defined tasks, thereby obtaining the time consumption for completing the task and the accuracy of completing the task. Because the ratio of vertexes and edges facing the traffic identity detection data is more, the ink ratio is not changed greatly before and after binding, a user cannot identify local vertexes during edge tracking, and the two cannot accurately evaluate the effect of edge binding.

Disclosure of Invention

The invention provides a side binding and evaluation method of a traffic expectation line, aiming at solving the defects that a side binding method is mainly used in the prior art and aims at long-distance migration data with small vertex number and edge number, and an evaluation method of a binding effect lacks quantitative evaluation on a visualization result.

An edge binding and evaluation method for a traffic expectation line comprises the following steps:

step S1: shooting the vehicle information passing through each road intersection by using a camera, and obtaining traffic information about the vehicle by combining with traffic network data;

step S2: taking a road section between a road intersection where two cameras with the minimum time difference shoot the same license plate as a running path of a vehicle with the license plate, and marking the two cameras as a starting point and an end point of the running path of the vehicle according to the morning and evening of the time when the two cameras shoot the license plate;

step S3: the starting point and the end point of the driving path are collectively called as vertexes, the vertexes are screened through a clustering algorithm, and the screened vertexes are used as control points;

step S4: connecting the control points to form a traffic expectation line, and binding the traffic expectation line by adopting a force guidance model;

step S5: rendering the bound edges to obtain a graph in an SVG format;

step S6: and evaluating the effect of the bound traffic expectation line according to the pattern in the SVG format.

Preferably, the specific steps of step S1 are as follows:

the method comprises the steps of shooting information of the passing vehicle amount through a plurality of cameras arranged at the road intersections, and combining traffic network data to obtain traffic information of vehicles reaching another road intersection from one road intersection, wherein the traffic information comprises license plate numbers, departure time, starting road sections, arrival time, arrival road sections, travel time, road length and driving paths.

Preferably, in step S3, the vertices are screened by using a K-means clustering algorithm based on mesh partition, and the specific steps are as follows:

step S301: obtaining a map of a researched city, and dividing the city map into 10X10 grids, wherein each grid comprises starting points or end points of a plurality of roads;

step S302: if the grid has no start point or end point of the road, the grid is abandoned; on the other grids, the coordinates of all the vertexes are weighted and averaged to generate an initial clustering center;

step S303: outputting the clustering center as a vertex for final edge binding by unsupervised training on the basis of the initial clustering center, wherein the standard of the unsupervised training output class center is determined by the following formula

Wherein the J function represents each sample point x(i)To class center muc(i) The sum of the squares of the distances of (a).

Preferably, the specific steps of step S4 are as follows:

the line segments are used for connecting the control points to form a plurality of edges, each edge is a traffic expectation line, the force guidance model is used for binding the two edges together, and the two bound edges can approach each other under the action of spring force and coulomb force;

firstly, judging whether two edges can be bound together, specifically, judging by adopting a compatibility index between the edges, if the compatibility of the two edges is greater than a set threshold value, indicating that the two edges can be bound together, and calculating the compatibility index through the structure of a graph and the geometric characteristics of the edges, wherein the specific calculation mode is as follows:

(1) graph-based structure:

for two sides P and Q, Nmin(P, Q) represents any end point of the P edge, the distance from any end point of the P edge to any end point of the Q edge meets the set minimum distance, and if the number of connecting lines between two edge nodes and a node meeting the requirement is 0, c isc(P, Q) is 0; if two edges share a vertex, cc(P, Q) is 1;

(2) the method comprises the following steps of (1) edge-based geometric characteristics comprising four aspects of angle, length, position and parallel relation; the calculation of each aspect is as follows:

with respect to the angle:

ca(P,Q)=|cos|α

ca(P, Q) represents angle compatibility, alpha TableShowing the acute angle formed by the two sides.

With respect to the length:

cl(P, Q) denotes length compatibility,/PDenotes the length of the P side, lQDenotes the length of the Q side, lavgRepresents the average length of the P and Q edges.

With respect to the location:

cp(P, Q) denotes compatibility,/avgDenotes the average length of the P and Q sides, mPRepresents the midpoint of the P edge, mQRepresenting the midpoint of the Q edge.

Regarding the parallel relationship:

cυ(P,Q)=min(V(P,Q),V(Q,P))

cv(P, Q) represents parallel relationship compatibility, mPRepresents the midpoint of the P edge, mIRepresents the midpoint of the I edge, and I represents the projection of the Q edge on the P edge.

Finally, the compatibility is calculated as:

C=cc(P,Q)·ca(P,Q)·cl(P,Q)·cp(P,Q)υ(P,Q)

when C is larger than a set threshold value C, the two calculated edges are suitable to be bound together, and at the moment, each edge can find an edge compatible with the edge to form an edge bundle, so that each edge bundle has a main edge and a plurality of compatible edges;

in a bundle, the main edge and the compatible edge are broken into a plurality of points, wherein each point of the main edge is acted by the spring force of the adjacent point and simultaneously acted by the coulomb force of the breakpoint of the compatible edge at the corresponding position, and the calculation formula is as follows

Wherein p iskThe p-th point on the p side; q. q.skThe q point on the q side; kpIs the elastic coefficient of the p side; lpIs the length of the p side; n is the number of p sides; s is the distance between two points when the coulomb force obtains the maximum value; kcIs the coulomb force constant; n is the number of breakpoints;

the breakpoint on the main edge can generate displacement in the direction of the force due to the combined action of the spring force and the coulomb force, a moving step length S is given, and after one iteration, a new coordinate of the breakpoint can be obtained, wherein the coordinate updating formula is as follows:

wherein S is the moving step length of the breakpoint; z is an iteration sequence;

after each iteration, the break point p on the main edge of each global bundle is calculatedkBreakpoint q corresponding to compatible edgekThe sum of the distances of the current iteration and the last iteration is smaller than a set threshold epsilon, and the binding is finished.

Preferably, the specific steps of step S5 are as follows:

the bound edges are composed of a group of points, each edge is sequentially connected through line segments, the binding effect is rendered into an SVG graph by using a D3 graph library, the width of each edge is defaulted to be 1px, the color value is set to be RGB (50,50 and 150), the transparency is 0.5, and the color superposition mode is 'screen'.

Preferably, the evaluation of the traffic expectation line edge binding in step S6 includes the steps of:

step S501: a Harris corner detection-based method comprises the following steps:

respectively converting the images before and after the edge binding into gray level images, extracting the angular point characteristics of the gray level images, and detecting the angular point by calculating the curvature and gradient of pixel points; for image I (x, y), the self-similarity after translation (Δ x, Δ y) at point (x, y) can be given by the autocorrelation function:

wherein, W (x, y): a window centered at point (x, y); i (u, v): is the intensity of the grey value of the pixel; w (u, v) is a weighting function, and the sum of the weights of all the directions of the window is 1;

c (x, y; delta x, delta y) calculates the partial derivative from 1 order to N order according to Taylor series, and finally obtains a Harris matrix formula:

calculating a matrix eigenvalue according to a Harris matrix: lambda [ alpha ]1,λ2

detM=λ1λ2

traceM=λ12

Calculating a corner response value R to determine a corner:

R=detM-α(traceM)2

wherein alpha is a constant and has a value range of 0.04-0.06;

when the response value of the pixel point is greater than the threshold value t, the pixel point is an angular point:

dots={dot|Rdot>t}

step S502: calculating feature richness, namely the proportion of the angular points to all pixel points of the image:

step S503: calculating the feature change strength, and counting the variance of feature richness in all time periods in a day:

if the feature richness is larger, the feature change strength is larger, the more obvious the image corner features generated after binding are, and the better the binding effect is.

Compared with the prior art, the technical scheme of the invention has the beneficial effects that:

the invention stipulates that only one edge with weight exists between two vertexes, and the weight is taken as an influence factor of the rigidity of the edge, thereby avoiding that a plurality of edges simultaneously participate in the balance process of the static system, and simultaneously conforming to the expected line containing a large number of vehicles and having larger rigidity, i.e. being not easy to deform, thereby reducing the unnecessary deformation of the edge. Meanwhile, the invention improves the edge binding model. On the basis of not influencing the macroscopic pattern recognition, the number of vertexes is reduced; the total number of the edges is used as a variable, so that the complexity of the model is reduced, the main characteristics of the image are more favorably kept, the invention provides a quantitative index for edge binding, extracts the corner point characteristics of the image before and after edge binding based on the difference of the gray level intensity of the pixels, provides the change intensity of the image by combining the time dimension information of traffic data, and can better reflect the binding effect.

Drawings

FIG. 1 is a method block diagram of the present invention.

FIG. 2 is a flow chart of a K-means clustering algorithm based on grid division.

Fig. 3 is a schematic diagram of an edge binding process of the force guidance model.

Fig. 4 is a compatibility diagram based on a graph structure.

FIG. 5 is a schematic of edge-based geometric features.

Fig. 6 is a schematic diagram of the change in coulomb force with varying distance r between two breakpoints for different magnitudes of s.

FIG. 7 shows the clustering results of intersections.

Fig. 8 shows the effect before and after binding of the traffic expectation line.

Fig. 9 shows the corner features before and after binding of the traffic expectation line.

FIG. 10 is feature richness before and after binding.

Detailed Description

The drawings are for illustrative purposes only and are not to be construed as limiting the patent;

for the purpose of better illustrating the embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product;

it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.

The technical solution of the present invention is further described below with reference to the accompanying drawings and examples.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于对象树的元数据管理方法及管理系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!