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

#include <SegmentComputerEstimators.h>

Public Types

typedef double Value

Public Member Functions

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

Detailed Description

  Description of class 'CurvatureFromDSSLengthAndWidth' <p> Aim: 
  computes the curvature \form#259 from 
  the length \form#4 and the width \form#261 of a DSS as follow: 

\( 1/k = (l*l)/(8*w) + w/2 \)

  @note Adaption from 
   Coeurjolly, D. and Miguet, S. and Tougne, L.
   "Discrete Curvature Based on Osculating Circle Estimation", 
  Proc. IWVF, LNCS, vol 2059, pp.303-312, 2001

Definition at line 1270 of file SegmentComputerEstimators.h.


Member Typedef Documentation

Definition at line 1273 of file SegmentComputerEstimators.h.


Member Function Documentation

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

Definition at line 1276 of file SegmentComputerEstimators.h.

{
typedef typename DSS::Vector Vector;
//length
Vector v = ( *aDSS.begin() - *boost::prior(aDSS.end()) );
Value l = v.norm(Vector::L_2);
//width
Vector t( aDSS.getB(), aDSS.getA() );
Value w = 1.0 / v.norm(Vector::L_2);
//result
return 1.0/( (l*l)/(8*w) + w/2 );
}

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