29 #include <vigra/stdimage.hxx>
30 #include <vigra/transformimage.hxx>
31 #include <vigra/inspectimage.hxx>
32 #include <vigra/functorexpression.hxx>
59 CELESTEIMPEX vigra::BImage*
getCelesteMask(
struct svm_model* model, vigra::UInt16RGBImage& input,
int radius,
float threshold,
int resize_dimension,
bool adaptThreshold=
false,
bool verbose=
true);
69 template <
class SrcIMG>
70 void 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;
84 double minVal = minmax.min;
85 double maxVal = minmax.max;
void destroySVMmodel(struct svm_model *&model)
frees the resource of model
double getMaxValForPixelType(const std::string &v)
void transformImage(vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, vigra::Diff2D destUL, TRANSFORM &transform, PixelTransform &pixelTransform, bool warparound, Interpolator interpol, AppBase::ProgressDisplay *progress, bool singleThreaded=false)
Transform an image into the panorama.
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
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 applyMapping(vigra::triple< SrcIterator, SrcIterator, SrcAccessor > img, vigra::pair< DestIterator, DestAccessor > dest, T min, T max, int mapping)
functions to manage ROI's
std::set< unsigned int > UIntSet
bool loadSVMmodel(struct svm_model *&model, std::string &model_file)
loads the SVM model from file
vigra::pair< typename ROIImage< Image, Alpha >::image_traverser, typename ROIImage< Image, Alpha >::ImageAccessor > destImage(ROIImage< Image, Alpha > &img)
vigra::triple< typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::ImageConstAccessor > srcImageRange(const ROIImage< Image, Mask > &img)
helper function for ROIImages
std::vector< CPoint > CPointVector
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.
HuginBase::UIntSet getCelesteControlPoints(struct svm_model *model, vigra::UInt16RGBImage &input, HuginBase::CPointVector cps, int radius, float threshold, int resize_dimension, bool verbose)