X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=pi_feature.h;fp=pi_feature.h;h=b03a922bbeb1b314377c6b15a7cc97981cbd7fb4;hb=d922ad61d35e9a6996730bec24b16f8bf7bc426c;hp=0000000000000000000000000000000000000000;hpb=3bb118f5a9462d02ff7d99ef28ecc0d7e23529f9;p=folded-ctf.git diff --git a/pi_feature.h b/pi_feature.h new file mode 100644 index 0000000..b03a922 --- /dev/null +++ b/pi_feature.h @@ -0,0 +1,86 @@ + +/////////////////////////////////////////////////////////////////////////// +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the version 3 of the GNU General Public License // +// as published by the Free Software Foundation. // +// // +// This program is distributed in the hope that it will be useful, but // +// WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // +// General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +// // +// Written by Francois Fleuret, (C) IDIAP // +// Contact for comments & bug reports // +/////////////////////////////////////////////////////////////////////////// + +/* + + This class implement the notion of pi-feature, that is a feature + which can be evaluated on a pair image / referential, where the + referential is computed from a pose cell. + +*/ + +#ifndef PI_FEATURE_H +#define PI_FEATURE_H + +#include "misc.h" +#include "global.h" +#include "rich_image.h" +#include "pi_referential.h" + +class PiFeature { + + enum { + PF_EDGE_THRESHOLDING, + PF_EDGE_HISTOGRAM_COMPARISON, + PF_GRAYSCALE_HISTOGRAM_COMPARISON, + } _type; + + int _tag, _edge_scale; + Rectangle _window_a, _window_b; + int _registration_a, _registration_b; + + int random_registration_mode(int level); + void randomize_window(int registration_mode, Rectangle *window); + void draw_window(RGBImage *image, int registration_mode, Rectangle *window); + + // EDGE THRESHOLDING + + scalar_t response_edge_thresholding(RichImage *image, PiReferential *referential); + void draw_edge_thresholding(RGBImage *image, int r, int g, int b, + PiReferential *referential); + void print_edge_thresholding(ostream *os); + + // EDGE ORIENTATION HISTOGRAM COMPARISON + + scalar_t response_edge_histogram_comparison(RichImage *image, PiReferential *referential); + void draw_edge_histogram_comparison(RGBImage *image, int r, int g, int b, + PiReferential *referential); + void print_edge_histogram_comparison(ostream *os); + + // GRAYSCALE HISTOGRAM COMPARISON + + scalar_t response_grayscale_histogram_comparison(RichImage *image, PiReferential *referential); + void draw_grayscale_histogram_comparison(RGBImage *image, + int r, int g, int b, + PiReferential *referential); + void print_grayscale_histogram_comparison(ostream *os); + +public: + + void randomize(int level); + + scalar_t response(RichImage *image, PiReferential *referential); + + void draw(RGBImage *image, + int r, int g, int b, + PiReferential *referential); + + void print(ostream *os); +}; + +#endif