started changing gfx and grid-TeX

This commit is contained in:
2016-02-16 22:25:55 +01:00
parent 54ab3d8dbe
commit bcb84a9138
15 changed files with 75542 additions and 74591 deletions

View File

@@ -36,11 +36,11 @@
until a desired distance $\gDist$ is reached \cite{Ebner-15}.
In order to use meaningful headings $\gHead$ and distances $\gDist$
(matching the pedestrian's real heading and walking speed) for each transition,
we use the current sensor-readings $\mObsVec_{t}$ for hinted instead of truly random adjustments:
we use the current sensor-readings $\mObsVec_{t}$ for hinted instead of randomized adjustments:
%
\begin{align}
\mStateVec_{t}^{\mStateHeading} = \gHead &= \mStateVec_{t-1}^{\mStateHeading} + \mObsVec_t^{\mObsHeading} + \mathcal{N}(0, \sigma_{\gHead}^2) \\
\gDist &= \mObsVec_t^{\mObsSteps} \cdot \SI{0.7}{\meter} + \mathcal{N}(0, \sigma_{\gDist}^2)
\mState_{t}^{\mStateHeading} = \gHead &= \mState_{t-1}^{\mStateHeading} + \mObs_t^{\mObsHeading} + \mathcal{N}(0, \sigma_{\gHead}^2) \\
\gDist &= \mObs_t^{\mObsSteps} \cdot \SI{0.7}{\meter} + \mathcal{N}(0, \sigma_{\gDist}^2)
.
\end{align}
%
@@ -59,7 +59,7 @@
\commentByFrank{das erste $=$ ist komisch. ideen?}
\commentByToni{Find ich jetzt nicht tragisch. Eher notwendig fuers Verstaendnis.}
\begin{equation}
p(e) = p(e \mid \gHead) = N(\angle e \mid \gHead, \sigma_\text{dev}^2).
p(e) = p(e \mid \gHead) = \mathcal{N} (\angle e \mid \gHead, \sigma_\text{dev}^2).
\label{eq:transSimple}
\end{equation}
@@ -87,46 +87,60 @@
To downvote vertices near walls, we need to get the distance of each vertex from its nearest wall.
We therefore build an inverted version $G' = (V', E')$ of the graph $G$, just containing walls and other obstacles.
A nearest-neighbour search $\mNN(v_{x,y,z}, G')$ will then provide the nearest wall-vertex
$v'_{x,y,z} \in V'$ from the inverted graph \cite{Cover1967}. The wall avoidance can now be calculated as follows:
A nearest-neighbour search \cite{Cover1967}
%$\mNN(v_{x,y,z}, G')$
will then provide the nearest wall-vertex
$v'_{x,y,z} \in V'$ from the inverted graph. To get a smooth gradient, the wall avoidance
is calculated using a normal distribution with the distance from the nearest wall
and a deviation of \SI{0.5}{\meter}:
%
%\begin{equation}
% d_{v, v'} = \| v_{x,y,z}, v'_{x,y,z}, \enskip 0.0 < d_{v, v'} < 2.2 \\
%\end{equation}
%\begin{equation}
%\begin{array}{ll}
% \text{wa}_{x,y,z} = & - 0.30 \cdot \mathcal{N}(d_{v, v'} \mid 0.0, 0.5^2) \\
% & + 0.15 \cdot \mathcal{N}(d_{v, v'} \mid 0.9, 0.5^2) \\
% & + 0.15 \cdot \mathcal{N}(d_{v, v'} \mid 2.2, 0.5^2)
%\end{array}
%\label{eq:wallAvoidance}
%\end{equation}
\begin{equation}
d_{v, v'} = d(v_{x,y,z}, v'_{x,y,z}), \enskip 0.0 < d_{v, v'} < 2.2 \\
\end{equation}
\begin{equation}
\begin{array}{ll}
\text{wa}_{x,y,z} = & - 0.30 \cdot \mathcal{N}(d_{v, v'} \mid 0.0, 0.5^2) \\
& + 0.15 \cdot \mathcal{N}(d_{v, v'} \mid 0.9, 0.5^2) \\
& + 0.15 \cdot \mathcal{N}(d_{v, v'} \mid 2.2, 0.5^2)
\end{array}
\label{eq:wallAvoidance}
\text{wa}_{x,y,z} = \mathcal{N}( \| v_{x,y,z} - v'_{x,y,z} \| \mid 0.0, 0.5^2) \\
\label{eq:wallAvoidance}
\end{equation}
%
The parameters of the normal distribution and the scaling-factors were chosen empirically.
While this approach provides good results for most areas, doors are downvoted by
\refeq{eq:wallAvoidance}, as they have only vertices that are close to walls.
Door detection and upvoting thus is the next conducted step.
%The parameters of the normal distribution and the scaling-factors were chosen empirically.
%While this approach provides good results for most areas, doors are downvoted by
%\refeq{eq:wallAvoidance}, as they have only vertices that are close to walls.
%Door detection and upvoting thus is the next conducted step.
While effectively rendering wall-regions less likely, \refeq{eq:wallAvoidance}
will obviously have the same effect on all doors located within the building.
Therefore, a door-detection is necessary, to upvote them again.
\subsection{Door Detection}
\label{sec:doorDetection}
Doors are usually anchored between two walls and have a normed width. Examining only a limited region
around the door, its surrounding walls describe a flat ellipse with the same centre as the door itself.
It is thus possible to detect doors within the floorplan using a PCA.
To automatically detect doors within the floorplan, we utilize the fact that doors are usually
anchored between two (straight) walls and have a normed width. Examining the region directly
around it, the door and its surrounding walls describe a flat ellipse with the door as its
centre.
%It is thus possible to detect doors within the floorplan using a PCA.
To decide whether a vertex $v_{x,y,z}$ within the (non-inverted) grid $G$ belongs to a door, we use $k$-NN to fetch its
$k$ nearest neighbours $N'$ within the inverted grid $G'$. For this neighbourhood the centroid $\vec{c} \in \R^3$ is calculated.
If the distance $\| \vec{c} - v_{x,y,z} \|$ between the centroid and the vertex-in-question is above a certain threshold,
the node does not belong to a door.
\todo{Distanzformel centroid/vertex. ideen? $\|v1 - v2\|$ oder $d(v1, v2)$?}
\commentByToni{Beides ist gebraeuchlich und $d$ ist kuerzer. von daher wuerde ich $d$ empfehlen.}
Assuming the distance is fine, we compare the two eigenvalues $\{\lambda_1, \lambda_2 \mid \lambda_1 > \lambda_2\}$,
determined by the PCA. If their ratio $\frac{\lambda_1}{\lambda_2}$ is above a certain threshold (flat ellipse)
the node-in-question belongs to a door or some kind of narrow passage.
To decide whether a vertex $v_{x,y,z}$ within the (non-inverted) grid $G$ belongs to a door,
we use $k$-NN to fetch its $k$ nearest neighbours $\hat{V}$ within the inverted grid $G'$,
describing the walls nearby. Hereafter we determine the centroid $\vec{c} \in \R^3$
and 2D covariance $(x,y)$ for those vertices.
%
Using the PCA, we examine the two eigenvalues $\{\lambda_1, \lambda_2 \mid \lambda_1 > \lambda_2\}$,
for the covariance matrix. If their ratio $\frac{\lambda_1}{\lambda_2}$ is above a certain
threshold, the neighbourhood describes a flat ellipse and thus either a straight wall or door.
%
To prevent a vertex $v_{x,y,z}$ adjacent to such straight walls from also being detected,
we ensure the distance $\| \vec{c} - v_{x,y,z} \|$ between the centroid and the vertex is
below a certain threshold. Hereafter, only vertices located within the door itself remain.
%
\begin{figure}
\includegraphics[width=\columnwidth]{door_pca}
@@ -136,39 +150,42 @@
\end{figure}
%
Fig. \ref{fig:doorPCA} depicts all three cases where
(left) the node is part of a door,
(middle) the distance between node and k-NN centroid is above the threshold and
(left) the vertex is part of a door,
(middle) the distance between node and centroid is above the threshold and
(right) the ration between $\lambda_1$ and $\lambda_2$ is below the threshold.
Like before, we apply a distribution based on the distance from the nearest door to determine
an importance-factor for each node:
For smooth importance-gradients around doors, we again use a distribution based on
the distance of a vertex $v_{x,y,z}$ from its nearest door and a deviation
of \SI{1.0}{\meter} to determine its importance-factor:
%
\commentByFrank{distanzrechnung: formel ok?}
%\commentByFrank{distanzrechnung: formel ok?}
\begin{equation}
\text{dd}_{x,y,z} = 0.8 \cdot \mathcal{N}( \| \vec{c} - v_{x,y,z} \| \mid 0.0, 1.0 )
\text{dd}_{x,y,z} = \mathcal{N}( \| \vec{c} - v_{x,y,z} \| \mid 0.0, 1.0^2 )
\label{eq:doorDetection}
\end{equation}
The final importance for each node is now calculated using \refeq{eq:wallAvoidance}
and \refeq{eq:doorDetection}:
%
\begin{equation}
\text{imp}_{x,y,z} = 1.0 - \text{wa}_{x,y,z} + \text{dd}_{x,y,z} \enspace .
\end{equation}
%
While most vertices receive a factor of $1.0$, wall-regions get lower and
door-regions higher values, depicted in fig. \ref{fig:importance}.
%
\begin{figure}
\includegraphics[width=\columnwidth]{floorplan_importance}
\caption{The calculated importance-factor for each vertex. While the black wall-elements denote
a small importance, the yellow door-regions receive much higher values.}
\label{fig:importance}
\end{figure}
\subsection{Path Estimation}
\label{sec:pathEstimation}
Based on aforementioned assumptions, the final importance for each node is given by
%
\begin{equation}
\text{imp}_{x,y,z} = 1.0 + \text{wa}_{x,y,z} + \text{dd}_{x,y,z} \enspace .
\end{equation}
%
A good visualization of the resulting importance-factors can be seen in fig. \ref{fig:importance}.
\begin{figure}
\includegraphics[angle=-90, width=\columnwidth, trim=20 19 17 9, clip]{floorplan_importance}
\caption{The calculated importance-factor for each vertex. While the black elements denote an importance-factor
of about \SI{0.8}{}, the yellow door-regions denote a high importance of about \SI{1.2}{}.}
\label{fig:importance}
\end{figure}
\commentByFrank{ueberleitung}
To estimate the shortest path to the pedestrian's desired target, we use a modified version
of Dijkstra's algorithm. Instead of calculating the shortest path from the start to the end,
we swap start/end and do not terminate the calculation until every single node was evaluated.
@@ -181,15 +198,15 @@
\text{weight}(v_{x,y,z}, v_{x',y',z'}) =
\frac
{ \| v_{x,y,z} - v_{x',y',z'} \| }
{ \text{stretch}(\text{imp}_{x',y',z'}) }
,
{ \text{imp}_{x',y',z'} }
.
\end{split}
\end{equation}
%
whereby $\text{stretch}(\cdots)$ is a scaling function (linear or non-linear) used to adjust
the impact of the previously calculated importance-factors.
%whereby $\text{stretch}(\cdots)$ is a scaling function (linear or non-linear) used to adjust
%the impact of the previously calculated importance-factors.
%
Fig. \ref{fig:multiHeatMap} depicts the difference between the path calculated without (dashed) and
Fig. \ref{fig:multiHeatMap} depicts the difference between the shortest path calculated without (dashed) and
with importance-factors (solid), where the latter version is clearly more realistic.
%\begin{figure}
@@ -251,11 +268,12 @@
%
\begin{equation}
\begin{split}
p(v_{x',y',z'} \mid v_{x,y,z})
= N(\angle [ v_{x,y,z} v_{x',y',z'} ] \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\
\alpha =
p(e) &=
p(v_{x',y',z'} \mid v_{x,y,z})\\
&= \mathcal{N} (\angle [ v_{x,y,z} v_{x',y',z'} ] \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\
\alpha &=
\begin{cases}
1.0 & \| v_{x',y',z'} - \pathRef \| < \| v_{x,y,z} - \pathRef \| \\
0.9 & \| v_{x',y',z'} - \pathRef \| < \| v_{x,y,z} - \pathRef \| \\
0.1 & \text{else}
\end{cases}
\end{split}
@@ -277,11 +295,12 @@
\begin{equation}
\begin{split}
p(v_{x',y',z'} \mid v_{x,y,z})
= N(\angle [ v_{x,y,z} v_{x',y',z'} ] \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\
\alpha =
p(e) &=
p(v_{x',y',z'} \mid v_{x,y,z})\\
& = \mathcal{N} (\angle [ v_{x,y,z} v_{x',y',z'} ] \mid \gHead, \sigma_\text{dev}^2) \cdot \alpha \\
\alpha &=
\begin{cases}
1.0 & \text{cdist}_{x',y',z'} < \text{cdist}_{x,y,z} \\
0.9 & \text{cdist}_{x',y',z'} < \text{cdist}_{x,y,z} \\
0.1 & \text{else}
\end{cases}
\end{split}
@@ -292,9 +311,9 @@
walks simulating slight, random heading changes.
\begin{figure}
\includegraphics[angle=-90, width=\columnwidth, trim=20 19 17 9, clip]{floorplan_dijkstra_heatmap}
\includegraphics[width=\columnwidth]{floorplan_dijkstra_heatmap}
\caption{Heat-Map of visited vertices after several walks using \refeq{eq:transMultiPath}.
Additionally shows the shortest-path calculation without (dashed) and with (solid) importance-factors
Additionally shows the shortest path calculation without (dashed) and with (solid) importance-factors
used for edge-weight-adjustment.}
\label{fig:multiHeatMap}
\end{figure}