OpenCV
This arrow is a collection of vital algorithms implemented with the OpenCV API
This arrow can be built by enabling the KWIVER_ENABLE_OPENCV CMake flag
This arrow contains the following functionality:
Analyze Tracks Algorithm
-
class kwiver::arrows::ocv::analyze_tracks : public kwiver::vital::algo::analyze_tracks
A class for outputting various debug info about feature tracks.
Public Functions
- PLUGIN_INFO ("ocv", "Use OpenCV to analyze statistics of feature tracks.") analyze_tracks()
Constructor.
-
virtual ~analyze_tracks()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid.
-
virtual void print_info(vital::track_set_sptr track_set, stream_t &stream = std::cout) const
Output various information about the tracks stored in the input set.
- Parameters
track_set – [in] the tracks to analyze
stream – [in] an output stream to write data onto
Detect Features Algorithm
-
class kwiver::arrows::ocv::detect_features : public kwiver::vital::algo::detect_features
OCV Specific base definition for algorithms that detect feature points.
This extended algorithm_def provides a common implementation for the detect method.
Subclassed by kwiver::arrows::ocv::detect_features_BRISK, kwiver::arrows::ocv::detect_features_FAST, kwiver::arrows::ocv::detect_features_GFTT, kwiver::arrows::ocv::detect_features_MSER, kwiver::arrows::ocv::detect_features_ORB, kwiver::arrows::ocv::detect_features_simple_blob, kwiver::arrows::ocv::detect_features_STAR
Public Functions
-
virtual vital::feature_set_sptr detect(vital::image_container_sptr image_data, vital::image_container_sptr mask = vital::image_container_sptr()) const
Extract a set of image features from the provided image.
A given mask image should be one-channel (mask->depth() == 1). If the given mask image has more than one channel, only the first will be considered.
- Parameters
image_data – contains the image data to process
mask – Mask image where regions of positive values (boolean true) indicate regions to consider. Only the first channel will be considered.
- Returns
a set of image features
-
virtual vital::feature_set_sptr detect(vital::image_container_sptr image_data, vital::image_container_sptr mask = vital::image_container_sptr()) const
Detect Features AGAST Algorithm
Warning
doxygenclass: Cannot find class “kwiver::arrows::ocv::detect_features_AGAST” in doxygen xml output for project “kwiver” from directory: ./_build/xml
Detect Features FAST Algorithm
-
class kwiver::arrows::ocv::detect_features_FAST : public kwiver::arrows::ocv::detect_features
Public Functions
- PLUGIN_INFO ("ocv_FAST", "OpenCV feature detection via the FAST algorithm") detect_features_FAST()
Constructor.
-
virtual ~detect_features_FAST()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration vital::config_block is valid.
-
virtual vital::feature_set_sptr detect(vital::image_container_sptr image_data, vital::image_container_sptr mask = vital::image_container_sptr()) const
Extract a set of image features from the provided image.
A given mask image should be one-channel (mask->depth() == 1). If the given mask image has more than one channel, only the first will be considered. This method overrides the base detect method and adds dynamic threshold adaptation. It adjusts the detector’s feature strength threshold to try and extract a target number of features in each frame. Because scene content varies between images, different feature strength thresholds may be necessary to get the same number of feautres in different images.
- Parameters
image_data – contains the image data to process
mask – Mask image where regions of positive values (boolean true) indicate regions to consider. Only the first channel will be considered.
- Returns
a set of image features
-
class priv
Public Functions
-
inline priv()
Constructor.
-
inline cv::Ptr<cv::FastFeatureDetector> create() const
Create a new FAST detector instance with the current parameter values.
-
inline void update(cv::Ptr<cv::FeatureDetector> detector) const
Update the parameters of the given detector with the currently set values.
-
inline void update_config(config_block_sptr config) const
Update given config block with currently set parameter values.
-
inline void set_config(config_block_sptr const &config)
Set parameter values based on given config block.
-
inline bool check_config(vital::config_block_sptr const &config, logger_handle_t const &logger) const
Check config parameter values.
-
inline priv()
Detect Features GFTT Algorithm
-
class kwiver::arrows::ocv::detect_features_GFTT : public kwiver::arrows::ocv::detect_features
Public Functions
- PLUGIN_INFO ("ocv_GFTT", "OpenCV feature detection via the GFTT algorithm") detect_features_GFTT()
Constructor.
-
virtual ~detect_features_GFTT()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration vital::config_block is valid.
-
class priv
Public Functions
-
inline priv()
Constructor.
-
inline cv::Ptr<cv::GFTTDetector> create() const
Create a new GFTT detector instance with the current parameter values.
-
inline void update_config(config_block_sptr config) const
Update given config block with currently set parameter values.
-
inline void set_config(config_block_sptr const &config)
Set parameter values based on given config block.
Public Members
-
int max_corners
Parameters.
-
inline priv()
Detect Features MSD Algorithm
Warning
doxygenclass: Cannot find class “kwiver::arrows::ocv::detect_features_MSD” in doxygen xml output for project “kwiver” from directory: ./_build/xml
Detect Features MSER Algorithm
-
class kwiver::arrows::ocv::detect_features_MSER : public kwiver::arrows::ocv::detect_features
Public Functions
- PLUGIN_INFO ("ocv_MSER", "OpenCV feature detection via the MSER algorithm") detect_features_MSER()
Constructor.
-
virtual ~detect_features_MSER()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration vital::config_block is valid.
-
class priv
Public Functions
-
inline priv()
Constructor.
-
inline void update_config(config_block_sptr config) const
Update given config block with currently set parameter values.
-
inline void set_config(config_block_sptr const &c)
Set parameter values based on given config block.
-
inline bool check_config(vital::config_block_sptr const &c, logger_handle_t const &logger) const
Check config parameter values.
Public Members
-
int delta
Parameters.
-
inline priv()
Detect Features Simple BLOB Algorithm
-
class kwiver::arrows::ocv::detect_features_simple_blob : public kwiver::arrows::ocv::detect_features
Public Functions
- PLUGIN_INFO ("ocv_simple_blob", "OpenCV feature detection via the simple_blob algorithm.") detect_features_simple_blob()
Constructor.
-
virtual ~detect_features_simple_blob()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration vital::config_block is valid.
-
class priv
Public Functions
-
inline priv()
Constructor.
-
inline cv::Ptr<cv::SimpleBlobDetector> create() const
Create new algorithm based on current parameter values.
-
inline void update_config(config_block_sptr config) const
Update config block with current parameters and values.
-
inline void set_config(config_block_sptr config)
Set the current parameter values based on the given config block.
-
inline priv()
Detect Features STAR Algorithm
-
class kwiver::arrows::ocv::detect_features_STAR : public kwiver::arrows::ocv::detect_features
Public Functions
- PLUGIN_INFO ("ocv_STAR", "OpenCV feature detection via the STAR algorithm") detect_features_STAR()
Constructor.
-
virtual ~detect_features_STAR()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
-
class priv
Draw Detected Object Set Algorithm
-
class kwiver::arrows::ocv::draw_detected_object_set : public kwiver::vital::algo::draw_detected_object_set
An abstract base class for algorithms which draw tracks on top of images in various ways, for analyzing results.
Public Functions
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
Get this alg’s configuration block .
This method returns the required configuration for the algorithm. The implementation of this method should be light-weight and only create and fill in the config block.
This base virtual function implementation returns an empty configuration.
- Returns
config_blockcontaining the configuration for this algorithm and any nested components.
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
This method is called to pass a configuration to the algorithm. The implementation of this method should be light-weight and only save the necessary config values. Defer any substantial processing in another method.
- Throws
no_such_configuration_value_exception – Thrown if an expected configuration value is not present.
algorithm_configuration_exception – Thrown when the algorithm is given an invalid
config_blockor is otherwise unable to configure itself.
- Parameters
config – The
config_blockinstance containing the configuration parameters for this algorithm
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritance reasons.- Parameters
config – The config block to check configuration of.
- Returns
true if the configuration check passed and false if it didn’t.
-
virtual kwiver::vital::image_container_sptr draw(kwiver::vital::detected_object_set_sptr detected_set, kwiver::vital::image_container_sptr image)
Draw detected object boxes om image.
- Parameters
detected_set – Set of detected objects
image – Boxes are drawn in this image
- Returns
Image with boxes and other annotations added.
-
class priv
Public Functions
-
inline void draw_box(cv::Mat &image, const vital::detected_object_sptr dos, std::string label, double prob, bool just_text = false, int offset_index = 0) const
Draw a box on an image.
This method draws a box on an image for the bounding box from a detected object.
When drawing a box with multiple class names, draw the first class_name with the
just_textparameter false and all subsequent calls with it set to true. Also theoffsetparameter must be incremented so the labels do not overwrite.- Parameters
image – [inout] Input image updated with drawn box
dos – [in] detected object with bounding box
label – [in] Text label to use for box
prob – [in] Probability value to add to label text
just_text – [in] Set to true if only draw text, not the bounding box. This is used when there are multiple labels for the same detection.
offset – [in] How much to offset text fill box from text baseline. This is used to offset labels when there are more than one label for a detection.
-
inline vital::image_container_sptr draw_detections(vital::image_container_sptr image_data, vital::detected_object_set_sptr in_set) const
Draw detected object on image.
This method draws the detections on a copy of the supplied image. The detections are drawn in confidence order up to the threshold. For each detection, the most likely class_name is optionally displayed below the box.
- Parameters
image_data – The image to draw on.
input_set – List of detections to draw.
- Returns
New image with boxes drawn.
-
inline bool name_selected(std::string const &name) const
See if name has been selected for display.
- Parameters
name – Name to check.
- Returns
true if name should be rendered
-
struct Bound_Box_Params
-
inline void draw_box(cv::Mat &image, const vital::detected_object_sptr dos, std::string label, double prob, bool just_text = false, int offset_index = 0) const
-
virtual vital::config_block_sptr get_configuration() const
Draw Tracks Algorithm
-
class kwiver::arrows::ocv::draw_tracks : public kwiver::vital::algo::draw_tracks
A class for drawing various information about feature tracks.
Public Functions
- PLUGIN_INFO ("ocv", "Use OpenCV to draw tracked features on the images.") draw_tracks()
Constructor.
-
virtual ~draw_tracks()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid.
-
virtual vital::image_container_sptr draw(vital::track_set_sptr display_set, vital::image_container_sptr_list image_data, vital::track_set_sptr comparison_set = vital::track_set_sptr())
Draw features tracks on top of the input images.
Output images with tracked features drawn on them.
This process can either be called in an offline fashion, where all tracks and images are provided to the function on the first call, or in an online fashion where only new images are provided on sequential calls. This function can additionally consumes a second track set for which can optionally be used to display additional information to provide a comparison between the two track sets.
- Parameters
display_set – [in] the main track set to draw
image_data – [in] a list of images the tracks were computed over
comparison_set – [in] optional comparison track set
- Returns
a pointer to the last image generated
-
class priv
Private implementation class.
Estimate Fundamental Matrix Algorithm
-
class kwiver::arrows::ocv::estimate_fundamental_matrix : public kwiver::vital::algo::estimate_fundamental_matrix
A class that using OpenCV to estimate a fundamental matrix from matching 2D points.
Public Functions
- PLUGIN_INFO ("ocv", "Use OpenCV to estimate a fundimental matrix from feature matches.") estimate_fundamental_matrix()
Constructor.
-
virtual ~estimate_fundamental_matrix()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
-
virtual vital::fundamental_matrix_sptr estimate(const std::vector<vital::vector_2d> &pts1, const std::vector<vital::vector_2d> &pts2, std::vector<bool> &inliers, double inlier_scale = 3.0) const
Estimate a fundamental matrix from corresponding points.
If estimation fails, a NULL-containing sptr is returned
- Parameters
pts1 – [in] the vector or corresponding points from the source image
pts2 – [in] the vector of corresponding points from the destination image
inliers – [out] for each point pair, the value is true if this pair is an inlier to the fundamental matrix estimate
inlier_scale – [in] error distance tolerated for matches to be inliers
Estimate Homography Algorithm
-
class estimate_homography : public kwiver::vital::algo::estimate_homography
A class that using OpenCV to estimate a homography from matching 2D points.
Extract Descriptors Algorithm
-
class kwiver::arrows::ocv::extract_descriptors : public kwiver::vital::algo::extract_descriptors
OCV specific definition for algorithms that describe feature points.
This extended algorithm_def provides a common implementation for the extract method.
Subclassed by kwiver::arrows::ocv::extract_descriptors_BRIEF, kwiver::arrows::ocv::extract_descriptors_BRISK, kwiver::arrows::ocv::extract_descriptors_FREAK, kwiver::arrows::ocv::extract_descriptors_ORB
Public Functions
-
virtual vital::descriptor_set_sptr extract(vital::image_container_sptr image_data, vital::feature_set_sptr &features, vital::image_container_sptr image_mask = vital::image_container_sptr()) const
Extract from the image a descriptor corresponding to each feature.
- Parameters
image_data – contains the image data to process
features – the feature locations at which descriptors are extracted
- Returns
a set of feature descriptors
-
virtual vital::descriptor_set_sptr extract(vital::image_container_sptr image_data, vital::feature_set_sptr &features, vital::image_container_sptr image_mask = vital::image_container_sptr()) const
Extract Descriptors BRIEF Algorithm
-
class kwiver::arrows::ocv::extract_descriptors_BRIEF : public kwiver::arrows::ocv::extract_descriptors
Public Functions
- PLUGIN_INFO ("ocv_BRIEF", "OpenCV feature-point descriptor extraction via the BRIEF algorithm") extract_descriptors_BRIEF()
Constructor.
-
virtual ~extract_descriptors_BRIEF()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
-
class priv
Extract Descriptors DAISY Algorithm
Warning
doxygenclass: Cannot find class “kwiver::arrows::ocv::extract_descriptors_DAISY” in doxygen xml output for project “kwiver” from directory: ./_build/xml
Extract Descriptors FREAK Algorithm
-
class kwiver::arrows::ocv::extract_descriptors_FREAK : public kwiver::arrows::ocv::extract_descriptors
Public Functions
- PLUGIN_INFO ("ocv_FREAK", "OpenCV feature-point descriptor extraction via the FREAK algorithm") extract_descriptors_FREAK()
Constructor.
-
extract_descriptors_FREAK(extract_descriptors_FREAK const &other)
Copy Constructor.
Constructor.
- Parameters
other – The other FREAK descriptor extractor to copy
-
virtual ~extract_descriptors_FREAK()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
-
class priv
Public Functions
-
inline priv()
Constructor.
-
inline cv::Ptr<cv_FREAK_t> create() const
Create new cv::Ptr algo instance.
-
inline void update(cv::Ptr<cv_FREAK_t> freak) const
Update algorithm instance with current parameter values.
-
inline void update_config(vital::config_block_sptr &config) const
Set current parameter values to the given config block.
-
inline void set_config(vital::config_block_sptr const &config)
Set our parameters based on the given config block.
Public Members
-
bool orientation_normalized
Params.
-
inline priv()
Extract Descriptors LATCH Algorithm
Warning
doxygenclass: Cannot find class “kwiver::arrows::ocv::extract_descriptors_LATCH” in doxygen xml output for project “kwiver” from directory: ./_build/xml
Extract Descriptors LUCID Algorithm
Warning
doxygenclass: Cannot find class “kwiver::arrows::ocv::extract_descriptors_LUCID” in doxygen xml output for project “kwiver” from directory: ./_build/xml
Extrack Descriptors BRISK Algorithm
-
class extract_descriptors_BRISK : public kwiver::arrows::ocv::extract_descriptors
Detect Features BRISK Algorithm
-
class detect_features_BRISK : public kwiver::arrows::ocv::detect_features
Extrack Descriptors ORB Algorithm
-
class extract_descriptors_ORB : public kwiver::arrows::ocv::extract_descriptors
Detect Features ORB Algorithm
-
class detect_features_ORB : public kwiver::arrows::ocv::detect_features
Extrack Descriptors SIFT Algorithm
Warning
doxygenclass: Cannot find class “kwiver::arrows::ocv::extract_descriptors_SIFT” in doxygen xml output for project “kwiver” from directory: ./_build/xml
Detect Features SIFT Algorithm
Warning
doxygenclass: Cannot find class “kwiver::arrows::ocv::detect_features_SIFT” in doxygen xml output for project “kwiver” from directory: ./_build/xml
Extrack Descriptors SURF Algorithm
Warning
doxygenclass: Cannot find class “kwiver::arrows::ocv::extract_descriptors_SURF” in doxygen xml output for project “kwiver” from directory: ./_build/xml
Detect Features SURF Algorithm
Warning
doxygenclass: Cannot find class “kwiver::arrows::ocv::detect_features_SURF” in doxygen xml output for project “kwiver” from directory: ./_build/xml
Hough Circle Detector Algorithm
-
class kwiver::arrows::ocv::hough_circle_detector : public kwiver::vital::algo::image_object_detector
Public Functions
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
Get this alg’s configuration block .
This method returns the required configuration for the algorithm. The implementation of this method should be light-weight and only create and fill in the config block.
This base virtual function implementation returns an empty configuration.
- Returns
config_blockcontaining the configuration for this algorithm and any nested components.
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
This method is called to pass a configuration to the algorithm. The implementation of this method should be light-weight and only save the necessary config values. Defer any substantial processing in another method.
- Throws
no_such_configuration_value_exception – Thrown if an expected configuration value is not present.
algorithm_configuration_exception – Thrown when the algorithm is given an invalid
config_blockor is otherwise unable to configure itself.
- Parameters
config – The
config_blockinstance containing the configuration parameters for this algorithm
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritance reasons.- Parameters
config – The config block to check configuration of.
- Returns
true if the configuration check passed and false if it didn’t.
-
virtual vital::detected_object_set_sptr detect(vital::image_container_sptr image_data) const
Find all objects on the provided image.
This method analyzes the supplied image and along with any saved context, returns a vector of detected image objects.
- Parameters
image_data – the image pixels
- Returns
vector of image objects found
-
class priv
-
virtual vital::config_block_sptr get_configuration() const
Image Container Algorithm
-
class kwiver::arrows::ocv::image_container : public kwiver::vital::image_container
This image container wraps a cv::Mat.
Public Functions
-
explicit image_container(const cv::Mat &d, ColorMode cm)
Constructor - from a cv::Mat.
-
inline explicit image_container(const vital::image &vital_image)
Constructor - convert kwiver image to cv::Mat.
-
explicit image_container(const vital::image_container &image_cont)
Constructor - convert base image container to cv::Mat.
-
inline image_container(const arrows::ocv::image_container &other)
Copy Constructor.
-
virtual size_t size() const
The size of the image data in bytes.
This size includes all allocated image memory, which could be larger than width*height*depth.
-
inline virtual size_t width() const
The width of the image in pixels.
-
inline virtual size_t height() const
The height of the image in pixels.
-
inline virtual size_t depth() const
The depth (or number of channels) of the image.
-
inline cv::Mat get_Mat() const
Access the underlying cv::Mat data structure.
Public Static Functions
-
static vital::image ocv_to_vital(const cv::Mat &img, ColorMode cm)
Convert an OpenCV cv::Mat to a VITAL image.
This function constructs a vital::image from a cv::Mat and wraps the same memory. If the memory is owned by the cv::Mat this function will use a mat_image_memory class to retain the original memory and reference counting. If the cv::Mat does not own the memory, the vital::image will point to the same memory but also not take ownership. That is vital::image::memory() will return nullptr.
-
static vital::image_pixel_traits ocv_to_vital(int type)
Convert an OpenCV cv::Mat type value to a vital::image_pixel_traits.
-
static cv::Mat vital_to_ocv(const vital::image &img, ColorMode cm)
Convert a VITAL image to an OpenCV cv::Mat.
This function constructs a cv::Mat from a vital::image and wraps the same memory whenever possible. If the vital::image contains a mat_image_memory then the image data was originally created as a cv::Mat and this function will reconstruct the cv::Mat using the original memory and reference counting, if possible. If the vital::image does not own its memory, then the wrapped cv::Mat will also not own the memory.
The supported memory layouts are far more restricted in cv::Mat than in vital::image. If the image is not of a compatible type and cannot be directly wrapped then the a new cv::Mat is allocated and the image is deep copied. The same is true if the user requests a color mode other than the default BGR used by OpenCV. The data will be copied into new memory and the color is converted.
-
static int vital_to_ocv(const vital::image_pixel_traits &pt)
Convert a vital::image_pixel_traits to an OpenCV cv::Mat type integer.
-
explicit image_container(const cv::Mat &d, ColorMode cm)
Image I/O Algorithm
-
class kwiver::arrows::ocv::image_io : public kwiver::vital::algo::image_io
A class for using OpenCV to read and write images.
Public Functions
-
virtual kwiver::vital::metadata_sptr load_metadata_(std::string const &filename) const
Implementation specific metadata functionality.
Load image metadata from the file.
- Parameters
filename – the path to the file to read
- Returns
pointer to the loaded metadata
-
virtual kwiver::vital::metadata_sptr load_metadata_(std::string const &filename) const
Match Features Algorithm
-
class kwiver::arrows::ocv::match_features : public kwiver::vital::algo::match_features
OCV specific definition for algorithms that match feature point descriptors.
This extended algorithm_def provides a common implementation for the match method.
Subclassed by kwiver::arrows::ocv::match_features_bruteforce, kwiver::arrows::ocv::match_features_flannbased
Public Functions
-
virtual vital::match_set_sptr match(vital::feature_set_sptr feat1, vital::descriptor_set_sptr desc1, vital::feature_set_sptr feat2, vital::descriptor_set_sptr desc2) const
Match one set of features and corresponding descriptors to another.
- Parameters
feat1 – the first set of features to match
desc1 – the descriptors corresponding to feat1
feat2 – the second set fof features to match
desc2 – the descriptors corresponding to feat2
- Returns
a set of matching indices from feat1 to feat2
-
virtual vital::match_set_sptr match(vital::feature_set_sptr feat1, vital::descriptor_set_sptr desc1, vital::feature_set_sptr feat2, vital::descriptor_set_sptr desc2) const
Match Features Bruteforce Algorithm
-
class kwiver::arrows::ocv::match_features_bruteforce : public kwiver::arrows::ocv::match_features
Feature matcher implementation using OpenCV’s brute-force feature matcher.
Public Functions
- PLUGIN_INFO ("ocv_brute_force", "OpenCV feature matcher using brute force matching (exhaustive search).") match_features_bruteforce()
Constructor.
-
virtual ~match_features_bruteforce()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration vital::config_block is valid.
Match Features Flannbased Algorithm
-
class kwiver::arrows::ocv::match_features_flannbased : public kwiver::arrows::ocv::match_features
Feature matcher implementation using OpenCV’s FLANN-based feature matcher.
Public Functions
- PLUGIN_INFO ("ocv_flann_based", "OpenCV feature matcher using FLANN (Approximate Nearest Neighbors).") match_features_flannbased()
Constructor.
-
virtual ~match_features_flannbased()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration vital::config_block is valid.
-
class priv
Public Functions
-
inline priv()
Constructor.
-
inline void create()
Create a new flann-based matcher instance and set our matcher param to it.
-
inline void cross_check_match(const cv::Mat &descriptors1, const cv::Mat &descriptors2, std::vector<cv::DMatch> &filtered_matches12) const
Compute descriptor matching from 1 to 2 and from 2 to 1.
Only return descriptor matches if the one of the top N matches from 1 to 2 is also a top N match from 2 to 1. Here N is defined by parameter cross_check_knn
Public Members
-
bool cross_check
Parameters.
-
inline priv()
Refine Detections Write To Disk Algorithm
-
class kwiver::arrows::ocv::refine_detections_write_to_disk : public kwiver::vital::algo::refine_detections
A class for drawing various information about feature tracks.
Public Functions
- PLUGIN_INFO ("ocv_write", "Debugging process for writing out detections") refine_detections_write_to_disk()
Constructor.
-
virtual ~refine_detections_write_to_disk()
Destructor.
-
virtual vital::config_block_sptr get_configuration() const
Get this algorithm’s configuration block .
-
virtual void set_configuration(vital::config_block_sptr config)
Set this algorithm’s properties via a config block.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid.
-
virtual vital::detected_object_set_sptr refine(vital::image_container_sptr image_data, vital::detected_object_set_sptr detections) const
Refine all object detections on the provided image.
This method analyzes the supplied image and and detections on it, returning a refined set of detections.
- Parameters
image_data – the image pixels
detections – detected objects
- Returns
vector of image objects refined
-
class priv
Split Image Algorithm
-
class kwiver::arrows::ocv::split_image : public kwiver::vital::algo::split_image
A class for writing out image chips around detections, useful as a debugging process for ensuring that the refine detections process is running on desired ROIs.
Public Functions
- PLUGIN_INFO ("ocv", "Split an image into multiple smaller images using opencv functions") split_image()
Constructor.
-
virtual ~split_image()
Destructor.
-
inline virtual void set_configuration(kwiver::vital::config_block_sptr)
Set this algorithm’s properties via a config block.
This method is called to pass a configuration to the algorithm. The implementation of this method should be light-weight and only save the necessary config values. Defer any substantial processing in another method.
- Throws
no_such_configuration_value_exception – Thrown if an expected configuration value is not present.
algorithm_configuration_exception – Thrown when the algorithm is given an invalid
config_blockor is otherwise unable to configure itself.
- Parameters
config – The
config_blockinstance containing the configuration parameters for this algorithm
-
inline virtual bool check_configuration(kwiver::vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritance reasons.- Parameters
config – The config block to check configuration of.
- Returns
true if the configuration check passed and false if it didn’t.
-
virtual std::vector<kwiver::vital::image_container_sptr> split(kwiver::vital::image_container_sptr img) const
Split image.