DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions
DGtal::detail::NormalizedTangentVectorFromDSS Struct Reference

#include <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 719 of file SegmentComputerEstimators.h.


Member Typedef Documentation

Definition at line 722 of file SegmentComputerEstimators.h.

Definition at line 723 of file SegmentComputerEstimators.h.


Member Function Documentation

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 getA() and getB() returning the y- and x-component of the tangent vector.

Definition at line 738 of file SegmentComputerEstimators.h.

References DGtal::PointVector< dim, TEuclideanRing >::L_2.

{
::castToDouble( aDSS.getB() );
::castToDouble( aDSS.getA() );
RealVector v(x,y);
double norm = v.norm(RealVector::L_2);
v /= norm;
return v;
}

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