DGtal  1.5.beta
topology/3dBorderExtractionImg.cpp

Objects have a border, which are the points which touch the complement in the sense of background adjacency. A border of an object is itself an object, with the same topology as the object.

See also
Border of a digital object
Border extraction visualisation from imported volume
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/base/Common.h"
#include "DGtal/io/readers/VolReader.h"
#include "DGtal/images/ImageSelector.h"
#include "DGtal/images/imagesSetsUtils/SetFromImage.h"
#include "DGtal/io/viewers/Viewer3D.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"
using namespace std;
using namespace DGtal;
int main( int argc, char** argv )
{
std::string inputFilename = examplesPath + "samples/Al.100.vol";
QApplication application(argc,argv);
Viewer3D<> viewer;
viewer.show();
typedef ImageSelector < Z3i::Domain, int>::Type Image;
Image image = VolReader<Image>::importVol(inputFilename);
Z3i::DigitalSet set3d (image.domain());
SetFromImage<Z3i::DigitalSet>::append<Image>(set3d, image, 0,255);
Z3i::Object18_6 obj3d (Z3i::dt18_6, set3d);
Z3i::Object18_6 border = obj3d.border();
viewer << border;
viewer << ClippingPlane(0,1,0, -40) << Viewer3D<>::updateDisplay;
return application.exec();
}
// //
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
ImageContainerBySTLVector< Domain, Value > Image
Z2i::DigitalSet DigitalSet