bazar  1.3.1
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
yape Class Reference

YAPE feature point detector. More...

#include <yape.h>

Inheritance diagram for yape:
Inheritance graph
[legend]
Collaboration diagram for yape:
Collaboration graph
[legend]

Classes

struct  dir_table

Public Member Functions

 yape (int width, int height)
 Constructor for detection in width x height images.
virtual ~yape ()
void set_radius (int radius)
int get_radius (void)
void set_tau (int tau)
int get_tau (void)
void activate_bins (void)
void disactivate_bins (void)
void set_use_bins (bool p_use_bins)
bool get_use_bins (void)
void set_bins_number (int nb_u, int nb_v)
void activate_subpixel (void)
 Subpixel. Can be activated or disactived (default) for monoscale detection. Always activated for multi-scale detection.
void disactivate_subpixel (void)
void set_use_subpixel (bool p_use_subpixel)
void set_minimal_neighbor_number (int p_minimal_neighbor_number)
int get_minimal_neighbor_number (void)
int detect (IplImage *image, keypoint *points, int max_point_number, IplImage *smoothed_image=0)
void raw_detect (IplImage *im)
 detect interest points and add them to tmp_points.
int pick_best_points (keypoint *points, unsigned int max_point_number)
 sort and select the max_point_number best features.
void save_image_of_detected_points (char *name, IplImage *image, keypoint *points, int points_nb)
 Save a color image with the detected points on the original image. Useful for visualisation...
IplImage * get_scores_image (void)
 Return scores and filtered images, for debugging purposes.
IplImage * get_filtered_image (void)
void subpix_refine (IplImage *im, keypoint *p)

Static Public Member Functions

static int static_detect (IplImage *image, keypoint *points, int max_point_number, int radius=7, int tau=10)
 Static function for point detection. Slower but avoids an instantiation.

Protected Types

typedef std::vector< keypointkeypoint_vector

Protected Member Functions

void reserve_tmp_arrays (void)
int get_local_maxima (IplImage *image, int R, float scale)
void perform_one_point (const unsigned char *I, const int x, short *Scores, const int Im, const int Ip, const short *dirs, const unsigned char opposite, const unsigned char dirs_nb)
bool double_check (IplImage *image, int x, int y, short *dirs, unsigned char dirs_nb)
bool third_check (const short *Sb, const int next_line)
void precompute_directions (IplImage *image, short *_Dirs, int *_Dirs_nb, int R)
void init_for_monoscale (void)

Protected Attributes

int minimal_neighbor_number
int width
int height
int radius
int tau
dir_tableDirs
int * Dirs_nb
keypoint_vector tmp_points
bool use_bins
keypoint_vector bins [10][10]
int bin_nb_u
int bin_nb_v
bool use_subpixel
IplImage * scores
IplImage * filtered_image
int stats_state [100]
int stats_iter [100]
int score
int a
int b
int A
int B0
int B1
int B2
int state
CvMat * H
CvMat * mg
CvMat * shift

Detailed Description

YAPE feature point detector.

Stands for Yet Another Point Extractor.

Usage:

You need OpenCV to use this code. Two different uses of the Yape class are possible:

1) The simplest way is to call the static function static_detect:

int N = yape::static_detect(image, points, maxNumberOfPoints[, radius]);

where:

The function returns the actual number of detected points.

2) Detection in a large number of images of same size:

If the detection should be performed on a large number of images of same size, you should first create an instance of the detector. The yape constructor performs some pre-computation and pre- memory allocation to save some computation time during the actual detection.

// Create an instance of Yape for detection in 640x480 images:
yape * pe = new yape(640, 480);
// The default value for the radius is 7. Use set_radius() to change it:
pe->set_radius(3);
// Call the function detect() exactly like the static_detect() function:
N[0] = pe->detect(images[0], points[0], 100);
N[1] = pe->detect(images[1], points[1], 100);
N[2] = pe->detect(images[2], points[2], 100);
N[3] = pe->detect(images[3], points[3], 100);
...
// Call the destructor:
delete pe;

The saveImageOfDetectedPoints function is useful to save an image of the detected points:

static void saveImageOfDetectedPoints(char * name, IplImage * image, CvPoint * points, int points_nb);

Definition at line 88 of file yape.h.

Member Typedef Documentation

typedef std::vector<keypoint> yape::keypoint_vector
protected

Definition at line 168 of file yape.h.

Constructor & Destructor Documentation

yape::yape ( int  width,
int  height 
)

Constructor for detection in width x height images.

Definition at line 47 of file yape.cpp.

yape::~yape ( )
virtual

Definition at line 66 of file yape.cpp.

Member Function Documentation

void yape::activate_bins ( void  )
inline

Definition at line 101 of file yape.h.

References set_use_bins().

void yape::activate_subpixel ( void  )
inline

Subpixel. Can be activated or disactived (default) for monoscale detection. Always activated for multi-scale detection.

Definition at line 108 of file yape.h.

References set_use_subpixel().

int yape::detect ( IplImage *  image,
keypoint points,
int  max_point_number,
IplImage *  smoothed_image = 0 
)

Definition at line 478 of file yape.cpp.

Referenced by static_detect().

void yape::disactivate_bins ( void  )
inline

Definition at line 102 of file yape.h.

References set_use_bins().

void yape::disactivate_subpixel ( void  )
inline

Definition at line 109 of file yape.h.

References set_use_subpixel().

bool yape::double_check ( IplImage *  image,
int  x,
int  y,
short *  dirs,
unsigned char  dirs_nb 
)
protected

Definition at line 196 of file yape.cpp.

IplImage* yape::get_filtered_image ( void  )
inline

Definition at line 131 of file yape.h.

References filtered_image.

int yape::get_local_maxima ( IplImage *  image,
int  R,
float  scale 
)
protected

Find local maximas in score image and append them to tmp_points.

Returns
the number of local maxima found.

Definition at line 684 of file yape.cpp.

References is_local_maxima(), keypoint::scale, keypoint::score, keypoint::u, keypoint::v, and yape_bin_size.

Referenced by pyr_yape::detect().

int yape::get_minimal_neighbor_number ( void  )
inline

Definition at line 113 of file yape.h.

References minimal_neighbor_number.

int yape::get_radius ( void  )
inline

Definition at line 96 of file yape.h.

References radius.

IplImage* yape::get_scores_image ( void  )
inline

Return scores and filtered images, for debugging purposes.

Definition at line 130 of file yape.h.

References scores.

int yape::get_tau ( void  )
inline

Definition at line 99 of file yape.h.

References tau.

bool yape::get_use_bins ( void  )
inline

Definition at line 104 of file yape.h.

References use_bins.

void yape::init_for_monoscale ( void  )
protected

Definition at line 97 of file yape.cpp.

References yape_max_radius.

void yape::perform_one_point ( const unsigned char *  I,
const int  x,
short *  Scores,
const int  Im,
const int  Ip,
const short *  dirs,
const unsigned char  opposite,
const unsigned char  dirs_nb 
)
protected
int yape::pick_best_points ( keypoint points,
unsigned int  max_point_number 
)

sort and select the max_point_number best features.

This method sorts tmp_points and select the max_point_number best points, as long as the score is high enough.

Definition at line 518 of file yape.cpp.

References mymin(), and N.

Referenced by pyr_yape::detect().

void yape::precompute_directions ( IplImage *  image,
short *  _Dirs,
int *  _Dirs_nb,
int  R 
)
protected

Definition at line 126 of file yape.cpp.

Referenced by pyr_yape::pyr_yape().

void yape::raw_detect ( IplImage *  im)

detect interest points and add them to tmp_points.

Detect interest points, without filtering and without selecting best ones. Just find them and add them to tmp_points. tmp_points is not cleared in this method.

Definition at line 573 of file yape.cpp.

Referenced by pyr_yape::detect().

void yape::reserve_tmp_arrays ( void  )
protected

Definition at line 110 of file yape.cpp.

References yape_bin_size, and yape_tmp_points_array_size.

Referenced by pyr_yape::detect().

void yape::save_image_of_detected_points ( char *  name,
IplImage *  image,
keypoint points,
int  points_nb 
)

Save a color image with the detected points on the original image. Useful for visualisation...

Reimplemented in pyr_yape.

Definition at line 180 of file yape.cpp.

References PyrImage::convCoordf(), mcvCircle(), mcvGrayToColor(), mcvRainbowColor(), and mcvSaveImage().

void yape::set_bins_number ( int  nb_u,
int  nb_v 
)
inline

Definition at line 105 of file yape.h.

References bin_nb_u, and bin_nb_v.

void yape::set_minimal_neighbor_number ( int  p_minimal_neighbor_number)
inline

Definition at line 112 of file yape.h.

References minimal_neighbor_number.

void yape::set_radius ( int  radius)

Definition at line 87 of file yape.cpp.

Referenced by static_detect().

void yape::set_tau ( int  tau)

Definition at line 92 of file yape.cpp.

Referenced by static_detect().

void yape::set_use_bins ( bool  p_use_bins)
inline

Definition at line 103 of file yape.h.

References use_bins.

Referenced by activate_bins(), and disactivate_bins().

void yape::set_use_subpixel ( bool  p_use_subpixel)
inline

Definition at line 110 of file yape.h.

References use_subpixel.

Referenced by activate_subpixel(), and disactivate_subpixel().

int yape::static_detect ( IplImage *  image,
keypoint points,
int  max_point_number,
int  radius = 7,
int  tau = 10 
)
static

Static function for point detection. Slower but avoids an instantiation.

Definition at line 74 of file yape.cpp.

References detect(), set_radius(), and set_tau().

void yape::subpix_refine ( IplImage *  im,
keypoint p 
)

Definition at line 771 of file yape.cpp.

References fit_quadratic_2x2(), keypoint::score, keypoint::u, and keypoint::v.

Referenced by pyr_yape::detect().

bool yape::third_check ( const short *  Sb,
const int  next_line 
)
inlineprotected

Definition at line 617 of file yape.cpp.

References E, N, S, and W.

Member Data Documentation

int yape::a
protected

Definition at line 187 of file yape.h.

int yape::A
protected

Definition at line 188 of file yape.h.

int yape::b
protected

Definition at line 187 of file yape.h.

int yape::B0
protected

Definition at line 188 of file yape.h.

int yape::B1
protected

Definition at line 188 of file yape.h.

int yape::B2
protected

Definition at line 188 of file yape.h.

int yape::bin_nb_u
protected

Definition at line 174 of file yape.h.

Referenced by set_bins_number().

int yape::bin_nb_v
protected

Definition at line 174 of file yape.h.

Referenced by set_bins_number().

keypoint_vector yape::bins[10][10]
protected

Definition at line 173 of file yape.h.

dir_table* yape::Dirs
protected

Definition at line 164 of file yape.h.

Referenced by pyr_yape::pyr_yape(), pyr_yape::select_level(), and pyr_yape::~pyr_yape().

int* yape::Dirs_nb
protected

Definition at line 165 of file yape.h.

Referenced by pyr_yape::pyr_yape(), pyr_yape::select_level(), and pyr_yape::~pyr_yape().

IplImage * yape::filtered_image
protected

Definition at line 180 of file yape.h.

Referenced by get_filtered_image().

CvMat* yape::H
protected

Definition at line 191 of file yape.h.

int yape::height
protected

Definition at line 152 of file yape.h.

CvMat* yape::mg
protected

Definition at line 192 of file yape.h.

int yape::minimal_neighbor_number
protected

Definition at line 146 of file yape.h.

Referenced by get_minimal_neighbor_number(), and set_minimal_neighbor_number().

int yape::radius
protected
int yape::score
protected

Definition at line 186 of file yape.h.

IplImage* yape::scores
protected
CvMat* yape::shift
protected

Definition at line 193 of file yape.h.

int yape::state
protected

Definition at line 189 of file yape.h.

int yape::stats_iter[100]
protected

Definition at line 183 of file yape.h.

int yape::stats_state[100]
protected

Definition at line 183 of file yape.h.

int yape::tau
protected

Definition at line 158 of file yape.h.

Referenced by get_tau().

keypoint_vector yape::tmp_points
protected

Definition at line 169 of file yape.h.

bool yape::use_bins
protected

Definition at line 172 of file yape.h.

Referenced by get_use_bins(), and set_use_bins().

bool yape::use_subpixel
protected

Definition at line 177 of file yape.h.

Referenced by set_use_subpixel().

int yape::width
protected

Definition at line 152 of file yape.h.


The documentation for this class was generated from the following files: