18 #ifndef PIC_ALGORITHMS_COLOR_CLASSIFICATION_HPP 19 #define PIC_ALGORITHMS_COLOR_CLASSIFICATION_HPP 21 #include "../base.hpp" 23 #include "../util/math.hpp" 25 #include "../image.hpp" 26 #include "../filtering/filter_radial_basis_function.hpp" 27 #include "../filtering/filter_white_balance.hpp" 28 #include "../filtering/filter_luminance.hpp" 29 #include "../algorithms/lischinski_minimization.hpp" 30 #include "../util/mask.hpp" 34 #ifndef PIC_DISABLE_EIGEN 48 if(color_samples == NULL || nSamples < 1 || nDim < 1 || variance <= 0.0f) {
53 rbf.
update(color_samples, nSamples, nDim, variance);
64 if(white_pixel != NULL) {
72 img_wb->
Write(
"../data/output/s_input_wb.bmp");
77 img_wb_rbf->
clamp(0.0f, 1.0f);
86 int width = opt->
width;
102 opt->
Write(
"../data/output/opt.bmp");
void update(RadialBasisFunction *rbf)
update
Definition: filter_radial_basis_function.hpp:96
int channels
Definition: image.hpp:80
void clamp(float a, float b)
clamp set data values in the range [a,b]
void update(float *centers, int nCenters, int nDim, float var)
update
Definition: radial_basis_function.hpp:59
PIC_INLINE bool * computeColorClassification(Image *img, float *white_pixel, float *color_samples, int nSamples, int nDim, float variance)
computeColorClassification
Definition: color_classification.hpp:46
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
PIC_INLINE Image * LischinskiMinimization(Image *L, Image *g, Image *omega=NULL, float omega_global=1.0f, Image *gOut=NULL, float alpha=1.0f, float lambda=0.4f, float LISCHINSKI_EPSILON=1e-4f)
LischinskiMinimization.
Definition: lischinski_minimization.hpp:82
static Image * execute(Image *imgIn, Image *imgOut, LUMINANCE_TYPE type=LT_CIE_LUMINANCE)
execute
Definition: filter_luminance.hpp:166
bool * convertToMask(float *color, float threshold, bool cmp, bool *mask)
convertToMask converts an Image into a boolean mask.
The FilterWhiteBalance class.
Definition: filter_white_balance.hpp:31
static bool * erode(bool *dataOut, bool *dataIn, int width, int height, int kernelSize=3)
erode erodes a mask.
Definition: mask.hpp:89
#define PIC_INLINE
Definition: base.hpp:33
The Image class stores an image as buffer of float.
Definition: image.hpp:60
static Image * execute(Image *imgIn, float *white_color, Image *out)
execute
Definition: filter_white_balance.hpp:162
void update(float *white, unsigned int nWhite, bool bComputeScalingFactors)
update
Definition: filter_white_balance.hpp:135
static bool * dilate(bool *dataOut, bool *dataIn, int width, int height, int kernelSize=3)
MaskDilate dilates a mask.
Definition: mask.hpp:137
PIC_INLINE ImageVec Single(Image *img)
Single creates an std::vector which contains img; this is for filters input.
Definition: image_vec.hpp:36
Definition: bilateral_separation.hpp:25
static bool * removeIsolatedPixels(bool *dataOut, bool *dataIn, int width, int height)
removeIsolatedPixels removes isolated pixels.
Definition: mask.hpp:38
void convertFromMask(bool *mask, int width, int height)
convertFromMask converts a boolean mask into an Image. true is mapped to 1.0f, and false is mapped to...
The RadialBasisFunction class.
Definition: radial_basis_function.hpp:30
int width
Definition: image.hpp:80
int height
Definition: image.hpp:80
bool Write(std::string nameFile, LDR_type typeWrite, int writerCounter)
Write saves an Image into a file on the disk.
The FilterRadialBasisFunction class.
Definition: filter_radial_basis_function.hpp:30