KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
kjb::Spot_detector Class Reference

A spot detector functor, comparable to a blob detector. More...

#include <blob_spot_detector.h>

Public Types

typedef std::vector< VectorCentroid_set
 
typedef std::vector< std::pair
< int, int > > 
Pair_vector
 

Public Member Functions

 Spot_detector (const Matrix &background, const Matrix &thresholds, int min_brightness, int min_size, int max_size, double similarity)
 Construct a spot detector with the given parameters. More...
 
 Spot_detector (int num_rows, int num_cols, double background, double threshold, int min_brightness, int min_size, int max_size, double similarity)
 Construct a spot detector using constant background, threshold. More...
 
const Centroid_setoperator() (const Image &) const
 Applies this spot detector to the given image. More...
 
const std::vector< Pair_vector > & get_spot_coordinates () const
 Retrieves the spots computed in the last call to operator(). More...
 
const Centroid_setget_spot_centroids () const
 Retrieves the spot centroids computed in last operator() call. More...
 

Detailed Description

A spot detector functor, comparable to a blob detector.

This class detects "spots" in images, where a spot is a set of 8-connected pixels that pass certain tests:

Use the operator() to apply this detector to an image.

Member Typedef Documentation

typedef std::vector<std::pair<int, int> > kjb::Spot_detector::Pair_vector

Constructor & Destructor Documentation

kjb::Spot_detector::Spot_detector ( const Matrix background,
const Matrix thresholds,
int  min_brightness,
int  min_size,
int  max_size,
double  similarity 
)
inline

Construct a spot detector with the given parameters.

Parameters
backgroundBackground image. Will be subtracted from the operand image. In applications involving sequences of images, it is usually the pixelwise average of all frames. With noisier image sequences, a matrix of pixelwise medians might work better.
thresholdsImage of thresholds. The brightest pixel in the operand image must be this much brighter than bg. In applications involving sequence of images, it is usually a multiple of the standard deviation of the images.
min_brightnessThe location of the brightest pixel above background must be at least this bright in the original input image.
min_sizeSpots with fewer pixels than this will be ignored.
max_sizeSpots with more pixels than this will be ignored.
similarityPixels in a blob must be at least this fraction as bright as the image's brightest pixel above background.
kjb::Spot_detector::Spot_detector ( int  num_rows,
int  num_cols,
double  background,
double  threshold,
int  min_brightness,
int  min_size,
int  max_size,
double  similarity 
)
inline

Construct a spot detector using constant background, threshold.

This ctor is similar to the ctor that takes Matrix background and and threshold inputs, for the case that the background is a uniform value across all pixels, and ditto for the thresholds.

Parameters
backgroundBackground value. Background image (see above) will be created from this value.
thresholdsThreshold value. Threshold image (see above) will be created from this value.
min_brightness(see other ctor)
min_size(see other ctor)
max_size(see other ctor)
similarity(see other ctor)

Member Function Documentation

const Centroid_set& kjb::Spot_detector::get_spot_centroids ( ) const
inline

Retrieves the spot centroids computed in last operator() call.

Returns
A set of spot centroids computed via operator(), or an empty set if the operator() has not been called.
const std::vector<Pair_vector>& kjb::Spot_detector::get_spot_coordinates ( ) const
inline

Retrieves the spots computed in the last call to operator().

Returns
A set of spots computed via operator(), or an empty set if the operator() has not been called.
const Spot_detector::Centroid_set & kjb::Spot_detector::operator() ( const Image img) const

Applies this spot detector to the given image.

Detects the spots in image and stores the spots in its internal state.

Returns
A const-ref to the set of spot centroids.

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