template<typename DSS, typename LambdaFunction>
class DGtal::TangentFromDSS3DFunctor< DSS, LambdaFunction >
Description of class 'TangentFromDSS3DFunctor' – model of CLMSTTangentFromDSS. Aim: Provide a functor which calculate from digital straight segment its direction and eccentricity around a given point.
- Template Parameters
-
DSS | digital straight segment recognition algorithm |
LambdaFunction | model of CLambdaFunctor |
- See also
- CLambdaFunctor.h
Definition at line 173 of file FunctorsLambdaMST.h.
template<typename DSS , typename LambdaFunction >
Calculate a direction of the 2D DSS and an eccentricity of a given point in this DSS.
- Parameters
-
aDSS | digital straight segment |
indexOfPointInDSS | index of given point in aDSS |
dssLen | length of aDSS |
Definition at line 201 of file FunctorsLambdaMST.h.
202 {
204 typename DSS::Point3d directionZ3;
205 RealVector direction;
206 typename DSS::PointR3d intercept;
207 typename DSS::PointR3d thikness;
208
209 aDSS.getParameters ( directionZ3, intercept, thikness );
210 direction[0] = directionZ3[0];
211 direction[1] = directionZ3[1];
212 direction[2] = directionZ3[2];
213
214 result.second =
lambdaFunctor ( (
double)indexOfPointInDSS / (
double)dssLen );
215
216 double norm = direction.norm();
217 if ( norm != 0. )
218 direction /= norm;
219 result.first = direction * result.second;
220 return result;
221 }
LambdaFunction lambdaFunctor
References DGtal::TangentFromDSS3DFunctor< DSS, LambdaFunction >::lambdaFunctor, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::norm().