Merge branch 'master' of https://github.com/tforgione/Paella
This commit is contained in:
commit
798f6ce0f5
|
@ -14,6 +14,25 @@
|
||||||
/// \defgroup skeleton Skeleton module
|
/// \defgroup skeleton Skeleton module
|
||||||
///
|
///
|
||||||
/// Module to manage 2D-skeletons
|
/// Module to manage 2D-skeletons
|
||||||
|
///
|
||||||
|
/// This module contains two programs.
|
||||||
|
/// - Skeleton
|
||||||
|
/// - SkeletonDrawing
|
||||||
|
///
|
||||||
|
/// \section Skeleton
|
||||||
|
/// This is the main binary. it takes several arguments
|
||||||
|
/// \verbatim
|
||||||
|
// Allowed options:
|
||||||
|
// -h [ --help ] produce help message
|
||||||
|
// --img1 arg first image (for the keypoints detection)
|
||||||
|
// --img2 arg second image (for the keypoints detection)
|
||||||
|
// --mask1 arg binary mask of the first image (to remove useless
|
||||||
|
// keypoints)
|
||||||
|
// --mask2 arg binary mask of the second image
|
||||||
|
// --skl1 arg first skeleton, and its branches
|
||||||
|
// --skl2 arg second skeleton
|
||||||
|
// -o [ --output ] arg output file
|
||||||
|
/// \endverbatim
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -45,11 +45,22 @@ X =
|
||||||
\]
|
\]
|
||||||
Then subtract it with the centroid matrix associated.
|
Then subtract it with the centroid matrix associated.
|
||||||
\[
|
\[
|
||||||
X - X_{m}
|
X_{c} = X - X_{m}
|
||||||
\]
|
\]
|
||||||
The normal vector of the best-fitting plane is the left singular vector corresponding to the least singular value of \[ XX^T \]
|
The normal vector $N$ of the best-fitting plane will be the cross product of the 2 eigenvectors $v_1,v_2$ corresponding to the two biggest singular values of the covariance matrix of $X_{c}$ :
|
||||||
|
\[
|
||||||
|
X_{c}X_{c}^T
|
||||||
|
\]
|
||||||
|
\[
|
||||||
|
N = v_1 \wedge v_2
|
||||||
|
\]
|
||||||
|
|
||||||
Then to compute the constant value of the equation we use the centroid.
|
Then to compute the constant value of the equation we use the centroid.
|
||||||
|
\[
|
||||||
|
d = -N*X_m
|
||||||
|
\]
|
||||||
|
|
||||||
|
At the end we have the parameters of the plane in N and d.
|
||||||
|
|
||||||
\begin{figure}[H]
|
\begin{figure}[H]
|
||||||
\begin{center}
|
\begin{center}
|
||||||
|
|
Loading…
Reference in New Issue