34 #include "DGtal/base/Common.h"
36 #include "DGtal/shapes/ShapeFactory.h"
37 #include "DGtal/shapes/Shapes.h"
38 #include "DGtal/helpers/StdDefs.h"
39 #include "DGtal/topology/helpers/Surfaces.h"
42 #include "DGtal/geometry/curves/FreemanChain.h"
45 #include "DGtal/geometry/curves/BinomialConvolver.h"
49 #include "DGtal/images/ImageContainerBySTLVector.h"
50 #include "DGtal/io/writers/GenericWriter.h"
51 #include "DGtal/io/colormaps/GradientColorMap.h"
52 #include "DGtal/io/writers/PPMWriter.h"
61 using namespace DGtal;
111 std::vector<Z2i::Point> vectPoints;
117 BCCurvatureEstimator.
init( h, vectPoints.begin(), vectPoints.end(), isClosed );
118 resCurvature.clear();
119 resCurvature.resize(vectPoints.size());
120 BCCurvatureEstimator.
eval( vectPoints.begin(), vectPoints.end(), resCurvature.begin() );
127 int main(
int argc,
char** argv )
132 std::string fileName;
133 std::string outputFileName;
134 double h_initial {1.0};
135 double h_increment {1.0};
136 double h_final {1.0};
137 double curvatureCutOff {10};
139 app.description(
"Generate the Curvature Scale Space image using a binomial convolver based estimator.\n Typical use example:\n \t curvatureScaleSpaceBCC <input filename> <output filename>\n");
140 app.add_option(
"-i,--input,1",fileName,
"Input FreemanChain file name")->required()->check(CLI::ExistingFile);
141 app.add_option(
"-o,--output,2",outputFileName,
"Set the output name")->required();
142 app.add_option(
"--gridStepInit", h_initial,
"Grid step initial",
true);
143 app.add_option(
"--gridStepIncrement", h_increment,
"Grid step increment ",
true);
144 app.add_option(
"--gridStepFinal", h_final,
"Grid step final",
true);
145 app.add_option(
"--curvatureCutOff,-c", curvatureCutOff,
"set the curvature limits to better display",
true);
147 app.get_formatter()->column_width(40);
148 CLI11_PARSE(app, argc, argv);
155 bool isClosed = vectFcs.at(0).isClosed();
159 unsigned int height = (int)((h_final-h_initial)/h_increment);
167 for(
double l= 0; l < height; l++ ){
170 std::vector<double> curvaturesBCC;
171 computeCurvatureBCC(h, vectFcs.at(0), curvaturesBCC, isClosed);
174 for ( std::vector<double>::const_iterator it = curvaturesBCC.begin(), it_end = curvaturesBCC.end();
175 it != it_end; ++it, ++j ) {
177 c = c<-curvatureCutOff? -curvatureCutOff: c;
178 c = c>curvatureCutOff? curvatureCutOff: c;
int main(int argc, char **argv)
void init(const double h, const ConstIterator &itb, const ConstIterator &ite, const bool isClosed=true)
Quantity eval(const ConstIterator &it)
static void getContourPoints(const FreemanChain &fc, std::vector< Point > &aVContour)
void progressBar(const double currentValue, const double maximalValue)
Trace trace(traceWriterTerm)