#include <DGtal/geometry/curves/estimation/SegmentComputerEstimators.h>
|
typedef std::pair< double, double > | Value |
|
|
template<typename DCA > |
Value | operator() (const typename DCA::ConstIterator &it, const DCA &aDCA, const double &aH) const |
|
Description of class 'DistanceFromDCA'
Aim: estimates the distance of a given pair of points to the separating circle of a DCA.
Definition at line 925 of file SegmentComputerEstimators.h.
◆ Value
◆ operator()()
template<typename DCA >
Value DGtal::detail::DistanceFromDCA::operator() |
( |
const typename DCA::ConstIterator & |
it, |
|
|
const DCA & |
aDCA, |
|
|
const double & |
aH |
|
) |
| const |
|
inline |
Operator()
- Returns
- distances (in a pair) of the inner and outer points pointed by it to the separating circle of aDCA
- Parameters
-
it | position where the estimation has to be done |
aDCA | an instance of segment computer devoted to the DCA recognition. |
aH | grid step |
- Template Parameters
-
DCA | a model of segment computer devoted to the DCA recognition, basically geometricDCA. |
Definition at line 947 of file SegmentComputerEstimators.h.
949 {
950 typedef typename DCA::Pair Pair;
951 typedef typename DCA::Point
Point;
952 typedef typename Point::Coordinate Coordinate;
953
954 if ( !aDCA.isStraight() )
955 {
956
957 double c0, c1, r;
958 aDCA.getSeparatingCircle().getParameters(c0, c1, r);
959
960 Pair pair = *it;
961 Point i = pair.first;
962 Point o = pair.second;
963
966 double distI = std::sqrt( distI0*distI0 + distI1*distI1 ) - r;
969 double distO = std::sqrt( distO0*distO0 + distO1*distO1 ) - r;
970 return Value( distI*aH, distO*aH );
971 }
972 else
973 {
974
975 double a, b, c;
976 aDCA.getStabbingLineComputerPtr()->getParameters(a, b, c);
977
978 double n = std::sqrt(a*a + b*b);
979
980 Pair pair = *it;
981 Point i = pair.first;
982 Point o = pair.second;
983
986 double distI = rI / n;
989 double distO = rO / n;
990 return Value( distI*aH, distO*aH );
991 }
992 }
static double castToDouble(const std::decay< T >::type &aT)
Cast method to double (for I/O or board export uses only).
std::pair< double, double > Value
References DGtal::NumberTraitsImpl< std::decay< T >::type >::castToDouble().
The documentation for this struct was generated from the following file: