KJB
|
A spot detector functor, comparable to a blob detector. More...
#include <blob_spot_detector.h>
Public Types | |
typedef std::vector< Vector > | Centroid_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_set & | operator() (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_set & | get_spot_centroids () const |
Retrieves the spot centroids computed in last operator() call. More... | |
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.
typedef std::vector<Vector> kjb::Spot_detector::Centroid_set |
typedef std::vector<std::pair<int, int> > kjb::Spot_detector::Pair_vector |
|
inline |
Construct a spot detector with the given parameters.
background | Background 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. |
thresholds | Image 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_brightness | The location of the brightest pixel above background must be at least this bright in the original input image. |
min_size | Spots with fewer pixels than this will be ignored. |
max_size | Spots with more pixels than this will be ignored. |
similarity | Pixels in a blob must be at least this fraction as bright as the image's brightest pixel above background. |
|
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.
background | Background value. Background image (see above) will be created from this value. |
thresholds | Threshold 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) |
|
inline |
Retrieves the spot centroids computed in last operator() call.
|
inline |
Retrieves the spots computed in the last call to operator().
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.