F. Fleuret and D. Geman, "Stationary Features and Cat Detection",
Journal of Machine Learning Research (JMLR), 2008, to appear.
- Please use that citation and the original URL
+ Please use that citation and the URL
http://www.idiap.ch/folded-ctf
on several machines as long as they see the same result directory.
When all or some of the experimental rounds are over, you can
- generate the ROC curves by invoking the ./graph.sh script. You need
- a fairly recent version of Gnuplot.
+ generate ROC curves by invoking ./graph.sh script. You need a fairly
+ recent version of Gnuplot.
+
+ If you pass the argument "pics" to the ./graphs.sh script, it will
+ save images from the data set with the ground truth plotted on them,
+ the pose-indexed referential, and examples of the pose-indexed
+ feature windows.
This program was developed on Debian GNU/Linux computers with the
following main tool versions
---------------------
The main command has to be invoked with a list of parameter values,
- followed by commands to execute.
-
- To set the value of a parameter, just add an argument of the form
- --parameter-name=value before the commands that should take it into
- account.
+ followed by commands to execute. A parameter value is modified by
+ adding an argument of the form --parameter-name=value.
For instance, to open a scene pool ./something.pool, train a
- detector and save it, you would do
+ detector and save it with all other parameters kept at their default
+ value, you would do
./folding --pool-name=./something.pool open-pool train-detector write-detector
if(global.write_parse_images) {
char buffer[buffer_size];
sprintf(buffer, "%s/parse-%04d.png", global.result_path, i);
- cout << "LEVEL = " << level << endl;
write_image_with_detections(buffer,
image,
&result_cell_set, level);
parser->add_association("min-head-radius", "25", false);
// What is the maximum size of the heads to detect.
parser->add_association("max-head-radius", "200", false);
- // How many translation cell for one scale when generating the "top
+ // How many translation cell per radius when generating the "top
// level" cells for an image.
parser->add_association("root-cell-nb-xy-per-radius", "5", false);
_nb_levels = global.nb_levels;
_min_head_radius = global.min_head_radius;
_max_head_radius = global.max_head_radius;
- _root_cell_nb_xy_per_scale = global.root_cell_nb_xy_per_radius;
+ _root_cell_nb_xy_per_radius = global.root_cell_nb_xy_per_radius;
LabelledImage *image;
int nb_total_targets = 0;
void PoseCellHierarchy::write(ostream *os) {
write_var(os, &_min_head_radius);
write_var(os, &_max_head_radius);
- write_var(os, &_root_cell_nb_xy_per_scale);
+ write_var(os, &_root_cell_nb_xy_per_radius);
write_var(os, &_nb_belly_cells);
for(int k = 0; k < _nb_belly_cells; k++)
write_var(os, &_belly_cells[k]);
delete[] _belly_cells;
read_var(is, &_min_head_radius);
read_var(is, &_max_head_radius);
- read_var(is, &_root_cell_nb_xy_per_scale);
+ read_var(is, &_root_cell_nb_xy_per_radius);
read_var(is, &_nb_belly_cells);
delete[] _belly_cells;
_belly_cells = new RelativeBellyPoseCell[_nb_belly_cells];
int _nb_levels;
scalar_t _min_head_radius;
scalar_t _max_head_radius;
- int _root_cell_nb_xy_per_scale;
+ int _root_cell_nb_xy_per_radius;
int _nb_belly_cells;
#include "rgb_image_subpixel.h"
-RGBImageSubpixel::RGBImageSubpixel(int width, int height) : RGBImage(width * _scale, height* _scale) { }
+RGBImageSubpixel::RGBImageSubpixel(int width, int height) : RGBImage(width * scale, height* scale) { }
-RGBImageSubpixel::RGBImageSubpixel(RGBImage *image) : RGBImage(image->width() * _scale, image->height() * _scale) {
+RGBImageSubpixel::RGBImageSubpixel(RGBImage *image) : RGBImage(image->width() * scale, image->height() * scale) {
for(int y = 0; y < _height; y++) {
for(int x = 0; x < _width; x++) {
set_pixel(x, y,
- image->pixel(x / _scale, y / _scale, RGBImage::RED),
- image->pixel(x / _scale, y / _scale, RGBImage::GREEN),
- image->pixel(x / _scale, y / _scale, RGBImage::BLUE));
+ image->pixel(x / scale, y / scale, RGBImage::RED),
+ image->pixel(x / scale, y / scale, RGBImage::GREEN),
+ image->pixel(x / scale, y / scale, RGBImage::BLUE));
}
}
}
}
void RGBImageSubpixel::write_png(const char *filename) {
- RGBImage tmp(_width / _scale, _height / _scale);
- for(int y = 0; y < _height / _scale; y++) {
- for(int x = 0; x < _width / _scale; x++) {
+ RGBImage tmp(_width / scale, _height / scale);
+ for(int y = 0; y < _height / scale; y++) {
+ for(int x = 0; x < _width / scale; x++) {
int sr = 0, sg = 0, sb = 0;
- for(int yy = y * _scale; yy < (y + 1) * _scale; yy++) {
- for(int xx = x * _scale; xx < (x + 1) * _scale; xx++) {
+ for(int yy = y * scale; yy < (y + 1) * scale; yy++) {
+ for(int xx = x * scale; xx < (x + 1) * scale; xx++) {
sr += int(_bit_plans[RED][yy][xx]);
sg += int(_bit_plans[GREEN][yy][xx]);
sb += int(_bit_plans[BLUE][yy][xx]);
}
tmp.set_pixel(x, y,
- sr / (_scale * _scale), sg / (_scale * _scale), sb / (_scale * _scale));
+ sr / (scale * scale), sg / (scale * scale), sb / (scale * scale));
}
}
tmp.write_png(filename);
}
void RGBImageSubpixel::write_jpg(const char *filename, int quality) {
- abort();
+ RGBImage tmp(_width / scale, _height / scale);
+
+ for(int y = 0; y < _height / scale; y++) {
+ for(int x = 0; x < _width / scale; x++) {
+ int sr = 0, sg = 0, sb = 0;
+ for(int yy = y * scale; yy < (y + 1) * scale; yy++) {
+ for(int xx = x * scale; xx < (x + 1) * scale; xx++) {
+ sr += int(_bit_plans[RED][yy][xx]);
+ sg += int(_bit_plans[GREEN][yy][xx]);
+ sb += int(_bit_plans[BLUE][yy][xx]);
+ }
+ }
+
+ tmp.set_pixel(x, y,
+ sr / (scale * scale), sg / (scale * scale), sb / (scale * scale));
+ }
+ }
+
+ tmp.write_jpg(filename, quality);
}
void RGBImageSubpixel::draw_line(int thickness,
unsigned char r, unsigned char g, unsigned char b,
scalar_t x0, scalar_t y0, scalar_t x1, scalar_t y1) {
- RGBImage::draw_line(int(thickness * _scale),
+ RGBImage::draw_line(int(thickness * scale),
r, g, b,
- x0 * _scale + _scale/2, y0 * _scale + _scale/2,
- x1 * _scale + _scale/2, y1 * _scale + _scale/2);
+ x0 * scale + scale/2, y0 * scale + scale/2,
+ x1 * scale + scale/2, y1 * scale + scale/2);
}
#include "rgb_image.h"
class RGBImageSubpixel : public RGBImage {
- static const int _scale = 8;
+ static const int scale = 8;
public:
RGBImageSubpixel(int width, int height);
RGBImageSubpixel(RGBImage *image);
virtual ~RGBImageSubpixel();
- inline int width() const { return _width / _scale; }
- inline int height() const { return _height / _scale; }
+ inline int width() const { return _width / scale; }
+ inline int height() const { return _height / scale; }
virtual void read_png(const char *filename);
virtual void write_png(const char *filename);