Core
Algorithm Implementations
associate_detections_to_tracks_threshold
-
class associate_detections_to_tracks_threshold : public kwiver::vital::algo::associate_detections_to_tracks
Initialize object tracks via simple single frame thresholding.
Public Functions
- PLUGGABLE_IMPL (associate_detections_to_tracks_threshold, "Associate detections to tracks via simple thresholding on the input matrix.", PARAM_DEFAULT(threshold, double, "Threshold to apply on the matrix.", 0.50), PARAM_DEFAULT(higher_is_better, bool, "Whether values above or below the threshold indicate a better fit.", true)) virtual ~associate_detections_to_tracks_threshold() noexcept
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence reasons.- Parameters:
config – The config block to check configuration of.
- Returns:
true if the configuration check passed and false if it didn’t.
-
virtual bool associate(kwiver::vital::timestamp ts, kwiver::vital::image_container_sptr image, kwiver::vital::object_track_set_sptr tracks, kwiver::vital::detected_object_set_sptr detections, kwiver::vital::matrix_d matrix, kwiver::vital::object_track_set_sptr &output, kwiver::vital::detected_object_set_sptr &unused) const
Associate object detections to object tracks.
Use cost matrices to assign detections to existing tracks
- Parameters:
ts – frame ID
image – contains the input image for the current frame
tracks – active track set from the last frame
detections – detected object sets from the current frame
matrix – matrix containing detection to track association scores
output – the output updated detection set
unused – output detection set for any detections not associated
- Returns:
whether or not any tracks were updated
-
class priv
Private implementation class.
class_probability_filter
-
class class_probability_filter : public kwiver::vital::algo::detected_object_filter
Filters detections based on class probability.
This algorithm filters out items that are less than the threshold. The following steps are applied to each input detected object set.
1) Select all class names with scores greater than threshold.
2) Create a new detected_object_type object with all selected class names from step 1. The class name can be selected individually or with the keep_all_classes option.
3) The input detection_set is cloned and the detected_object_type from step 2 is attached.
Public Functions
-
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 filter(const vital::detected_object_set_sptr input_set) const
Filter set of detected objects.
This method applies a filter to the input set to create an output set. The input set of detections is unmodified.
- Parameters:
input_set – Set of detections to be filtered.
- Returns:
Filtered set of detections.
-
virtual bool check_configuration(vital::config_block_sptr config) const
close_loops_appearance_indexed
-
class close_loops_appearance_indexed : public kwiver::vital::algo::close_loops
Loop closure algorithm that using appearance indexing for fast matching.
Public Functions
- PLUGGABLE_IMPL (close_loops_appearance_indexed, "Uses bag of words index to close loops.", PARAM_DEFAULT(min_loop_inlier_matches, unsigned, "The minimum number of inlier feature matches to accept a loop " "connection and join tracks", 128), PARAM_DEFAULT(geometric_verification_inlier_threshold, double, "inlier threshold for fundamental matrix based geometric verification " "of loop closure in pixels", 2.0), PARAM_DEFAULT(max_loop_attempts_per_frame, int, "The maximum number of loop closure attempts to make per frame", 200), PARAM_DEFAULT(tracks_in_common_to_skip_loop_closing, int, "If this or more tracks are in common between two frames then don't try " "to complete a loop with them", 0), PARAM_DEFAULT(skip_loop_detection_track_i_over_u_threshold, float, "skip loop detection if intersection over union of track ids in two " "frames is greater than this", 0.5f), PARAM_DEFAULT(min_loop_inlier_fraction, float, "Inlier fraction must be this high to accept a loop completion", 0.5f), PARAM(match_features, vital::algo::match_features_sptr, "match_features"), PARAM(bag_of_words_matching, vital::algo::match_descriptor_sets_sptr, "bag_of_words_matching"), PARAM(fundamental_mat_estimator, vital::algo::estimate_fundamental_matrix_sptr, "fundamental_mat_estimator")) virtual ~close_loops_appearance_indexed()
Destructor.
-
virtual kwiver::vital::feature_track_set_sptr stitch(kwiver::vital::frame_id_t frame_number, kwiver::vital::feature_track_set_sptr input, kwiver::vital::image_container_sptr image, kwiver::vital::image_container_sptr mask = kwiver::vital::image_container_sptr()) const
Find loops in a feature_track_set.
Attempt to perform closure operation and stitch tracks together.
- Parameters:
frame_number – the frame number of the current frame
input – the input feature track set to stitch
image – image data for the current frame
mask – Optional mask image where positive values indicate regions to consider in the input image.
- Returns:
an updated set of feature tracks after the stitching operation
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence reasons.- Parameters:
config – The config block to check configuration of.
- Returns:
true if the configuration check passed and false if it didn’t.
-
class priv
Public Functions
-
inline vital::algo::match_features_sptr c_matcher()
The feature matching algorithm to use.
-
inline vital::algo::match_descriptor_sets_sptr c_bow()
The bag of words matching image finder.
-
inline vital::algo::estimate_fundamental_matrix_sptr c_f_estimator()
The fundamental matrix estimator for geometric verification.
-
inline unsigned c_min_loop_inlier_matches()
The minimum number of inliers required for a putative loop to be accepted.
-
inline double c_geometric_verification_inlier_threshold()
Inlier threshold for fundamental matrix geometric verification.
-
inline int c_max_loop_attempts_per_frame()
The maximum number of times to attempt to complete a loop with each.
Public Members
-
std::function<float(descriptor_sptr, descriptor_sptr)> desc_dist = hamming_distance
The function used to calculate the distance between two descriptors.
-
inline vital::algo::match_features_sptr c_matcher()
close_loops_bad_frames_only
-
class close_loops_bad_frames_only : public kwiver::vital::algo::close_loops
Attempts to stitch over incomplete or bad input frames.
This class attempts to only make short term loop closures due to bad or incomplete feature point tracking. It operates on the principle that when a bad frame occurs, there is generally a lower percentage of feature tracks.
Public Functions
- PLUGGABLE_IMPL (close_loops_bad_frames_only, "Attempts short-term loop closure based on percentage " "of feature points tracked.", PARAM_DEFAULT(enabled, bool, "Should bad frame detection be enabled? This option will attempt to " "bridge the gap between frames which don't meet certain criteria " "(percentage of feature points tracked) and will instead attempt " "to match features on the current frame against past frames to " "meet this criteria. This is useful when there can be bad frames.", true), PARAM_DEFAULT(percent_match_req, double, "The required percentage of features needed to be matched for a " "stitch to be considered successful (value must be between 0.0 and " "1.0).", 0.35), PARAM_DEFAULT(new_shot_length, unsigned, "Number of frames for a new shot to be considered valid before " "attempting to stitch to prior shots.", 2), PARAM_DEFAULT(max_search_length, unsigned, "Maximum number of frames to search in the past for matching to " "the end of the last shot.", 5), PARAM(feature_matcher, kwiver::vital::algo::match_features_sptr, "feature_matcher")) virtual ~close_loops_bad_frames_only()=default
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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::feature_track_set_sptr stitch(vital::frame_id_t frame_number, vital::feature_track_set_sptr input, vital::image_container_sptr image, vital::image_container_sptr mask = vital::image_container_sptr()) const
Handle track bad frame detection if enabled.
Perform basic shot stitching for bad frame detection
- Parameters:
frame_number – [in] the frame number of the current frame
input – [in] the input feature track set to stitch
image – [in] image data for the current frame
mask – [in] Optional mask image where positive values indicate regions to consider in the input image.
- Returns:
an updated set a feature tracks after the stitching operation
close_loops_exhaustive
-
class close_loops_exhaustive : public kwiver::vital::algo::close_loops
Attempts to stitch over previous frames.
This class attempts close loops with all previous (or as specified) frames
Public Functions
- PLUGGABLE_IMPL (close_loops_exhaustive, "Exhaustive matching of all frame pairs, " "or all frames within a moving window.", PARAM_DEFAULT(match_req, size_t, "The required number of features needed to be matched for a success.", 100), PARAM_DEFAULT(num_look_back, int, "Maximum number of frames to search in the past for matching to " "(-1 looks back to the beginning).", -1), PARAM(feature_matcher, kwiver::vital::algo::match_features_sptr, "feature_matcher")) virtual ~close_loops_exhaustive() noexcept
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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::feature_track_set_sptr stitch(vital::frame_id_t frame_number, vital::feature_track_set_sptr input, vital::image_container_sptr image, vital::image_container_sptr mask = vital::image_container_sptr()) const
Exaustive loop closure.
Perform exhaustive stitching
- Parameters:
frame_number – [in] the frame number of the current frame
input – [in] the input feature track set to stitch
image – [in] image data for the current frame
mask – [in] Optional mask image where positive values indicate regions to consider in the input image.
- Returns:
an updated set of feature tracks after the stitching operation
-
class priv
Private implementation class.
close_loops_keyframe
-
class close_loops_keyframe : public kwiver::vital::algo::close_loops
Attempts to stitch over previous frames.
This class attempts close loops with all previous (or as specified) frames
Public Functions
- PLUGGABLE_IMPL (close_loops_keyframe, "Establishes keyframes matches to all keyframes.", PARAM_DEFAULT(match_req, int, "The required number of features needed to be matched for a success.", 100), PARAM_DEFAULT(search_bandwidth, int, "Number of adjacent frames to match to (must be at least 1).", 10), PARAM_DEFAULT(min_keyframe_misses, unsigned int, "Minimum number of keyframe match misses before creating a new keyframe. " "A match miss occurs when the current frame does not match any existing " "keyframe (must be at least 1).", 5), PARAM_DEFAULT(stop_after_match, bool, "If set, stop matching additional keyframes after at least " "one match is found and then one fails to match. This " "prevents making many comparisons to keyframes that are " "likely to fail, but it also misses unexpected matches " "that could make the tracks stronger.", false), PARAM(feature_matcher, kwiver::vital::algo::match_features_sptr, "feature_matcher")) virtual ~close_loops_keyframe() noexcept
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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::feature_track_set_sptr stitch(vital::frame_id_t frame_number, vital::feature_track_set_sptr input, vital::image_container_sptr image, vital::image_container_sptr mask = vital::image_container_sptr()) const
Frame stitching using keyframe-base matching.
Perform keyframe guided stitching
- Parameters:
frame_number – [in] the frame number of the current frame
input – [in] the input feature track set to stitch
image – [in] image data for the current frame
mask – [in] Optional mask image where positive values indicate regions to consider in the input image.
- Returns:
an updated set of feature tracks after the stitching operation
-
class priv
Private implementation class.
Public Functions
-
inline int c_match_req()
number of feature matches required for acceptance
-
inline int c_search_bandwidth()
number of adjacent frames to match
-
inline unsigned int c_min_keyframe_misses()
minimum number of keyframe misses before creating a new keyframe
-
inline bool c_stop_after_match()
stop matching against additional keyframes if at least one succeeds
-
inline vital::algo::match_features_sptr c_matcher()
The feature matching algorithm to use.
-
inline int c_match_req()
close_loops_multi_method
-
class close_loops_multi_method : public kwiver::vital::algo::close_loops
Attempts to stitch over incomplete or bad input frames.
This class can run multiple other close_loops algorithm implementations in attempt to accomplish this.
Public Functions
- PLUGGABLE_IMPL (close_loops_multi_method, "Iteratively run multiple loop closure algorithms.", PARAM(method, std::vector< vital::algo::close_loops_sptr >, "Methods")) virtual ~close_loops_multi_method()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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::feature_track_set_sptr stitch(vital::frame_id_t frame_number, vital::feature_track_set_sptr input, vital::image_container_sptr image, vital::image_container_sptr mask = vital::image_container_sptr()) const
Run all internal loop closure algorithms.
- Parameters:
frame_number – the frame number of the current frame
image – image data for the current frame
input – the input feature track set to stitch
mask – Optional mask image where positive values indicate regions to consider in the input image.
- Returns:
an updated set of feature tracks after the stitching operation
compute_association_matrix_from_features
-
class compute_association_matrix_from_features : public kwiver::vital::algo::compute_association_matrix
Compute an association matrix given detections and tracks.
Public Functions
- PLUGGABLE_IMPL (compute_association_matrix_from_features, "Populate association matrix in tracking from detector features.", PARAM_DEFAULT(max_distance, double, "Maximum allowed pixel distance for matches. Is expressed " "in raw pixel distance.", -1.0), PARAM(filter, kwiver::vital::algo::detected_object_filter_sptr, "filter")) virtual ~compute_association_matrix_from_features() noexcept
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence reasons.- Parameters:
config – The config block to check configuration of.
- Returns:
true if the configuration check passed and false if it didn’t.
-
virtual bool compute(kwiver::vital::timestamp ts, kwiver::vital::image_container_sptr image, kwiver::vital::object_track_set_sptr tracks, kwiver::vital::detected_object_set_sptr detections, kwiver::vital::matrix_d &matrix, kwiver::vital::detected_object_set_sptr &considered) const
Compute an association matrix given detections and tracks.
Compute an association matrix given detections and tracks
- Parameters:
ts – frame ID
image – contains the input image for the current frame
tracks – active track set from the last frame
detections – input detected object sets from the current frame
matrix – output matrix
considered – output detections used in matrix
- Returns:
returns whether a matrix was successfully computed
-
class priv
Private implementation class.
compute_ref_homography_core
-
class compute_ref_homography_core : public kwiver::vital::algo::compute_ref_homography
Default impl class for mapping each image to some reference image.
This class differs from estimate_homographies in that estimate_homographies simply performs a homography regression from matching feature points. This class is designed to generate different types of homographies from input feature tracks, which can transform each image back to the same coordinate space derived from some initial refrerence image.
This implementation is state-based and is meant to be run in an online fashion, i.e. run against a track set that has been iteratively updated on successive non-regressing frames. This is ideal for when it is desired to compute reference frames on all frames in a sequence.
Public Functions
- PLUGGABLE_IMPL (compute_ref_homography_core, "Default online sequential-frame reference homography estimator.", PARAM_DEFAULT(use_backproject_error, bool, "Should we remove extra points if the backproject error is high?", false), PARAM_DEFAULT(backproject_threshold_sqr, double, "Backprojection threshold in terms of L2 distance squared " "(number of pixels)", 16.0), PARAM_DEFAULT(forget_track_threshold, unsigned, "After how many frames should we forget all info about a track?", 5), PARAM_DEFAULT(min_track_length, unsigned, "Minimum track length to use for homography regression", 1), PARAM_DEFAULT(inlier_scale, double, "The acceptable error distance (in pixels) between warped " "and measured points to be considered an inlier match.", 2.0), PARAM_DEFAULT(minimum_inliers, unsigned, "Minimum number of matches required between source and " "reference planes for valid homography estimation.", 4), PARAM_DEFAULT(allow_ref_frame_regression, bool, "Allow for the possibility of a frame, N, to have a " "reference frame, A, when a frame M < N has a reference frame B > A " "(assuming frames were sequentially iterated over with this algorithm).", true), PARAM(estimator, vital::algo::estimate_homography_sptr, "Homography estimator")) virtual ~compute_ref_homography_core()
Default Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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::f2f_homography_sptr estimate(vital::frame_id_t frame_number, vital::feature_track_set_sptr tracks) const
Estimate the transformation which maps some frame to a reference frame
Similarly to track_features, this class was designed to be called in an online fashion for each sequential frame.
- Parameters:
frame_number – frame identifier for the current frame
tracks – the set of all tracked features from the image
- Returns:
estimated homography
-
class priv
Public Functions
-
inline bool compute_homography(std::vector<vector_2d> const &pts_src, std::vector<vector_2d> const &pts_dst, homography_sptr &out_h) const
Estimate the homography between two corresponding points sets
Check for homography validity.
Output homography describes transformation from pts_src to pts_dst.
If estimate homography is deemed bad, true is returned and the homography passed to
out_his not modified. If false is returned, the computed homography is valid and out_h is set to the estimated homography.
Public Members
-
track_info_buffer_sptr buffer
Buffer storing track extensions.
-
unsigned frames_since_reset
Number of frames since last new reference frame declared.
-
bool allow_ref_frame_regression
If we should allow reference frame regression or not when determining the earliest reference frame of active tracks.
-
frame_id_t min_ref_frame
Minimum allowable reference frame. This is updated when homography estimation fails.
-
inline bool compute_homography(std::vector<vector_2d> const &pts_src, std::vector<vector_2d> const &pts_dst, homography_sptr &out_h) const
convert_image_bypass
-
class convert_image_bypass : public kwiver::vital::algo::convert_image
A class for bypassing image conversion.
create_detection_grid
-
class create_detection_grid : public kwiver::vital::algo::image_object_detector
Initialize object tracks via simple single frame thresholding.
Public Functions
- PLUGGABLE_IMPL (create_detection_grid, "Create a grid of detections across the input image.", PARAM_DEFAULT(width, double, "Width of each detection in the output grid.", 0.0), PARAM_DEFAULT(height, double, "Height of each detection in the output grid.", 0.0), PARAM_DEFAULT(x_step, double, "How far apart along the x axis each detection is.", 0.0), PARAM_DEFAULT(y_step, double, "How far apart along the y axis each detection is.", 0.0)) virtual ~create_detection_grid() noexcept
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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
Private implementation class.
derive_metadata
-
class derive_metadata : public kwiver::vital::algo::metadata_filter
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const override
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::metadata_vector filter(kwiver::vital::metadata_vector const &input_metadata, kwiver::vital::image_container_scptr const &input_image) override
Fills in metadata values which can be calculated from other metadata.
- Parameters:
input_metadata – Input vector of metadata packets.
input_image – Associated video image.
- Returns:
An amended metadata vector.
-
virtual bool check_configuration(vital::config_block_sptr config) const override
detect_features_filtered
-
class detect_features_filtered : public kwiver::vital::algo::detect_features
A feature detector that applies a filter to results.
Public Functions
- PLUGGABLE_IMPL (detect_features_filtered, "Wrapper that runs a feature detector and " "applies a filter to the detector output", PARAM(detector, vital::algo::detect_features_sptr, "detector"), PARAM(filter, vital::algo::filter_features_sptr, "filter")) virtual ~detect_features_filtered()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration 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.
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
-
class priv
Private implementation class.
detected_object_set_input_csv
-
class detected_object_set_input_csv : public kwiver::vital::algo::detected_object_set_input
Public Functions
-
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 bool read_set(kwiver::vital::detected_object_set_sptr &set, std::string &image_name)
Read next detected object set
This method reads the next set of detected objects from the file. False is returned when the end of file is reached.
- Parameters:
set – [out] Pointer to the new set of detections. Set may be empty if there are no detections on an image.
image_name – [out] Name of the image that goes with the detections. This string may be empty depending on the source format.
- Returns:
true if detections are returned, false if end of file.
-
class priv
Expected format:
1: frame number
2: file name
3: TL-x
4: TL-y
5: BR-x
6: BR-y
7: confidence
8,9 : class-name score (this pair may be omitted or may repeat any number of times)
-
virtual bool check_configuration(vital::config_block_sptr config) const
detected_object_set_input_kw18
-
class detected_object_set_input_kw18 : public kwiver::vital::algo::detected_object_set_input
Public Functions
-
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 bool read_set(kwiver::vital::detected_object_set_sptr &set, std::string &image_name)
Read next detected object set
This method reads the next set of detected objects from the file. False is returned when the end of file is reached.
- Parameters:
set – [out] Pointer to the new set of detections. Set may be empty if there are no detections on an image.
image_name – [out] Name of the image that goes with the detections. This string may be empty depending on the source format.
- Returns:
true if detections are returned, false if end of file.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const
detected_object_set_output_csv
-
class detected_object_set_output_csv : public kwiver::vital::algo::detected_object_set_output
Public Functions
-
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 void write_set(const kwiver::vital::detected_object_set_sptr set, std::string const &image_name)
Write detected object set.
This method writes the specified detected object set and image name to the currently open file.
- Parameters:
set – Detected object set
image_path – File path to image associated with the detections.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const
detected_object_set_output_kw18
-
class detected_object_set_output_kw18 : public kwiver::vital::algo::detected_object_set_output
Public Functions
-
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 void write_set(const kwiver::vital::detected_object_set_sptr set, std::string const &image_name)
Write detected object set.
This method writes the specified detected object set and image name to the currently open file.
- Parameters:
set – Detected object set
image_path – File path to image associated with the detections.
-
class priv
This format should only be used for tracks.
Column(s) 1: Track-id
Column(s) 2: Track-length (# of detections)
Column(s) 3: Frame-number (-1 if not available)
Column(s) 4-5: Tracking-plane-loc(x,y) (Could be same as World-loc)
Column(s) 6-7: Velocity(x,y)
Column(s) 8-9: Image-loc(x,y)
Column(s) 10-13: Img-bbox(TL_x,TL_y,BR_x,BR_y) (location of top-left & bottom-right vertices)
Column(s) 14: Area (0 - when not available)
Column(s) 15-17: World-loc(x,y,z) (longitude, latitude, 0 - when not available)
Column(s) 18: Timesetamp(-1 if not available)
Column(s) 19: Track-confidence(-1_when_not_available)
-
virtual bool check_configuration(vital::config_block_sptr config) const
dynamic_config_none
-
class dynamic_config_none : public kwiver::vital::algo::dynamic_configuration
A class for bypassing image conversion.
estimate_canonical_transform
-
class estimate_canonical_transform : public kwiver::vital::algo::estimate_canonical_transform
Algorithm for estimating a canonical transform for cameras and landmarks
A canonical transform is a repeatable transformation that can be recovered from data. In this case we assume at most a similarity transformation. If data sets P1 and P2 are equivalent up to a similarity transformation, then applying a canonical transform to P1 and separately a canonical transform to P2 should bring the data into the same coordinates.
This implementation centers the data at the mean of the landmarks. It orients the data using PCA on the landmarks such that the X-axis aligns with the largest principal direction and the Z-axis aligns with the smallest. The data is oriented such that the positive Z axis points toward the mean of the camera centers. The scale is set to normalized the landmarks to unit standard deviation.
Public Functions
- PLUGGABLE_IMPL (estimate_canonical_transform, "Uses PCA to estimate a canonical similarity transform" " that aligns the best fit plane to Z=0", PARAM_DEFAULT(estimate_scale, bool, "Estimate the scale to normalize the data. " "If disabled the estimate transform is rigid", true), PARAM_DEFAULT(height_percentile, double, "Shift the ground plane along the normal axis such that " "this percentage of landmarks are below the ground. Values " "are in the range [0.0, 1.0). If the value is outside " "this range use the mean height instead.", 0.05)) virtual ~estimate_canonical_transform()
Destructor.
-
estimate_canonical_transform(const estimate_canonical_transform &other)
Copy Constructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
-
virtual kwiver::vital::similarity_d estimate_transform(kwiver::vital::camera_map_sptr const cameras, kwiver::vital::landmark_map_sptr const landmarks) const
Estimate a canonical similarity transform for cameras and points
Note
This algorithm does not apply the transformation, it only estimates it.
- Parameters:
cameras – The camera map containing all the cameras
landmarks – The landmark map containing all the 3D landmarks
- Throws:
algorithm_exception – When the data is insufficient or degenerate.
- Returns:
An estimated similarity transform mapping the data to the canonical space.
example_detector
-
class example_detector : public kwiver::vital::algo::image_object_detector
Public Functions
-
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 bool check_configuration(vital::config_block_sptr config) const
feature_descriptor_io
-
class feature_descriptor_io : public kwiver::vital::algo::feature_descriptor_io
A class for reading and writing feature and desriptor sets.
Public Functions
- PLUGGABLE_IMPL (feature_descriptor_io, "Read and write features and descriptor" " to binary files using Cereal serialization.", PARAM_DEFAULT(write_float_features, bool, "Convert features to use single precision floats " "instead of doubles when writing to save space", false)) virtual ~feature_descriptor_io()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid.
-
class priv
filter_features_magnitude
-
class filter_features_magnitude : public kwiver::vital::algo::filter_features
Algorithm that filters features based on feature magnitude.
Public Functions
- PLUGGABLE_IMPL (filter_features_magnitude, "Filter features using a threshold" " on the magnitude of the detector response function.", PARAM_DEFAULT(top_fraction, double, "Fraction of strongest keypoints to keep, range (0.0, 1.0]", 0.2), PARAM_DEFAULT(min_features, unsigned int, "Minimum number of features to keep", 100)) virtual ~filter_features_magnitude()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
-
class priv
Private implementation class.
filter_features_nonmax
-
class filter_features_nonmax : public kwiver::vital::algo::filter_features
Algorithm that filters features using non-max suppression.
Public Functions
- PLUGGABLE_IMPL (filter_features_nonmax, "Filter features using non-max supression.", PARAM_DEFAULT(suppression_radius, double, "The radius, in pixels, within which to " "suppress weaker features. This is an initial guess. " "The radius is adapted to reach the desired number of " "features. If target_num_features is 0 then this radius " "is not adapted.", 0.0), PARAM_DEFAULT(num_features_target, unsigned int, "The target number of features to detect. " "The suppression radius is dynamically adjusted to " "acheive this number of features.", 500), PARAM_DEFAULT(num_features_range, unsigned int, "The number of features above target_num_features to " "allow in the output. This window allows the binary " "search on radius to terminate sooner.", 50), PARAM_DEFAULT(resolution, unsigned int, "The resolution (N) of the filter for computing neighbors." " The filter is an (2N+1) x (2N+1) box containing a circle" " of radius N. The value must be a positive integer. " "Larger values are more " "accurate at the cost of more memory and compute time.", 3),) virtual ~filter_features_nonmax()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
-
class priv
Private implementation class.
filter_features_scale
-
class filter_features_scale : public kwiver::vital::algo::filter_features
Algorithm that filters features based on feature scale.
Public Functions
- PLUGGABLE_IMPL (filter_features_scale, "Filter features using a threshold on the scale of the detected features.", PARAM_DEFAULT(top_fraction, double, "Fraction of largest scale keypoints to keep, range (0.0, 1.0]", 0.2), PARAM_DEFAULT(min_features, unsigned int, "Minimum number of features to keep", 100), PARAM_DEFAULT(max_features, unsigned int, "Maximum number of features to keep, use 0 for unlimited", 1000),) virtual ~filter_features_scale()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
-
class priv
filter_tracks
-
class filter_tracks : public kwiver::vital::algo::filter_tracks
Algorithm that filters tracks on various attributes.
Public Functions
- PLUGGABLE_IMPL (filter_tracks, "Filter tracks by track length or matrix matrix importance.", PARAM_DEFAULT(min_track_length, unsigned int, "Filter the tracks keeping those covering " "at least this many frames. Set to 0 to disable.", 3), PARAM_DEFAULT(min_mm_importance, double, "Filter the tracks with match matrix importance score " "below this threshold. Set to 0 to disable.", 1.0)) virtual ~filter_tracks()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s configuration config_block is valid.
-
virtual vital::track_set_sptr filter(vital::track_set_sptr input) const
filter a track set
- Parameters:
track – set to filter
- Returns:
a filtered version of the track set
-
class priv
Private implementation class.
handle_descriptor_request_core
-
class handle_descriptor_request_core : public kwiver::vital::algo::handle_descriptor_request
A basic query formulator.
Public Functions
- PLUGGABLE_IMPL (handle_descriptor_request_core, "Formulate descriptors for later queries.", PARAM(image_reader, vital::algo::image_io_sptr, "image_reader"), PARAM(descriptor_extractor, vital::algo::compute_track_descriptors_sptr, "descriptor_extractor")) virtual ~handle_descriptor_request_core()=default
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence reasons.- Parameters:
config – The config block to check configuration of.
- Returns:
true if the configuration check passed and false if it didn’t.
-
virtual bool handle(kwiver::vital::descriptor_request_sptr request, kwiver::vital::track_descriptor_set_sptr &desc, std::vector<kwiver::vital::image_container_sptr> &imgs)
Formulate query.
Extend a previous set of tracks using the current frame.
initialize_object_tracks_threshold
-
class initialize_object_tracks_threshold : public kwiver::vital::algo::initialize_object_tracks
Initialize object tracks via simple single frame thresholding.
Public Functions
- PLUGGABLE_IMPL (initialize_object_tracks_threshold, "Perform thresholding on detection confidence values to create tracks.", PARAM_DEFAULT(max_new_tracks, unsigned, "Maximum number of new tracks to initialize on a single frame.", 10000), PARAM(filter, vital::algo::detected_object_filter_sptr, "filter")) virtual ~initialize_object_tracks_threshold() noexcept
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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::object_track_set_sptr initialize(kwiver::vital::timestamp ts, kwiver::vital::image_container_sptr image, kwiver::vital::detected_object_set_sptr detections) const
Initialize object tracks.
Initialize new object tracks given detections.
- Parameters:
ts – frame ID
image – contains the input image for the current frame
detections – detected object sets from the current frame
- Returns:
newly initialized tracks
-
class priv
Private implementation class.
Public Functions
-
inline priv(initialize_object_tracks_threshold &parent)
Constructor.
-
inline unsigned c_max_new_tracks()
Maximum number of tracks to initialize.
-
inline vital::algo::detected_object_filter_sptr c_filter()
The feature matching algorithm to use.
Public Static Attributes
-
static std::atomic<unsigned> next_track_id
Next track ID to assign - make unique across all processes.
-
inline priv(initialize_object_tracks_threshold &parent)
interpolate_track_spline
-
class interpolate_track_spline : public kwiver::vital::algo::interpolate_track
Fills in missing track segments using spline interpolation
This class generates additional track states in between known states using a configurable variety of spline-based interpolation techniques that do not depend on imagery.
Public Functions
- PLUGGABLE_IMPL (interpolate_track_spline, "Fill in missing object track intervals using spline-based interpolation.") virtual ~interpolate_track_spline()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const override
Check that the algorithm’s currently configuration is valid.
-
virtual kwiver::vital::track_sptr interpolate(kwiver::vital::track_sptr init_states) override
Interpolates the states between track states.
-
class priv
Private implementation class.
keyframe_selector_basic
-
class keyframe_selector_basic : public kwiver::vital::algo::keyframe_selection
A basic query formulator.
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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::track_set_sptr select(kwiver::vital::track_set_sptr tracks) const
Select keyframes from a set of tracks. Different implementations can select key-frames in different ways. For example, one method could only add key-frames for frames that are new. Another could increase the density of key-frames near existing frames so dense processing can be done.
- Parameters:
current_keyframes – [in] The current key-frame selection data. Set to null if no key-frame data is available or you want to perform key-frame selection from scratch.
tracks – [in] The tracks over which to select key-frames
- Returns:
selected key-frame data structure. Tracks is modified in place so the returned pointer points to the same object as tracks.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const
match_features_fundamental_matrix
-
class match_features_fundamental_matrix : public kwiver::vital::algo::match_features
Combines a feature matcher, fundamental matrix estimation, and filtering
This is a meta-algorithm for feature matching that combines one other feature matcher with fundamental matrix estimation and feature filtering. The algorithm applies another configurable feature matcher algorithm and then applies a fundamental matrix estimation algorithm to the resulting matches. Outliers to the fit fundamental matrix are discarded from the set of matches.
If a filter_features algorithm is provided, this will be run on the input features before running the matcher.
Public Functions
- PLUGGABLE_IMPL (match_features_fundamental_matrix, "Use an estimated fundamental matrix as a geometric filter" " to remove outlier matches.", PARAM_DEFAULT(inlier_scale, double, "The acceptable error distance (in pixels) between a measured point " "and its epipolar line to be considered an inlier match.", 10.0), PARAM_DEFAULT(min_required_inlier_count, int, "The minimum required inlier point count. If there are less " "than this many inliers, no matches will be returned.", 0), PARAM_DEFAULT(min_required_inlier_percent, double, "The minimum required percentage of inlier points. If the " "percentage of points considered inliers is less than this " "amount, no matches will be returned.", 0.0), PARAM_DEFAULT(motion_filter_percentile, double, "If less than 1.0, find this percentile of the motion " "magnitude and filter matches with motion larger than " "twice this value. This helps remove outlier matches " "when the motion between images is small.", 0.75), PARAM(feature_matcher, vital::algo::match_features_sptr, "feature_matcher"), PARAM(fundamental_matrix_estimator, vital::algo::estimate_fundamental_matrix_sptr, "fundamental_matrix_estimator")) virtual ~match_features_fundamental_matrix()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid.
-
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 – [in] the first set of features to match
desc1 – [in] the descriptors corresponding to feat1
feat2 – [in] the second set of features to match
desc2 – [in] the descriptors corresponding to feat2
- Returns:
a set of matching indices from feat1 to feat2
-
class priv
match_features_homography
-
class match_features_homography : public kwiver::vital::algo::match_features
Combines a feature matchers, homography estimation, and filtering
This is a meta-algorithm for feature matching that combines one or more other feature matchers with homography estimation and feature filtering. The algorithm applies another configurable feature matcher algorithm and then applies a homography estimation algorithm to the resulting matches. Outliers to the fit homography are discarded from the set of matches.
If a second matcher algorithm is provided, this algorithm will warp the feature locations by the estimated homography before applying the second matching algorithm to the aligned points. This approach is useful for finding weak matches that were missed by the first matcher but are easier to detect once approximate location is known. A good choice for the second matcher is vxl::match_features_constrained.
If a filter_features algorithm is provided, this will be run on the input features before running the first matcher. The second matcher will then run on the original unfilter features. This allows, for example, a slower but more robust feature matcher to run on a subset of the strongest feature points in order to quickly establish an and estimated homography. Then a second, fast matcher can pick up the additional weak matches using the constraint that the location in the image is now known approximately.
Public Functions
- PLUGGABLE_IMPL (match_features_homography, "Use an estimated homography as a geometric filter" " to remove outlier matches.", PARAM_DEFAULT(inlier_scale, double, "The acceptable error distance (in pixels) between warped " "and measured points to be considered an inlier match. " "Note that this scale is multiplied by the average scale of " "the features being matched at each stage.", 1.0), PARAM_DEFAULT(min_required_inlier_count, int, "The minimum required inlier point count. If there are less " "than this many inliers, no matches will be output.", 0), PARAM_DEFAULT(min_required_inlier_percent, double, "The minimum required percentage of inlier points. If the " "percentage of points considered inliers is less than this " "amount, no matches will be output.", 0.0), PARAM(homography_estimator, vital::algo::estimate_homography_sptr, "homography_estimator"), PARAM(feature_matcher1, vital::algo::match_features_sptr, "feature_matcher1"), PARAM(feature_matcher2, vital::algo::match_features_sptr, "feature_matcher2"), PARAM(filter_features, vital::algo::filter_features_sptr, "filter_features")) virtual ~match_features_homography()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid.
-
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 – [in] the first set of features to match
desc1 – [in] the descriptors corresponding to feat1
feat2 – [in] the second set of features to match
desc2 – [in] the descriptors corresponding to feat2
- Returns:
a set of matching indices from feat1 to feat2
-
class priv
merge_metadata_streams
-
class merge_metadata_streams : public kwiver::vital::algo::metadata_filter
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const override
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::metadata_vector filter(vital::metadata_vector const &input_metadata, vital::image_container_scptr const &input_image) override
Filter metadata and return resulting metadata.
This method implements the filtering operation. The method does not modify the metadata in place.
- Parameters:
input_metadata – Metadata to filter.
input_image – Image associated with the metadata (may be null).
- Returns:
Filtered version of the input metadata.
-
virtual bool check_configuration(vital::config_block_sptr config) const override
metadata_map_io_csv
-
class metadata_map_io_csv : public kwiver::vital::algo::metadata_map_io
Public Functions
-
virtual kwiver::vital::metadata_map_sptr load_(std::istream &fin, std::string const &filename) const override
Unimplemented.
- Parameters:
filename – the path to the file the load
- Throws:
kwiver::vital::file_write_exception – not implemented
-
virtual void save_(std::ostream &fout, kwiver::vital::metadata_map_sptr data, std::string const &filename) const override
Implementation specific save functionality.
Save metadata to a CSV file. Uses the union of fields taken from all packets as the header, and inserts empty fields when values are missing for a given frame
- Parameters:
filename – the path to the file to save
data – the metadata for a video to save
-
virtual bool check_configuration(vital::config_block_sptr config) const override
Check supplied configuration.
The options
every_n_microsecondsandevery_n_framescannot appear in the same configuration.
-
class priv
-
virtual kwiver::vital::metadata_map_sptr load_(std::istream &fin, std::string const &filename) const override
read_object_track_set_kw18
-
class read_object_track_set_kw18 : public kwiver::vital::algo::read_object_track_set
Public Functions
-
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 bool read_set(kwiver::vital::object_track_set_sptr &set)
Read next object track set
This method reads the next set of track objects from the file. False is returned when the end of file is reached.
- Parameters:
set – [out] Pointer to the new set of object tracks. Set may be empty if there are no object tracks on an image.
- Returns:
true if object tracks are returned, false if end of file.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const
read_track_descriptor_set_csv
-
class read_track_descriptor_set_csv : public kwiver::vital::algo::read_track_descriptor_set
Public Functions
-
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 bool read_set(kwiver::vital::track_descriptor_set_sptr &set)
Read next detected object set
This method reads the next set of detected objects from the file. False is returned when the end of file is reached.
- Parameters:
set – [out] Pointer to the new set of track descriptors. Set may be empty if there are no track descriptors on an image.
- Returns:
true if track descriptors are returned, false if end of file.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const
track_features_augment_keyframes
-
class track_features_augment_keyframes : public kwiver::vital::algo::track_features
A class to augment feature tracks on keyframes
This algorithm applies a feature detector/descriptor on the current frame if it is marked as a keyframe and creates new track states from those features. It does nothing if the current frame is not a keyframe. These new track states are not currently linked to previous states in this algorithm.
Public Functions
- PLUGGABLE_IMPL (track_features_augment_keyframes, "If the current frame is a keyframe, detect and describe " "additional features and create new tracks on this frame.", PARAM(extractor, vital::algo::extract_descriptors_sptr, "Extractor"), PARAM_DEFAULT(extractor_name, std::string, "Extractor name", "kf_only_descriptor_extractor")) virtual ~track_features_augment_keyframes() noexcept
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const override
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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::feature_track_set_sptr track(kwiver::vital::feature_track_set_sptr prev_tracks, kwiver::vital::frame_id_t frame_number, kwiver::vital::image_container_sptr image_data, kwiver::vital::image_container_sptr mask = {}) const override
Augment existing tracks with additional feature if a keyframe.
Augment existing tracks with additional features if a keyframe
This special tracking algorithm runs an additional feature detector on frames which have been labeled as keyframes. If the specified frame is a keyframe in the track set, additional features are detected, descriptors are extracted, and new track states are added on this frame. If the specified frame is not a keyframe the tracks are returned unchanged.
This tracking algorithm currently does not link any of the newly added tracks states to previous track states.
- Throws:
image_size_mismatch_exception – When the given non-zero mask image does not match the size of the dimensions of the given image data.
- Parameters:
tracks – [in] the feature tracks from previous tracking steps
frame_number – [in] the frame number of the current frame
image_data – [in] the image pixels for the current frame
mask – [in] Optional mask image that uses positive values to denote regions of the input image to consider for feature tracking. An empty sptr indicates no mask (default value).
- Returns:
an updated set of feature tracks
track_features_core
-
class track_features_core : public kwiver::vital::algo::track_features
A basic feature tracker.
Public Functions
- PLUGGABLE_IMPL (track_features_core, "Track features from frame to frame" " using feature detection, matching, and loop closure.", PARAM_DEFAULT(features_dir, kwiver::vital::config_path_t, "Path to a directory in which to read or write the feature " "detection and description files.\n" "Using this directory requires a feature_io algorithm.", ""), PARAM(feature_detector, vital::algo::detect_features_sptr, "feature_detector"), PARAM(descriptor_extractor, vital::algo::extract_descriptors_sptr, "descriptor_extractor"), PARAM(feature_io, vital::algo::feature_descriptor_io_sptr, "feature_io"), PARAM(feature_matcher, vital::algo::match_features_sptr, "feature_matcher"), PARAM(loop_closer, vital::algo::close_loops_sptr, "loop_closer")) virtual ~track_features_core() noexcept
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const override
Check that the algorithm’s currently configuration is valid
This checks solely within the provided
config_blockand not against the current state of the instance. This isn’t static for inheritence 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::feature_track_set_sptr track(vital::feature_track_set_sptr prev_tracks, vital::frame_id_t frame_number, vital::image_container_sptr image_data, vital::image_container_sptr mask = {}) const override
Extend a previous set of tracks using the current frame.
Extend a previous set of feature tracks using the current frame
- Throws:
image_size_mismatch_exception – When the given non-zero mask image does not match the size of the dimensions of the given image data.
- Parameters:
prev_tracks – [in] the feature tracks from previous tracking steps
frame_number – [in] the frame number of the current frame
image_data – [in] the image pixels for the current frame
mask – [in] Optional mask image that uses positive values to denote regions of the input image to consider for feature tracking. An empty sptr indicates no mask (default value).
- Returns:
an updated set of feature tracks including the current frame
-
class priv
Private implementation class.
transfer_bbox_with_depth_map
-
class transfer_bbox_with_depth_map : public kwiver::vital::algo::detected_object_filter
Transforms detections based on source and destination cameras.
Public Functions
- PLUGGABLE_IMPL (transfer_bbox_with_depth_map, "Transforms detected object set bounding boxes based on source " "and destination cameras with respect the source cameras depth " "map.\n\n", PARAM_DEFAULT(src_camera_krtd_file_name, std::string, "Source camera KRTD file name path", ""), PARAM_DEFAULT(dest_camera_krtd_file_name, std::string, "Destination camera KRTD file name path", ""), PARAM_DEFAULT(src_camera_depth_map_file_name, std::string, "Source camera depth map file name path", ""), PARAM(image_reader, std::shared_ptr< vital::algo::image_io >, "image_reader")) virtual ~transfer_bbox_with_depth_map() noexcept
Destructor.
-
transfer_bbox_with_depth_map(kwiver::vital::camera_perspective_sptr src_cam, kwiver::vital::camera_perspective_sptr dest_cam, kwiver::vital::image_container_sptr src_cam_depth_map)
Constructor taking source and destination cameras directly.
-
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 filter(vital::detected_object_set_sptr const input_set) const
Apply the transformation.
-
class priv
transform_detected_object_set
-
class transform_detected_object_set : public kwiver::vital::algo::detected_object_filter
Transforms detections based on source and destination cameras.
Public Functions
- PLUGGABLE_IMPL (transform_detected_object_set, "Transforms a detected object set based on source and " "destination cameras.\n\n", PARAM_DEFAULT(src_camera_krtd_file_name, std::string, "Source camera KRTD file name path", ""), PARAM_DEFAULT(dest_camera_krtd_file_name, std::string, "Destination camera KRTD file name path", "")) virtual ~transform_detected_object_set()
Default destructor.
-
transform_detected_object_set(kwiver::vital::camera_perspective_sptr src_cam, kwiver::vital::camera_perspective_sptr dest_cam)
Constructor taking source and destination cameras directly.
-
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 filter(vital::detected_object_set_sptr const input_set) const
Apply the transformation.
-
class priv
uv_unwrap_mesh
-
class uv_unwrap_mesh : public kwiver::vital::algo::uv_unwrap_mesh
A class for unwrapping a mesh and generating texture coordinates.
Public Functions
- PLUGGABLE_IMPL (uv_unwrap_mesh, "A class for unwrapping a mesh and generating texture coordinates. ", PARAM_DEFAULT(spacing, double, "Spacing between triangles. It is a percentage of the texture size " "and should be relatively small (default is 0.005).", 0.005)) virtual ~uv_unwrap_mesh()
Destructor.
-
virtual bool check_configuration(vital::config_block_sptr config) const override
Check configuration.
-
virtual void unwrap(kwiver::vital::mesh_sptr mesh) const override
Unwrap a mesh and generate texture coordinate
- Parameters:
mesh – [in/out]
-
class priv
video_input_buffered_metadata_filter
-
class video_input_buffered_metadata_filter : public kwiver::vital::algo::video_input
A video reader that filters the metadata, reading ahead some frames.
This class implements a video input that applies a buffered filter to a video stream’s metadata. The filter must (eventually) produce one frame of output metadata for each frame given to it.
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const override
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 void open(std::string name) override
Open a video stream.
This method opens the specified video stream for reading. The format of the name depends on the concrete implementation. It could be a file name or it could be a URI.
Capabilities are set in this call, so they are available after.
Note
Once a video is opened, it starts in an invalid state (i.e. before the first frame of video). You must call
next_frame()to step to the first frame of video before callingframe_image().- Parameters:
video_name – Identifier of the video stream.
- Throws:
exception – if open failed
-
virtual void close() override
Close video stream.
Close the currently opened stream and release resources. Closing a stream that is already closed does not cause a problem.
-
virtual bool end_of_video() const override
Return end of video status.
This method returns the end-of-video status of the input video. true is returned if the last frame has been returned.
This method will always return false for video streams that have no ability to detect end of video, such as network streams.
- Returns:
true if at end of video, false otherwise.
-
virtual bool good() const override
Check whether state of video stream is good.
This method checks the current state of the video stream to see if it is good. A stream is good if it refers to a valid frame such that calls to
frame_image()andframe_metadata()are expected to return meaningful data. After callingopen()the initial video state is not good until the first call tonext_frame().- Returns:
true if video stream is good, false if not good.
-
virtual bool seekable() const override
Return whether video stream is seekable.
This method returns whether the video stream is seekable.
- Returns:
true if video stream is seekable, false otherwise.
-
virtual size_t num_frames() const override
Get the number of frames in the video stream.
Get the number of frames available in the video stream.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
the number of frames in the video stream, or 0 if the video stream is not seekable.
-
virtual bool next_frame(vital::timestamp &ts, vital::time_usec_t timeout = 0) override
Advance to next frame in video stream.
This method advances the video stream to the next frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing either frame number or time or both, depending on the actual implementation.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the video input is already an end, then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual bool seek_frame(vital::timestamp &ts, vital::timestamp::frame_t frame_number, vital::time_usec_t timeout = 0) override
Seek to the given frame number in video stream.
This method seeks the video stream to the requested frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing the time.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the frame requested does not exist, then calling this method will return false.
If the video input is not seekable then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
frame_number – [in] The frame to seek to.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual vital::timestamp frame_timestamp() const override
Obtain the time stamp of the current frame.
This method returns the time stamp of the current frame, if any, or an invalid time stamp. The returned time stamp shall have the same value as was set by the most recent call to
next_frame().This method is idempotent. Calling it multiple times without calling next_frame() will return the same time stamp.
- Returns:
The time stamp of the current frame.
-
virtual vital::image_container_sptr frame_image() override
Get current frame from video stream.
This method returns the image from the current frame. If the video input is already an end, then calling this method will return a null pointer.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same image.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Pointer to image container.
-
virtual vital::video_raw_image_sptr raw_frame_image() override
Return implementation-defined data for efficiently copying this frame’s image.
Using this method can help avoid the loss of efficiency and fidelity that comes with re-encoding an image, if no changes to the image are to be performed before writing it back out. May return
nullptr, indicating the reader does not support this operation.- Returns:
Pointer to raw image data.
-
virtual vital::metadata_vector frame_metadata() override
Get metadata collection for current frame.
This method returns the metadata collection for the current frame. It is best to call this after calling next_frame() to make sure the metadata and video are synchronized and that no metadata collections are lost.
Metadata typically occurs less frequently than video frames, so if you call next_frame() and frame_metadata() together while processing a video, there may be times where no metadata is returned. In this case an empty metadata vector will be returned.
Also note that the metadata collection contains a timestamp that can be used to determine where the metadata fits in the video stream.
In video streams without metadata (as determined by the stream capability), this method may return and empty vector, indicating no new metadata has been found.
Calling this method at end of video will return an empty metadata vector.
Metadata is returned as a vector, instead of a single object, to handle cases where there is multiple metadata packets between frames. This can happen in video streams with a fast metadata rate and slow frame rate. Multiple metadata objects can be also returned from video streams that contain metadata in multiple standards, such as MISB-601 and MISB-104.
In cases where there are multiple metadata packets between frames, it is inappropriate for the reader to try to select the best metadata packet. That is why they are all returned.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same metadata.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Vector of metadata pointers.
-
virtual vital::video_raw_metadata_sptr raw_frame_metadata() override
Return implementation-defined data for efficiently copying this frame’s metadata.
Using this method can help avoid the loss of efficiency and fidelity that comes with re-encoding metadata, if no changes to the metadata are to be performed before writing it back out. May return
nullptr, indicating the reader does not support this operation.- Returns:
Pointer to raw metadata.
-
virtual vital::video_uninterpreted_data_sptr uninterpreted_frame_data() override
Return an implementation-defined representation of uninterpreted data in this frame.
This method enables passage of miscellaneous data - such as audio, unrecognized metadata, or secondary image streams - to a video output when transcoding.
- Returns:
Pointer to uninterpreted data.
-
virtual vital::metadata_map_sptr metadata_map() override
Get metadata map for video.
This method returns a metadata map for the video assuming the video is seekable. If the video is not seekable it will return an empty map. Depending on the implementation if the metamap has not been previously requested then the video will have to loop over to create and store the metadata map.
In video streams without metadata (as determined by the stream capability), this method will return an empty map, indicating no metadata has been found.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Map of vectors of metadata pointers.
-
virtual vital::video_settings_uptr implementation_settings() const override
Extract implementation-specific video encoding settings.
The returned structure is intended to be passed to a video encoder of similar implementation so that the output video can be encoded using the settings of the input video.
- Returns:
Implementation video settings, or
nullptrif none are needed.
-
virtual bool check_configuration(vital::config_block_sptr config) const override
video_input_filter
-
class video_input_filter : public kwiver::vital::algo::video_input
A video reader that filters the frames and metadata.
This class implements a video input that down selects frames ready by another video reader. It may down sample the framerate, remove frames before or after indicated frames, etc.
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const override
Check that the algorithm’s currently configuration is valid.
-
virtual void open(std::string name) override
Open a video stream.
This method opens the specified video stream for reading. The format of the name depends on the concrete implementation. It could be a file name or it could be a URI.
Capabilities are set in this call, so they are available after.
Note
Once a video is opened, it starts in an invalid state (i.e. before the first frame of video). You must call
next_frame()to step to the first frame of video before callingframe_image().- Parameters:
video_name – Identifier of the video stream.
- Throws:
exception – if open failed
-
virtual void close() override
Close video stream.
Close the currently opened stream and release resources. Closing a stream that is already closed does not cause a problem.
-
virtual bool end_of_video() const override
Return end of video status.
This method returns the end-of-video status of the input video. true is returned if the last frame has been returned.
This method will always return false for video streams that have no ability to detect end of video, such as network streams.
- Returns:
true if at end of video, false otherwise.
-
virtual bool good() const override
Check whether state of video stream is good.
This method checks the current state of the video stream to see if it is good. A stream is good if it refers to a valid frame such that calls to
frame_image()andframe_metadata()are expected to return meaningful data. After callingopen()the initial video state is not good until the first call tonext_frame().- Returns:
true if video stream is good, false if not good.
-
virtual bool seekable() const override
Return whether video stream is seekable.
This method returns whether the video stream is seekable.
- Returns:
true if video stream is seekable, false otherwise.
-
virtual size_t num_frames() const override
Get the number of frames in the video stream.
Get the number of frames available in the video stream.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
the number of frames in the video stream, or 0 if the video stream is not seekable.
-
virtual bool next_frame(kwiver::vital::timestamp &ts, vital::time_usec_t timeout = 0) override
Advance to next frame in video stream.
This method advances the video stream to the next frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing either frame number or time or both, depending on the actual implementation.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the video input is already an end, then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual bool seek_frame(kwiver::vital::timestamp &ts, kwiver::vital::timestamp::frame_t frame_number, vital::time_usec_t timeout = 0) override
Seek to the given frame number in video stream.
This method seeks the video stream to the requested frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing the time.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the frame requested does not exist, then calling this method will return false.
If the video input is not seekable then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
frame_number – [in] The frame to seek to.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual kwiver::vital::timestamp frame_timestamp() const override
Obtain the time stamp of the current frame.
This method returns the time stamp of the current frame, if any, or an invalid time stamp. The returned time stamp shall have the same value as was set by the most recent call to
next_frame().This method is idempotent. Calling it multiple times without calling next_frame() will return the same time stamp.
- Returns:
The time stamp of the current frame.
-
virtual kwiver::vital::image_container_sptr frame_image() override
Get current frame from video stream.
This method returns the image from the current frame. If the video input is already an end, then calling this method will return a null pointer.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same image.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Pointer to image container.
-
virtual kwiver::vital::metadata_vector frame_metadata() override
Get metadata collection for current frame.
This method returns the metadata collection for the current frame. It is best to call this after calling next_frame() to make sure the metadata and video are synchronized and that no metadata collections are lost.
Metadata typically occurs less frequently than video frames, so if you call next_frame() and frame_metadata() together while processing a video, there may be times where no metadata is returned. In this case an empty metadata vector will be returned.
Also note that the metadata collection contains a timestamp that can be used to determine where the metadata fits in the video stream.
In video streams without metadata (as determined by the stream capability), this method may return and empty vector, indicating no new metadata has been found.
Calling this method at end of video will return an empty metadata vector.
Metadata is returned as a vector, instead of a single object, to handle cases where there is multiple metadata packets between frames. This can happen in video streams with a fast metadata rate and slow frame rate. Multiple metadata objects can be also returned from video streams that contain metadata in multiple standards, such as MISB-601 and MISB-104.
In cases where there are multiple metadata packets between frames, it is inappropriate for the reader to try to select the best metadata packet. That is why they are all returned.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same metadata.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Vector of metadata pointers.
-
virtual kwiver::vital::video_raw_metadata_sptr raw_frame_metadata() override
Return implementation-defined data for efficiently copying this frame’s metadata.
Using this method can help avoid the loss of efficiency and fidelity that comes with re-encoding metadata, if no changes to the metadata are to be performed before writing it back out. May return
nullptr, indicating the reader does not support this operation.- Returns:
Pointer to raw metadata.
-
virtual kwiver::vital::metadata_map_sptr metadata_map() override
Get metadata map for video.
This method returns a metadata map for the video assuming the video is seekable. If the video is not seekable it will return an empty map. Depending on the implementation if the metamap has not been previously requested then the video will have to loop over to create and store the metadata map.
In video streams without metadata (as determined by the stream capability), this method will return an empty map, indicating no metadata has been found.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Map of vectors of metadata pointers.
-
virtual kwiver::vital::video_settings_uptr implementation_settings() const override
Extract implementation-specific video encoding settings.
The returned structure is intended to be passed to a video encoder of similar implementation so that the output video can be encoded using the settings of the input video.
- Returns:
Implementation video settings, or
nullptrif none are needed.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const override
video_input_image_list
-
class video_input_image_list : public kwiver::vital::algo::video_input
Video input using list of images.
This class implements a video input algorithm using a list of images to simulate a video. Only the images are returned. This algorithm produces no metadata.
Example config: select reader type
image_reader:type = vxl
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const override
Check that the algorithm’s currently configuration is valid.
-
virtual void open(std::string list_name) override
Open a list of images.
This method opens the file that contains the list of images. Each image verified to exist at this time.
- Parameters:
list_name – Name of file that contains list of images.
-
virtual void close() override
Close video stream.
Close the currently opened stream and release resources. Closing a stream that is already closed does not cause a problem.
-
virtual bool end_of_video() const override
Return end of video status.
This method returns the end-of-video status of the input video. true is returned if the last frame has been returned.
This method will always return false for video streams that have no ability to detect end of video, such as network streams.
- Returns:
true if at end of video, false otherwise.
-
virtual bool good() const override
Check whether state of video stream is good.
This method checks the current state of the video stream to see if it is good. A stream is good if it refers to a valid frame such that calls to
frame_image()andframe_metadata()are expected to return meaningful data. After callingopen()the initial video state is not good until the first call tonext_frame().- Returns:
true if video stream is good, false if not good.
-
virtual bool seekable() const override
Return whether video stream is seekable.
This method returns whether the video stream is seekable.
- Returns:
true if video stream is seekable, false otherwise.
-
virtual size_t num_frames() const override
Get the number of frames in the video stream.
Get the number of frames available in the video stream.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
the number of frames in the video stream, or 0 if the video stream is not seekable.
-
virtual bool next_frame(kwiver::vital::timestamp &ts, vital::time_usec_t timeout = 0) override
Advance to next frame in video stream.
This method advances the video stream to the next frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing either frame number or time or both, depending on the actual implementation.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the video input is already an end, then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual bool seek_frame(kwiver::vital::timestamp &ts, kwiver::vital::timestamp::frame_t frame_number, kwiver::vital::time_usec_t timeout = 0) override
Seek to the given frame number in video stream.
This method seeks the video stream to the requested frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing the time.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the frame requested does not exist, then calling this method will return false.
If the video input is not seekable then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
frame_number – [in] The frame to seek to.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual kwiver::vital::timestamp frame_timestamp() const override
Obtain the time stamp of the current frame.
This method returns the time stamp of the current frame, if any, or an invalid time stamp. The returned time stamp shall have the same value as was set by the most recent call to
next_frame().This method is idempotent. Calling it multiple times without calling next_frame() will return the same time stamp.
- Returns:
The time stamp of the current frame.
-
virtual kwiver::vital::image_container_sptr frame_image() override
Get current frame from video stream.
This method returns the image from the current frame. If the video input is already an end, then calling this method will return a null pointer.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same image.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Pointer to image container.
-
virtual kwiver::vital::metadata_vector frame_metadata() override
Get metadata collection for current frame.
This method returns the metadata collection for the current frame. It is best to call this after calling next_frame() to make sure the metadata and video are synchronized and that no metadata collections are lost.
Metadata typically occurs less frequently than video frames, so if you call next_frame() and frame_metadata() together while processing a video, there may be times where no metadata is returned. In this case an empty metadata vector will be returned.
Also note that the metadata collection contains a timestamp that can be used to determine where the metadata fits in the video stream.
In video streams without metadata (as determined by the stream capability), this method may return and empty vector, indicating no new metadata has been found.
Calling this method at end of video will return an empty metadata vector.
Metadata is returned as a vector, instead of a single object, to handle cases where there is multiple metadata packets between frames. This can happen in video streams with a fast metadata rate and slow frame rate. Multiple metadata objects can be also returned from video streams that contain metadata in multiple standards, such as MISB-601 and MISB-104.
In cases where there are multiple metadata packets between frames, it is inappropriate for the reader to try to select the best metadata packet. That is why they are all returned.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same metadata.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Vector of metadata pointers.
-
virtual kwiver::vital::metadata_map_sptr metadata_map() override
Get metadata map for video.
This method returns a metadata map for the video assuming the video is seekable. If the video is not seekable it will return an empty map. Depending on the implementation if the metamap has not been previously requested then the video will have to loop over to create and store the metadata map.
In video streams without metadata (as determined by the stream capability), this method will return an empty map, indicating no metadata has been found.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Map of vectors of metadata pointers.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const override
video_input_metadata_filter
-
class video_input_metadata_filter : public kwiver::vital::algo::video_input
A video reader that filters the metadata.
This class implements a video input that applies another filter to a video frame’s metadata.
Public Functions
-
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 void open(std::string name) override
Open a video stream.
This method opens the specified video stream for reading. The format of the name depends on the concrete implementation. It could be a file name or it could be a URI.
Capabilities are set in this call, so they are available after.
Note
Once a video is opened, it starts in an invalid state (i.e. before the first frame of video). You must call
next_frame()to step to the first frame of video before callingframe_image().- Parameters:
video_name – Identifier of the video stream.
- Throws:
exception – if open failed
-
virtual void close() override
Close video stream.
Close the currently opened stream and release resources. Closing a stream that is already closed does not cause a problem.
-
virtual bool end_of_video() const override
Return end of video status.
This method returns the end-of-video status of the input video. true is returned if the last frame has been returned.
This method will always return false for video streams that have no ability to detect end of video, such as network streams.
- Returns:
true if at end of video, false otherwise.
-
virtual bool good() const override
Check whether state of video stream is good.
This method checks the current state of the video stream to see if it is good. A stream is good if it refers to a valid frame such that calls to
frame_image()andframe_metadata()are expected to return meaningful data. After callingopen()the initial video state is not good until the first call tonext_frame().- Returns:
true if video stream is good, false if not good.
-
virtual bool seekable() const override
Return whether video stream is seekable.
This method returns whether the video stream is seekable.
- Returns:
true if video stream is seekable, false otherwise.
-
virtual size_t num_frames() const override
Get the number of frames in the video stream.
Get the number of frames available in the video stream.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
the number of frames in the video stream, or 0 if the video stream is not seekable.
-
virtual bool next_frame(kwiver::vital::timestamp &ts, vital::time_usec_t timeout = 0) override
Advance to next frame in video stream.
This method advances the video stream to the next frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing either frame number or time or both, depending on the actual implementation.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the video input is already an end, then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual bool seek_frame(kwiver::vital::timestamp &ts, kwiver::vital::timestamp::frame_t frame_number, vital::time_usec_t timeout = 0) override
Seek to the given frame number in video stream.
This method seeks the video stream to the requested frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing the time.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the frame requested does not exist, then calling this method will return false.
If the video input is not seekable then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
frame_number – [in] The frame to seek to.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual kwiver::vital::timestamp frame_timestamp() const override
Obtain the time stamp of the current frame.
This method returns the time stamp of the current frame, if any, or an invalid time stamp. The returned time stamp shall have the same value as was set by the most recent call to
next_frame().This method is idempotent. Calling it multiple times without calling next_frame() will return the same time stamp.
- Returns:
The time stamp of the current frame.
-
virtual kwiver::vital::image_container_sptr frame_image() override
Get current frame from video stream.
This method returns the image from the current frame. If the video input is already an end, then calling this method will return a null pointer.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same image.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Pointer to image container.
-
virtual kwiver::vital::video_raw_image_sptr raw_frame_image() override
Return implementation-defined data for efficiently copying this frame’s image.
Using this method can help avoid the loss of efficiency and fidelity that comes with re-encoding an image, if no changes to the image are to be performed before writing it back out. May return
nullptr, indicating the reader does not support this operation.- Returns:
Pointer to raw image data.
-
virtual kwiver::vital::metadata_vector frame_metadata() override
Get metadata collection for current frame.
This method returns the metadata collection for the current frame. It is best to call this after calling next_frame() to make sure the metadata and video are synchronized and that no metadata collections are lost.
Metadata typically occurs less frequently than video frames, so if you call next_frame() and frame_metadata() together while processing a video, there may be times where no metadata is returned. In this case an empty metadata vector will be returned.
Also note that the metadata collection contains a timestamp that can be used to determine where the metadata fits in the video stream.
In video streams without metadata (as determined by the stream capability), this method may return and empty vector, indicating no new metadata has been found.
Calling this method at end of video will return an empty metadata vector.
Metadata is returned as a vector, instead of a single object, to handle cases where there is multiple metadata packets between frames. This can happen in video streams with a fast metadata rate and slow frame rate. Multiple metadata objects can be also returned from video streams that contain metadata in multiple standards, such as MISB-601 and MISB-104.
In cases where there are multiple metadata packets between frames, it is inappropriate for the reader to try to select the best metadata packet. That is why they are all returned.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same metadata.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Vector of metadata pointers.
-
virtual vital::video_raw_metadata_sptr raw_frame_metadata() override
Return implementation-defined data for efficiently copying this frame’s metadata.
Using this method can help avoid the loss of efficiency and fidelity that comes with re-encoding metadata, if no changes to the metadata are to be performed before writing it back out. May return
nullptr, indicating the reader does not support this operation.- Returns:
Pointer to raw metadata.
-
virtual kwiver::vital::video_uninterpreted_data_sptr uninterpreted_frame_data() override
Return an implementation-defined representation of uninterpreted data in this frame.
This method enables passage of miscellaneous data - such as audio, unrecognized metadata, or secondary image streams - to a video output when transcoding.
- Returns:
Pointer to uninterpreted data.
-
virtual kwiver::vital::metadata_map_sptr metadata_map() override
Get metadata map for video.
This method returns a metadata map for the video assuming the video is seekable. If the video is not seekable it will return an empty map. Depending on the implementation if the metamap has not been previously requested then the video will have to loop over to create and store the metadata map.
In video streams without metadata (as determined by the stream capability), this method will return an empty map, indicating no metadata has been found.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Map of vectors of metadata pointers.
-
virtual kwiver::vital::video_settings_uptr implementation_settings() const override
Extract implementation-specific video encoding settings.
The returned structure is intended to be passed to a video encoder of similar implementation so that the output video can be encoded using the settings of the input video.
- Returns:
Implementation video settings, or
nullptrif none are needed.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const
video_input_pos
-
class video_input_pos : public kwiver::vital::algo::video_input
Metadata reader using the AFRL POS file format.
This class implements a video input algorithm that returns only metadata.
The algorithm takes configuration for a directory full of images and an associated directory name for the metadata files. These metadata files have the same base name as the image files.
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const override
Check that the algorithm’s currently configuration is valid.
-
virtual void open(std::string list_name) override
Open a list of images.
This method opens the file that contains the list of images. The individual image names are used to find the associated metadata file in the directory supplied via the configuration.
- Parameters:
list_name – Name of file that contains list of images.
-
virtual void close() override
Close video stream.
Close the currently opened stream and release resources. Closing a stream that is already closed does not cause a problem.
-
virtual bool end_of_video() const override
Return end of video status.
This method returns the end-of-video status of the input video. true is returned if the last frame has been returned.
This method will always return false for video streams that have no ability to detect end of video, such as network streams.
- Returns:
true if at end of video, false otherwise.
-
virtual bool good() const override
Check whether state of video stream is good.
This method checks the current state of the video stream to see if it is good. A stream is good if it refers to a valid frame such that calls to
frame_image()andframe_metadata()are expected to return meaningful data. After callingopen()the initial video state is not good until the first call tonext_frame().- Returns:
true if video stream is good, false if not good.
-
virtual bool seekable() const override
Return whether video stream is seekable.
This method returns whether the video stream is seekable.
- Returns:
true if video stream is seekable, false otherwise.
-
virtual size_t num_frames() const override
Get the number of frames in the video stream.
Get the number of frames available in the video stream.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
the number of frames in the video stream, or 0 if the video stream is not seekable.
-
virtual bool next_frame(kwiver::vital::timestamp &ts, vital::time_usec_t timeout = 0) override
Advance to next frame in video stream.
This method advances the video stream to the next frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing either frame number or time or both, depending on the actual implementation.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the video input is already an end, then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual bool seek_frame(kwiver::vital::timestamp &ts, kwiver::vital::timestamp::frame_t frame_number, vital::time_usec_t timeout = 0) override
Seek to the given frame number in video stream.
This method seeks the video stream to the requested frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing the time.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the frame requested does not exist, then calling this method will return false.
If the video input is not seekable then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
frame_number – [in] The frame to seek to.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual kwiver::vital::timestamp frame_timestamp() const override
Obtain the time stamp of the current frame.
This method returns the time stamp of the current frame, if any, or an invalid time stamp. The returned time stamp shall have the same value as was set by the most recent call to
next_frame().This method is idempotent. Calling it multiple times without calling next_frame() will return the same time stamp.
- Returns:
The time stamp of the current frame.
-
virtual kwiver::vital::image_container_sptr frame_image() override
Get current frame from video stream.
This method returns the image from the current frame. If the video input is already an end, then calling this method will return a null pointer.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same image.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Pointer to image container.
-
virtual kwiver::vital::metadata_vector frame_metadata() override
Get metadata collection for current frame.
This method returns the metadata collection for the current frame. It is best to call this after calling next_frame() to make sure the metadata and video are synchronized and that no metadata collections are lost.
Metadata typically occurs less frequently than video frames, so if you call next_frame() and frame_metadata() together while processing a video, there may be times where no metadata is returned. In this case an empty metadata vector will be returned.
Also note that the metadata collection contains a timestamp that can be used to determine where the metadata fits in the video stream.
In video streams without metadata (as determined by the stream capability), this method may return and empty vector, indicating no new metadata has been found.
Calling this method at end of video will return an empty metadata vector.
Metadata is returned as a vector, instead of a single object, to handle cases where there is multiple metadata packets between frames. This can happen in video streams with a fast metadata rate and slow frame rate. Multiple metadata objects can be also returned from video streams that contain metadata in multiple standards, such as MISB-601 and MISB-104.
In cases where there are multiple metadata packets between frames, it is inappropriate for the reader to try to select the best metadata packet. That is why they are all returned.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same metadata.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Vector of metadata pointers.
-
virtual kwiver::vital::metadata_map_sptr metadata_map() override
Get metadata map for video.
This method returns a metadata map for the video assuming the video is seekable. If the video is not seekable it will return an empty map. Depending on the implementation if the metamap has not been previously requested then the video will have to loop over to create and store the metadata map.
In video streams without metadata (as determined by the stream capability), this method will return an empty map, indicating no metadata has been found.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Map of vectors of metadata pointers.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const override
video_input_splice
-
class video_input_splice : public kwiver::vital::algo::video_input
Video input that splices frames together from multiple video input sources.
This class implements a video input algorithm that splices multiple video input sources together into a single source.
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const
Check that the algorithm’s currently configuration is valid.
-
virtual void open(std::string name)
Open a video stream.
This method opens the specified video stream for reading. The format of the name depends on the concrete implementation. It could be a file name or it could be a URI.
Capabilities are set in this call, so they are available after.
Note
Once a video is opened, it starts in an invalid state (i.e. before the first frame of video). You must call
next_frame()to step to the first frame of video before callingframe_image().- Parameters:
video_name – Identifier of the video stream.
- Throws:
exception – if open failed
-
virtual void close()
Close video stream.
Close the currently opened stream and release resources. Closing a stream that is already closed does not cause a problem.
-
virtual bool end_of_video() const
Return end of video status.
This method returns the end-of-video status of the input video. true is returned if the last frame has been returned.
This method will always return false for video streams that have no ability to detect end of video, such as network streams.
- Returns:
true if at end of video, false otherwise.
-
virtual bool good() const
Check whether state of video stream is good.
This method checks the current state of the video stream to see if it is good. A stream is good if it refers to a valid frame such that calls to
frame_image()andframe_metadata()are expected to return meaningful data. After callingopen()the initial video state is not good until the first call tonext_frame().- Returns:
true if video stream is good, false if not good.
-
virtual bool seekable() const
Return whether video stream is seekable.
This method returns whether the video stream is seekable.
- Returns:
true if video stream is seekable, false otherwise.
-
virtual size_t num_frames() const
Get the number of frames in the video stream.
Get the number of frames available in the video stream.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
the number of frames in the video stream, or 0 if the video stream is not seekable.
-
virtual bool next_frame(kwiver::vital::timestamp &ts, vital::time_usec_t timeout = 0)
Advance to next frame in video stream.
This method advances the video stream to the next frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing either frame number or time or both, depending on the actual implementation.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the video input is already an end, then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual bool seek_frame(kwiver::vital::timestamp &ts, kwiver::vital::timestamp::frame_t frame_number, vital::time_usec_t timeout = 0)
Seek to the given frame number in video stream.
This method seeks the video stream to the requested frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing the time.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the frame requested does not exist, then calling this method will return false.
If the video input is not seekable then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
frame_number – [in] The frame to seek to.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual kwiver::vital::timestamp frame_timestamp() const
Obtain the time stamp of the current frame.
This method returns the time stamp of the current frame, if any, or an invalid time stamp. The returned time stamp shall have the same value as was set by the most recent call to
next_frame().This method is idempotent. Calling it multiple times without calling next_frame() will return the same time stamp.
- Returns:
The time stamp of the current frame.
-
virtual kwiver::vital::image_container_sptr frame_image()
Get current frame from video stream.
This method returns the image from the current frame. If the video input is already an end, then calling this method will return a null pointer.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same image.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Pointer to image container.
-
virtual kwiver::vital::metadata_vector frame_metadata()
Get metadata collection for current frame.
This method returns the metadata collection for the current frame. It is best to call this after calling next_frame() to make sure the metadata and video are synchronized and that no metadata collections are lost.
Metadata typically occurs less frequently than video frames, so if you call next_frame() and frame_metadata() together while processing a video, there may be times where no metadata is returned. In this case an empty metadata vector will be returned.
Also note that the metadata collection contains a timestamp that can be used to determine where the metadata fits in the video stream.
In video streams without metadata (as determined by the stream capability), this method may return and empty vector, indicating no new metadata has been found.
Calling this method at end of video will return an empty metadata vector.
Metadata is returned as a vector, instead of a single object, to handle cases where there is multiple metadata packets between frames. This can happen in video streams with a fast metadata rate and slow frame rate. Multiple metadata objects can be also returned from video streams that contain metadata in multiple standards, such as MISB-601 and MISB-104.
In cases where there are multiple metadata packets between frames, it is inappropriate for the reader to try to select the best metadata packet. That is why they are all returned.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same metadata.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Vector of metadata pointers.
-
virtual kwiver::vital::metadata_map_sptr metadata_map()
Get metadata map for video.
This method returns a metadata map for the video assuming the video is seekable. If the video is not seekable it will return an empty map. Depending on the implementation if the metamap has not been previously requested then the video will have to loop over to create and store the metadata map.
In video streams without metadata (as determined by the stream capability), this method will return an empty map, indicating no metadata has been found.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Map of vectors of metadata pointers.
-
virtual kwiver::vital::video_settings_uptr implementation_settings() const override
Extract implementation-specific video encoding settings.
The returned structure is intended to be passed to a video encoder of similar implementation so that the output video can be encoded using the settings of the input video.
- Returns:
Implementation video settings, or
nullptrif none are needed.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const
video_input_split
-
class video_input_split : public kwiver::vital::algo::video_input
Video input that pulls image and metadata inputs from different sources.
This class implements a video input algorithm that holds two other video input algorithms and pulls imagery from one and metadata from the other.
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const override
Check that the algorithm’s currently configuration is valid.
-
virtual void open(std::string name) override
Open a video stream.
This method opens the specified video stream for reading. The format of the name depends on the concrete implementation. It could be a file name or it could be a URI.
Capabilities are set in this call, so they are available after.
Note
Once a video is opened, it starts in an invalid state (i.e. before the first frame of video). You must call
next_frame()to step to the first frame of video before callingframe_image().- Parameters:
video_name – Identifier of the video stream.
- Throws:
exception – if open failed
-
virtual void close() override
Close video stream.
Close the currently opened stream and release resources. Closing a stream that is already closed does not cause a problem.
-
virtual bool end_of_video() const override
Return end of video status.
This method returns the end-of-video status of the input video. true is returned if the last frame has been returned.
This method will always return false for video streams that have no ability to detect end of video, such as network streams.
- Returns:
true if at end of video, false otherwise.
-
virtual bool good() const override
Check whether state of video stream is good.
This method checks the current state of the video stream to see if it is good. A stream is good if it refers to a valid frame such that calls to
frame_image()andframe_metadata()are expected to return meaningful data. After callingopen()the initial video state is not good until the first call tonext_frame().- Returns:
true if video stream is good, false if not good.
-
virtual bool seekable() const override
Return whether video stream is seekable.
This method returns whether the video stream is seekable.
- Returns:
true if video stream is seekable, false otherwise.
-
virtual size_t num_frames() const override
Get the number of frames in the video stream.
Get the number of frames available in the video stream.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
the number of frames in the video stream, or 0 if the video stream is not seekable.
-
virtual bool next_frame(kwiver::vital::timestamp &ts, vital::time_usec_t timeout = 0) override
Advance to next frame in video stream.
This method advances the video stream to the next frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing either frame number or time or both, depending on the actual implementation.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the video input is already an end, then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual bool seek_frame(kwiver::vital::timestamp &ts, kwiver::vital::timestamp::frame_t frame_number, vital::time_usec_t timeout = 0) override
Seek to the given frame number in video stream.
This method seeks the video stream to the requested frame, making the image and metadata available. The returned timestamp is for new current frame.
The timestamp returned may be missing the time.
Calling this method will make a new image and metadata packets available. They can be retrieved by calling frame_image() and frame_metadata().
Check the HAS_TIMEOUT capability from the concrete implementation to see if the timeout feature is supported.
If the frame requested does not exist, then calling this method will return false.
If the video input is not seekable then calling this method will return false.
- Parameters:
ts – [out] Time stamp of new frame.
frame_number – [in] The frame to seek to.
timeout – [in] Number of microseconds to wait. 0 = no timeout.
- Throws:
video_input_timeout_exception – when the timeout expires.
video_stream_exception – when there is an error in the video stream.
- Returns:
true if frame returned, false if end of video.
-
virtual kwiver::vital::timestamp frame_timestamp() const override
Obtain the time stamp of the current frame.
This method returns the time stamp of the current frame, if any, or an invalid time stamp. The returned time stamp shall have the same value as was set by the most recent call to
next_frame().This method is idempotent. Calling it multiple times without calling next_frame() will return the same time stamp.
- Returns:
The time stamp of the current frame.
-
virtual kwiver::vital::image_container_sptr frame_image() override
Get current frame from video stream.
This method returns the image from the current frame. If the video input is already an end, then calling this method will return a null pointer.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same image.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Pointer to image container.
-
virtual kwiver::vital::metadata_vector frame_metadata() override
Get metadata collection for current frame.
This method returns the metadata collection for the current frame. It is best to call this after calling next_frame() to make sure the metadata and video are synchronized and that no metadata collections are lost.
Metadata typically occurs less frequently than video frames, so if you call next_frame() and frame_metadata() together while processing a video, there may be times where no metadata is returned. In this case an empty metadata vector will be returned.
Also note that the metadata collection contains a timestamp that can be used to determine where the metadata fits in the video stream.
In video streams without metadata (as determined by the stream capability), this method may return and empty vector, indicating no new metadata has been found.
Calling this method at end of video will return an empty metadata vector.
Metadata is returned as a vector, instead of a single object, to handle cases where there is multiple metadata packets between frames. This can happen in video streams with a fast metadata rate and slow frame rate. Multiple metadata objects can be also returned from video streams that contain metadata in multiple standards, such as MISB-601 and MISB-104.
In cases where there are multiple metadata packets between frames, it is inappropriate for the reader to try to select the best metadata packet. That is why they are all returned.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same metadata.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Vector of metadata pointers.
-
virtual kwiver::vital::metadata_map_sptr metadata_map() override
Get metadata map for video.
This method returns a metadata map for the video assuming the video is seekable. If the video is not seekable it will return an empty map. Depending on the implementation if the metamap has not been previously requested then the video will have to loop over to create and store the metadata map.
In video streams without metadata (as determined by the stream capability), this method will return an empty map, indicating no metadata has been found.
- Throws:
video_stream_exception – when there is an error in the video stream.
- Returns:
Map of vectors of metadata pointers.
-
virtual kwiver::vital::video_settings_uptr implementation_settings() const override
Extract implementation-specific video encoding settings.
The returned structure is intended to be passed to a video encoder of similar implementation so that the output video can be encoded using the settings of the input video.
- Returns:
Implementation video settings, or
nullptrif none are needed.
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const override
write_object_track_set_kw18
-
class write_object_track_set_kw18 : public kwiver::vital::algo::write_object_track_set
Public Functions
-
virtual bool check_configuration(vital::config_block_sptr config) const override
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 void write_set(kwiver::vital::object_track_set_sptr const &set, kwiver::vital::timestamp const &ts = {}, std::string const &frame_identifier = {}) override
Write object track set.
This method writes the specified object track set and image name to the currently open file.
- Parameters:
set – Track object set
ts – Timestamp for the current frame
frame_identifier – Identifier for the current frame (e.g. file name)
-
virtual void close() override
Close object track set file.
The currently open object track set file is closed. If there is no currently open file, then this method does nothing.
-
class priv
This format should only be used for tracks.
Column(s) 1: Track-id
Column(s) 2: Track-length (# of detections)
Column(s) 3: Frame-number (-1 if not available)
Column(s) 4-5: Tracking-plane-loc(x,y) (Could be same as World-loc)
Column(s) 6-7: Velocity(x,y)
Column(s) 8-9: Image-loc(x,y)
Column(s) 10-13: Img-bbox(TL_x,TL_y,BR_x,BR_y)
Column(s) 14: Area (0 - when not available)
Column(s) 15-17: World-loc(x,y,z) (long, lat, 0 - when not available)
Column(s) 18: Timesetamp(-1 if not available)
Column(s) 19: Track-confidence(-1_when_not_available)
-
virtual bool check_configuration(vital::config_block_sptr config) const override
write_track_descriptor_set_csv
-
class write_track_descriptor_set_csv : public kwiver::vital::algo::write_track_descriptor_set
Public Functions
-
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 void write_set(const kwiver::vital::track_descriptor_set_sptr set)
Write detected object set.
This method writes the specified detected object to file.
- Parameters:
set – Detected object set
-
class priv
-
virtual bool check_configuration(vital::config_block_sptr config) const