36 #include "../ContourDetectorBSpline.hh"
37 #include <Base/Image/ImageConvert.hh>
38 #include <Base/Image/ImageIO.hh>
39 #include <Base/Image/ImageBase.hh>
40 #include <Base/Image/Image.hh>
52 unsigned char blue_[3]={0,0,255};
53 unsigned char red_[3]={255,0,0};
61 bspline_.
Fit(imgGrey_,0.001,50);
64 void loadInputImage(
char *imgloc){
71 int main(
int argc,
char *argv[])
73 std::cout<<
"WARNING: Not working example!!! "<<std::endl;
76 std::cout<<
"usage: " << argv[0] <<
" example.ppm" << std::endl <<
77 " press f for fitting" << std::endl << std::flush;
82 loadInputImage(argv[1]);
83 std::cout<<
"Loaded input images"<<std::endl;
87 std::vector<unsigned int> mPnts(5,1);
105 std::cout<<
"Initing curve:"<<std::endl;
108 std::cout<<
"Inited curve:"<<std::endl;
112 std::cout<<
"Drawn curve:"<<std::endl;
void SetFitSampleWidth(double width)
sets the amount of samples used to search features along the curve in fitting algorithm.
void SetShapeSpaceIdentity()
sets spape-space for regularised fitting to identity
void DrawCurve(BIAS::Image< StorageType > &img, const StorageType color[3])
draws B-Spline curve into image
void Init(const unsigned int order, const ContourBSplineType::Type bType, const std::vector< BIAS::Vector2< double > > &cPnts)
initialisation function for simple curve without edges
void SetSubShapeSpacePlanarAffin()
set invariant shape-space for regularised fitting to planar affine transformation ...
void SetDrawSampleWidth(double width)
sets the amount of sample points used to draw the B-Spline curve.
represents a special B-Spline and holds functions to handle fitting
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
static int Convert(BIAS::ImageBase &source, BIAS::ImageBase &dest, enum BIAS::ImageBase::EColorModel targetColorModel, bool bPlanar=false)
main general conversion function, calls desired specialized functions, always initializes the destIma...
void Fit(BIAS::Image< StorageType > &greyImg, const double &alpha, const unsigned int normalWidth)
fits B-Spline curve to gradient features found in the image
void ComputeRegularisationMatrix()
computes the regularisation matrix needed for fitting algorithm.