DGtal 1.4.0
|
#include <cmath>
#include <iostream>
#include <sstream>
#include <fstream>
#include "DGtal/base/Common.h"
#include "DGtal/io/boards/Board2D.h"
#include "DGtal/io/Color.h"
#include "DGtal/shapes/Shapes.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
#include "DGtal/geometry/curves/FreemanChain.h"
#include "DGtal/geometry/curves/SaturatedSegmentation.h"
#include "ConfigExamples.h"
Go to the source code of this file.
Functions | |
template<typename Iterator , typename Board > | |
void | drawCCP (const Iterator &itb, const Iterator &ite, Board &aBoard) |
Function that draws the maximal segments with a color that depends on the local convexity: | |
template<typename Iterator , typename Board > | |
void | segmentationIntoMaximalDSSs (const Iterator &itb, const Iterator &ite, Board &aBoard) |
Perform a saturated segmentation into maximal digital straight segments of a given range of integer points and draw the result. | |
int | main (int argc, char **argv) |
Program that draws the maximal segments of digital curve whose chain code may be given as an argument. The chain code must be a sequence of characters belonging to the set {0,1,2,3}. | |
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/.
An example file named convex-and-concave-parts.
This file is part of the DGtal library.
Definition in file convex-and-concave-parts.cpp.
void drawCCP | ( | const Iterator & | itb, |
const Iterator & | ite, | ||
Board & | aBoard ) |
Function that draws the maximal segments with a color that depends on the local convexity:
itb | begin iterator on an ArithmeticalDSSComputer |
ite | end iterator on an ArithmeticalDSSComputer |
aBoard | board to draw |
Iterator | a model of forward iterator and CSegmentComputerIterator |
Board | a Board2D type |
Definition at line 95 of file convex-and-concave-parts.cpp.
References DGtal::Color::Black, DGtal::Color::Blue, DGtal::Color::Green, DGtal::Color::Red, and DGtal::Color::Yellow.
Referenced by segmentationIntoMaximalDSSs().
int main | ( | int | argc, |
char ** | argv ) |
Program that draws the maximal segments of digital curve whose chain code may be given as an argument. The chain code must be a sequence of characters belonging to the set {0,1,2,3}.
argc | number of arguments |
argv | array of arguments |
Definition at line 194 of file convex-and-concave-parts.cpp.
References DGtal::FreemanChain< TInteger >::begin(), DGtal::Trace::beginBlock(), DGtal::FreemanChain< TInteger >::end(), DGtal::Trace::endBlock(), DGtal::Trace::info(), LibBoard::Board::saveCairo(), LibBoard::Board::saveSVG(), segmentationIntoMaximalDSSs(), and DGtal::trace.
void segmentationIntoMaximalDSSs | ( | const Iterator & | itb, |
const Iterator & | ite, | ||
Board & | aBoard ) |
Perform a saturated segmentation into maximal digital straight segments of a given range of integer points and draw the result.
itb | begin iterator |
ite | end iterator |
aBoard | board to draw |
Iterator | a model of forward iterator on digital points |
Board | a Board2D type |
Definition at line 167 of file convex-and-concave-parts.cpp.
References drawCCP().
Referenced by main().