DGtal 1.3.0
Loading...
Searching...
No Matches
Functions
exampleArithDSSIterator.cpp File Reference
#include <iostream>
#include "ConfigExamples.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/base/Common.h"
#include "DGtal/geometry/curves/ArithDSSIterator.h"
#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
Isabelle Sivignon (isabe.nosp@m.lle..nosp@m.sivig.nosp@m.non@.nosp@m.gipsa.nosp@m.-lab.nosp@m..gren.nosp@m.oble.nosp@m.-inp..nosp@m.fr ) gipsa-lab Grenoble Images Parole Signal Automatique (CNRS, UMR 5216), CNRS, France
Date
2013/07/10

An example file named exampleArithDSSIterator.

This file is part of the DGtal library.

Definition in file exampleArithDSSIterator.cpp.

Function Documentation

◆ main()

int main ( void  )

Definition at line 46 of file exampleArithDSSIterator.cpp.

47{
48 trace.beginBlock ( "Example exampleArithDSSIterator" );
49
50 typedef Z2i::Integer Integer;
51 typedef ArithDSSIterator<Integer,8> DSSIterator;
53 typedef Z2i::Point Point;
54
55 Point A(1,5);
56 Integer xMax = 6;
57
58 // Define an iterator over the 8-connected DSS of characteristics
59 // (2,3,15) and initial point A
60 DSSIterator it(2,3,-15,A);
61
62 // Use this iterator in the ArithmeticalDSS recognition algorithm.
63 // The result gives the minimal characteristics of the subsegment of
64 // the DSL (2,3,15) between the point A and the point of abscissa
65 // equal to xMax.
66 ArithDSS myDSS(it);
67
68 while ( (*(myDSS.end()))[0] <=xMax && myDSS.extendFront())
69 {}
70
71 //Display the result.
72 std::cout << myDSS.a() << " " << myDSS.b() << " " << myDSS.mu();
73
75 return 0;
76}
Aim: An iterator on the points of a Digital Straight Segment. Template parameters are the integer typ...
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
void beginBlock(const std::string &keyword="")
double endBlock()
DGtal::int32_t Integer
Definition: StdDefs.h:74
Trace trace
Definition: Common.h:154
MyPointD Point
Definition: testClone2.cpp:383

References DGtal::Trace::beginBlock(), DGtal::Trace::endBlock(), and DGtal::trace.