29#include <vigra/stdimage.hxx>
30#include <vigra/transformimage.hxx>
31#include <vigra/inspectimage.hxx>
32#include <vigra/functorexpression.hxx>
59CELESTEIMPEX vigra::BImage*
getCelesteMask(
struct svm_model* model, vigra::UInt16RGBImage& input,
int radius,
float threshold,
int resize_dimension,
bool adaptThreshold=
false,
bool verbose=
true);
69template <
class SrcIMG>
70void convertToUInt16(SrcIMG & src,
const std::string & origType, vigra::UInt16RGBImage & dest)
72 dest.resize(src.size());
75 if (origType ==
"FLOAT" || origType ==
"DOUBLE")
80 vigra::RGBToGrayAccessor<vigra::RGBValue<float> > ga;
81 vigra::FindMinMax<float> minmax;
82 vigra::inspectImage(srcImageRange(src, ga),
84 double minVal = minmax.min;
85 double maxVal = minmax.max;
90 vigra::transformImage(srcImageRange(src), destImage(dest),
std::vector< CPoint > CPointVector
std::set< unsigned int > UIntSet
vigra::BImage * getCelesteMask(struct svm_model *model, vigra::UInt16RGBImage &input, int radius, float threshold, int resize_dimension, bool adaptThreshold, bool verbose)
calculates the mask using SVM
HuginBase::UIntSet getCelesteControlPoints(struct svm_model *model, vigra::UInt16RGBImage &input, HuginBase::CPointVector cps, int radius, float threshold, int resize_dimension, bool verbose)
void convertToUInt16(SrcIMG &src, const std::string &origType, vigra::UInt16RGBImage &dest)
converts the given image to UInt16RGBImage only this image is correctly processed by celeste
void destroySVMmodel(struct svm_model *&model)
frees the resource of model
bool loadSVMmodel(struct svm_model *&model, std::string &model_file)
loads the SVM model from file
double getMaxValForPixelType(const std::string &v)
void applyMapping(vigra::triple< SrcIterator, SrcIterator, SrcAccessor > img, vigra::pair< DestIterator, DestAccessor > dest, T min, T max, int mapping)
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
functions to manage ROI's