DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::detail::NormalizedTangentVectorFromDSS Struct Reference

#include <DGtal/geometry/curves/estimation/SegmentComputerEstimators.h>

Public Types

typedef DGtal::PointVector< 2, double > RealVector
 
typedef RealVector Value
 

Public Member Functions

template<typename DSS >
Value operator() (const DSS &aDSS) const
 

Detailed Description

Description of class 'NormalizedTangentVectorFromDSS'

Aim: computes the unit vector of a DSS

Definition at line 715 of file SegmentComputerEstimators.h.

Member Typedef Documentation

◆ RealVector

◆ Value

Member Function Documentation

◆ operator()()

template<typename DSS >
Value DGtal::detail::NormalizedTangentVectorFromDSS::operator() ( const DSS & aDSS) const
inline

Operator()

Returns
normalized tangent
Parameters
aDSSan instance of segment computer devoted to the DSS recognition.
Template Parameters
DSSa model of segment computer, which must have methods a() and b() returning the y- and x-component of the tangent vector.

Definition at line 734 of file SegmentComputerEstimators.h.

735 {
736 double x = NumberTraits<typename DSS::Integer>
737 ::castToDouble( aDSS.b() );
738 double y = NumberTraits<typename DSS::Integer>
739 ::castToDouble( aDSS.a() );
740 RealVector v(x,y);
741 double norm = v.norm(RealVector::L_2);
742 v /= norm;
743 return v;
744 }

References DGtal::PointVector< 2, double >::L_2.


The documentation for this struct was generated from the following file: