VXL¶
This arrow is a collection of vital algorithms implemented with the VXL API
This arrow can be built by enabling the KWIVER_ENABLE_VXL CMake flag
This arrow contains the following functionality:
Bundle Adjust Algorithm¶
-
class
bundle_adjust
: public kwiver::vital::algorithm_impl<bundle_adjust, vital::algo::bundle_adjust>¶ A class for bundle adjustment of feature tracks using VXL.
Public Functions
-
bundle_adjust
()¶ Constructor.
-
~bundle_adjust
()¶ Destructor.
-
vital::config_block_sptr
get_configuration
() const¶ Get this algorithm’s configuration block .
-
void
set_configuration
(vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
-
bool
check_configuration
(vital::config_block_sptr config) const¶ Check that the algorithm’s currently configuration is valid.
-
void
optimize
(vital::camera_map_sptr &cameras, vital::landmark_map_sptr &landmarks, vital::feature_track_set_sptr tracks, vital::metadata_map_sptr metadata = nullptr) const¶ Optimize the camera and landmark parameters given a set of feature tracks.
- Parameters
cameras
: the cameras to optimizelandmarks
: the landmarks to optimizetracks
: the feature tracks to use as constraintsmetadata
: the frame metadata to use as constraints
-
Camera Map Class¶
-
class
camera_map
: public kwiver::vital::camera_map¶ A concrete camera_map that wraps a map of vpgl_perspective_camera.
Public Types
-
typedef std::map<kwiver::vital::frame_id_t, vpgl_perspective_camera<double>>
map_vcam_t
¶ typedef for a map of frame numbers to vpgl_perspective_camera
Public Functions
-
camera_map
()¶ Default Constructor.
-
camera_map
(const map_vcam_t &cameras)¶ Constructor from a std::map of vpgl_perspective_camera.
-
virtual size_t
size
() const¶ Return the number of cameras in the map.
-
vital::camera_map::map_camera_t
cameras
() const¶ Return a map from integer IDs to camera shared pointers.
-
virtual map_vcam_t
vpgl_cameras
() const¶ Return underlying map from IDs to vpgl_perspective_camera.
-
typedef std::map<kwiver::vital::frame_id_t, vpgl_perspective_camera<double>>
Close Loops Homography Guided Algorithm¶
-
class
close_loops_homography_guided
: public kwiver::vital::algorithm_impl<vxl::close_loops_homography_guided, vital::algo::close_loops>¶ Attempts to stitch feature tracks over a long period of time.
This class attempts to make longer-term loop closures by utilizing a variety of techniques, one of which involves using homographies to estimate potential match locations in the past, followed up by additional filtering.
Public Functions
-
close_loops_homography_guided
()¶ Default Constructor.
-
close_loops_homography_guided
(const close_loops_homography_guided&)¶ Copy Constructor.
-
~close_loops_homography_guided
()¶ Destructor.
-
vital::config_block_sptr
get_configuration
() const¶ Get this algorithm’s configuration block .
This base virtual function implementation returns an empty configuration block whose name is set to
this->type_name
.- Return
vital::config_block
containing the configuration for this algorithm and any nested components.
-
void
set_configuration
(vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
- Exceptions
no_such_configuration_value_exception
: Thrown if an expected configuration value is not present.algorithm_configuration_exception
: Thrown when the algorithm is given an invalidvital::config_block
or is’ otherwise unable to configure itself.
- Parameters
config
: Thevital::config_block
instance containing the configuration parameters for this algorithm
-
bool
check_configuration
(vital::config_block_sptr config) const¶ Check that the algorithm’s currently configuration is valid.
This checks solely within the provided
vital::config_block
and not against the current state of the instance. This isn’t static for inheritence reasons.- Return
- true if the configuration check passed and false if it didn’t.
- Parameters
config
: The config block to check configuration of.
-
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¶ Perform loop closure operation.
- Return
- an updated set of feature tracks after the stitching operation
- Parameters
frame_number
: the frame number of the current frameinput
: the input feature track set to stitchimage
: image data for the current framemask
: Optional mask image where positive values indicate regions to consider in the input image.
-
class
priv
¶ Private implementation class.
Public Members
-
bool
enabled_
¶ Is long term loop closure enabled?
-
unsigned
max_checkpoint_frames_
¶ Maximum past search distance in terms of number of checkpoints.
-
double
checkpoint_percent_overlap_
¶ Term which controls when we make new loop closure checkpoints.
-
std::string
homography_filename_
¶ Output filename for homographies.
-
checkpoint_buffer_t
buffer_
¶ Buffer storing past homographies for checkpoint frames.
-
vital::algo::compute_ref_homography_sptr
ref_computer_
¶ Reference frame homography computer.
-
vital::algo::match_features_sptr
matcher_
¶ The feature matching algorithm to use.
-
bool
-
Compute Homography Overlap¶
-
KWIVER_ALGO_VXL_EXPORT double kwiver::arrows::vxl::overlap(const vnl_double_3x3 & h, const unsigned ni, const unsigned nj)
Return the overlap between two images.
This function assumes that a homography perfectly describes the transformation between these 2 images (in some reference coordinate system). The overlap is returned as a percentage.
Estimate Canonical Transform Algorithm¶
-
class
estimate_canonical_transform
: public kwiver::vital::algorithm_impl<estimate_canonical_transform, 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 first fits a “ground” plane to the landmark points using robust estimation methods provided by the rrel library in VXL. It then estimates the remaining degrees of freedom using PCA much like the implementation in the core plugin. The scale is set to normalize the landmarks to unit standard deviation.
Public Functions
-
estimate_canonical_transform
()¶ Constructor.
-
~estimate_canonical_transform
()¶ Destructor.
-
vital::config_block_sptr
get_configuration
() const¶ Get this algorithm’s configuration block .
-
void
set_configuration
(vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
-
bool
check_configuration
(vital::config_block_sptr config) const¶ Check that the algorithm’s configuration config_block is valid.
-
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.
- Return
- An estimated similarity transform mapping the data to the canonical space.
- Note
- This algorithm does not apply the transformation, it only estimates it.
- Parameters
cameras
: The camera map containing all the cameraslandmarks
: The landmark map containing all the 3D landmarks
- Exceptions
algorithm_exception
: When the data is insufficient or degenerate.
-
Estimate Essential Matrix Algorithm¶
-
class
estimate_essential_matrix
: public kwiver::vital::algorithm_impl<estimate_essential_matrix, vital::algo::estimate_essential_matrix>¶ A class that uses 5 pt algorithm to estimate an initial xform between 2 pt sets.
Public Functions
-
estimate_essential_matrix
()¶ Constructor.
-
~estimate_essential_matrix
()¶ Destructor.
-
vital::config_block_sptr
get_configuration
() const¶ Get this algorithm’s configuration block .
-
void
set_configuration
(vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
-
bool
check_configuration
(vital::config_block_sptr config) const¶ Check that the algorithm’s currently configuration is valid.
-
virtual vital::essential_matrix_sptr
estimate
(const std::vector<vital::vector_2d> &pts1, const std::vector<vital::vector_2d> &pts2, const vital::camera_intrinsics_sptr cal1, const vital::camera_intrinsics_sptr cal2, std::vector<bool> &inliers, double inlier_scale = 1.0) const¶ Estimate an essential matrix from corresponding points.
- Parameters
pts1
: the vector or corresponding points from the first imagepts2
: the vector of corresponding points from the second imagecal1
: the intrinsic parameters of the first cameracal2
: the intrinsic parameters of the second camerainliers
: for each point pa:wir, the value is true if this pair is an inlier to the estimateinlier_scale
: error distance tolerated for matches to be inliers
-
Estimate Fundamental Matrix Algorithm¶
-
class
estimate_fundamental_matrix
: public kwiver::vital::algorithm_impl<estimate_fundamental_matrix, vital::algo::estimate_fundamental_matrix>¶ A class that uses 5 pt algorithm to estimate an initial xform between 2 pt sets.
Public Functions
-
estimate_fundamental_matrix
()¶ Constructor.
-
~estimate_fundamental_matrix
()¶ Destructor.
-
vital::config_block_sptr
get_configuration
() const¶ Get this algorithm’s configuration block .
-
void
set_configuration
(vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
-
bool
check_configuration
(vital::config_block_sptr config) const¶ Check that the algorithm’s currently configuration is valid.
Check that the algorithm’s current configuration is valid.
-
virtual vital::fundamental_matrix_sptr
estimate
(const std::vector<vital::vector_2d> &pts1, const std::vector<vital::vector_2d> &pts2, std::vector<bool> &inliers, double inlier_scale = 1.0) const¶ Estimate an fundamental matrix from corresponding points.
- Parameters
pts1
: the vector or corresponding points from the first imagepts2
: the vector of corresponding points from the second imageinliers
: for each point pair, the value is true if this pair is an inlier to the estimateinlier_scale
: error distance tolerated for matches to be inliers
Public Static Functions
-
static void
mark_inliers
(vital::fundamental_matrix_sptr const &fm, std::vector<vital::vector_2d> const &pts1, std::vector<vital::vector_2d> const &pts2, std::vector<bool> &inliers, double inlier_scale = 1.0)¶ Test corresponding points against a fundamental matrix and mark inliers.
- Parameters
fm
: the fundamental matrixpts1
: the vector or corresponding points from the first imagepts2
: the vector of corresponding points from the second imageinliers
: for each point pair, the value is true if this pair is an inlier to the estimateinlier_scale
: error distance tolerated for matches to be inliers
-
Estimate Homography Algorithm¶
-
class
estimate_homography
: public kwiver::vital::algorithm_impl<estimate_homography, vital::algo::estimate_homography>¶ A class that uses RREL in VXL to estimate a homography from matching 2D points.
Public Functions
-
virtual vital::homography_sptr
estimate
(const std::vector<vital::vector_2d> &pts1, const std::vector<vital::vector_2d> &pts2, std::vector<bool> &inliers, double inlier_scale = 1.0) const¶ Estimate a homography matrix from corresponding points.
If estimation fails, a NULL-containing sptr is returned
- Parameters
pts1
: the vector or corresponding points from the source imagepts2
: the vector of corresponding points from the destination imageinliers
: for each point pair, the value is true if this pair is an inlier to the homography estimateinlier_scale
: error distance tolerated for matches to be inliers
-
virtual vital::homography_sptr
Estimate Similarity Transform Algorithm¶
-
class
estimate_similarity_transform
: public kwiver::vital::algorithm_impl<estimate_similarity_transform, vital::algo::estimate_similarity_transform>¶ VXL implementation of similarity transform estimation.
Public Functions
-
virtual vital::similarity_d
estimate_transform
(std::vector<vital::vector_3d> const &from, std::vector<vital::vector_3d> const &to) const¶ Estimate the similarity transform between two corresponding point sets.
- Return
- An estimated similarity transform mapping 3D points in the
from
space to points in theto
space (i.e. transformsfrom
intoto
). - Parameters
from
: List of length N of 3D points in the from space.to
: List of length N of 3D points in the to space.
- Exceptions
algorithm_exception
: When the from and to points sets are misaligned, insufficient or degenerate.
-
virtual vital::similarity_d
Image Container Class¶
-
class
image_container
: public kwiver::vital::image_container¶ This image container wraps a vil_image_view.
This class represents an image using vil_image_view format to store the image data by extending the basic image_container.
Public Functions
-
image_container
(const vil_image_view_base &d)¶ Constructor - from a vil_image_view_base.
-
image_container
(const vil_image_view_base_sptr d)¶ Constructor - from a vil_image_view_base_sptr.
-
image_container
(const vital::image_container &image_cont)¶ Constructor - convert base image container to vil.
-
image_container
(const arrows::vxl::image_container &other)¶ Copy Constructor.
-
size_t
size
() const¶ The size of the image data in bytes.
This size includes all allocated image memory, which could be larger than width*height*depth.
-
virtual size_t
width
() const¶ The width of the image in pixels.
-
virtual size_t
height
() const¶ The height of the image in pixels.
-
virtual size_t
depth
() const¶ The depth (or number of channels) of the image.
-
vil_image_view_base_sptr
get_vil_image_view
() const¶ Get image data in this container.
-
Image I/O Algorithm¶
-
class
image_io
: public kwiver::vital::algorithm_impl<image_io, vital::algo::image_io>¶ A class for using VXL to read and write images.
Public Functions
-
image_io
()¶ Constructor.
-
~image_io
()¶ Destructor.
-
vital::config_block_sptr
get_configuration
() const¶ Get this algorithm’s configuration block .
-
void
set_configuration
(vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
-
bool
check_configuration
(vital::config_block_sptr config) const¶ Check that the algorithm’s currently configuration is valid.
-
Match Features Constrained Algorithm¶
-
class
match_features_constrained
: public kwiver::vital::algorithm_impl<match_features_constrained, vital::algo::match_features>¶ A match_feature algorithm that uses feature position, orientation, and scale constraints.
This matching algorithm assumes that the features to be matched are already somewhat well aligned geometrically. The use cases are very similar images (e.g. adjacent frames of video) and features that have been transformed into approximate alignment by a pre-processing step (e.g. image registration)
This algorithm first reduces the search space for each feature using a search radius in the space of location (and optionally orientation and scale) to find only geometrically nearby features. It then looks at the descriptors for the neighbors and finds the best match by appearance.
Public Functions
-
match_features_constrained
()¶ Constructor.
-
~match_features_constrained
()¶ Destructor.
-
vital::config_block_sptr
get_configuration
() const¶ Get this algorithm’s configuration block .
-
void
set_configuration
(vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
-
bool
check_configuration
(vital::config_block_sptr config) const¶ Check that the algorithm’s configuration vital::config_block is valid.
-
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.
- Return
- a set of matching indices from feat1 to feat2
- Parameters
feat1
: the first set of features to matchdesc1
: the descriptors corresponding to feat1feat2
: the second set fof features to matchdesc2
: the descriptors corresponding to feat2
-
Optimize Cameras Algorithm¶
-
class
optimize_cameras
: public kwiver::vital::algorithm_impl<optimize_cameras, vital::algo::optimize_cameras>¶ Public Functions
-
void
optimize
(kwiver::vital::camera_perspective_sptr &camera, const std::vector<vital::feature_sptr> &features, const std::vector<vital::landmark_sptr> &landmarks, kwiver::vital::metadata_vector metadata = kwiver::vital::metadata_vector()) const¶ Optimize a single camera given corresponding features and landmarks.
This function assumes that 2D features viewed by this camera have already been put into correspondence with 3D landmarks by aligning them into two parallel vectors
- Parameters
camera
: The camera to optimize.features
: The vector of features observed bycamera
to use as constraints.landmarks
: The vector of landmarks corresponding tofeatures
.metadata
: The optional metadata to constrain the optimization.
-
void
Vital to VXL Algorithm¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “kwiver::arrows::vxl::vital_to_vxl” with arguments () in doxygen xml output for project “kwiver” from directory: ./_build/xml. Potential matches:
- KWIVER_ALGO_VXL_EXPORT std::shared_ptr< vgl_polygon< double > > kwiver::arrows::vxl::vital_to_vxl(kwiver::vital::polygon_sptr)
- vil_memory_chunk_sptr kwiver::arrows::vxl::vital_to_vxl(const vital::image_memory_sptr)
VXL to Vital Algorithm¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “kwiver::arrows::vxl::vxl_to_vital” with arguments () in doxygen xml output for project “kwiver” from directory: ./_build/xml. Potential matches:
- KWIVER_ALGO_VXL_EXPORT kwiver::vital::polygon_sptr kwiver::arrows::vxl::vxl_to_vital(const vgl_polygon< double > &)
- vital::image_memory_sptr kwiver::arrows::vxl::vxl_to_vital(const vil_memory_chunk_sptr)
Split Image Algorithm¶
-
class
split_image
: public kwiver::vital::algorithm_impl<split_image, vital::algo::split_image>¶ A class for drawing various information about feature tracks.
Public Functions
-
split_image
()¶ Constructor.
-
~split_image
()¶ Destructor.
-
virtual void
set_configuration
(kwiver::vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
This method is called to pass a configuration to the algorithm. The implementation of this method should be light-weight and only save the necessary config values. Defer any substantial processing in another method.
- Exceptions
no_such_configuration_value_exception
: Thrown if an expected configuration value is not present.algorithm_configuration_exception
: Thrown when the algorithm is given an invalidconfig_block
or is otherwise unable to configure itself.
- Parameters
config
: Theconfig_block
instance containing the configuration parameters for this algorithm
-
virtual bool
check_configuration
(kwiver::vital::config_block_sptr config) const¶ Check that the algorithm’s configuration config_block is valid.
This checks solely within the provided
config_block
and not against the current state of the instance. This isn’t static for inheritance reasons.- Return
- true if the configuration check passed and false if it didn’t.
- Parameters
config
: The config block to check configuration of.
-
std::vector<kwiver::vital::image_container_sptr>
split
(kwiver::vital::image_container_sptr img) const¶ Split image.
-
Triangulate Landmarks Algorithm¶
-
class
triangulate_landmarks
: public kwiver::vital::algorithm_impl<triangulate_landmarks, vital::algo::triangulate_landmarks>¶ A class for triangulating landmarks from feature tracks and cameras using VXL.
Public Functions
-
triangulate_landmarks
()¶ Constructor.
-
~triangulate_landmarks
()¶ Destructor.
-
vital::config_block_sptr
get_configuration
() const¶ Get this algorithm’s configuration block .
-
void
set_configuration
(vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
-
bool
check_configuration
(vital::config_block_sptr config) const¶ Check that the algorithm’s currently configuration is valid.
-
void
triangulate
(vital::camera_map_sptr cameras, vital::feature_track_set_sptr tracks, vital::landmark_map_sptr &landmarks) const¶ Triangulate the landmark locations given sets of cameras and feature tracks.
This function only triangulates the landmarks with indicies in the landmark map and which have support in the tracks and cameras
- Parameters
cameras
: the cameras viewing the landmarkstracks
: the feature tracks to use as constraintslandmarks
: the landmarks to triangulate
-
FFMPEG Video Input Algorithm¶
-
class
vidl_ffmpeg_video_input
: public kwiver::vital::algorithm_impl<vidl_ffmpeg_video_input, vital::algo::video_input>¶ Video input using VXL vidl ffmpeg services.
This class implements a video input algorithm using the VXL vidl ffmpeg video services.
Public Functions
-
vidl_ffmpeg_video_input
()¶ Constructor.
-
vital::config_block_sptr
get_configuration
() const¶ Get this algorithm’s configuration block .
-
void
set_configuration
(vital::config_block_sptr config)¶ Set this algorithm’s properties via a config block.
-
bool
check_configuration
(vital::config_block_sptr config) const¶ Check that the algorithm’s currently configuration is valid.
-
void
open
(std::string video_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.
- Exceptions
exception
: if open failed
-
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.
-
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.
- Return
- true if at end of video, false otherwise.
-
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()
.- Return
- true if video stream is good, false if not good.
-
bool
seekable
() const¶ Return whether video stream is seekable.
This method returns whether the video stream is seekable.
- Return
- true if video stream is seekable, false otherwise.
-
size_t
num_frames
() const¶ Get the number of frames in the video stream.
Get the number of frames available in the video stream.
- Return
- the number of frames in the video stream, or 0 if the video stream is not seekable.
- Exceptions
video_stream_exception
: when there is an error in the video stream.
-
bool
next_frame
(kwiver::vital::timestamp &ts, uint32_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.
- Return
- true if frame returned, false if end of video.
- Parameters
ts
: Time stamp of new frame.timeout
: Number of seconds to wait. 0 = no timeout.
- Exceptions
video_input_timeout_exception
: when the timeout expires.video_stream_exception
: when there is an error in the video stream.
-
bool
seek_frame
(kwiver::vital::timestamp &ts, kwiver::vital::timestamp::frame_t frame_number, uint32_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.
- Return
- true if frame returned, false if end of video.
- Parameters
ts
: Time stamp of new frame.frame_number
: The frame to seek to.timeout
: Number of seconds to wait. 0 = no timeout.
- Exceptions
video_input_timeout_exception
: when the timeout expires.video_stream_exception
: when there is an error in the video stream.
-
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.
- Return
- The time stamp of the current frame.
-
double
frame_rate
()¶ Get frame rate from the video.
If frame rate is not supported, return -1.
- Return
- Frame rate.
-
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.
- Return
- Pointer to image container.
- Exceptions
video_stream_exception
: when there is an error in the video stream.
-
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.
This method is idempotent. Calling it multiple times without calling next_frame() will return the same metadata.
- Return
- Vector of metadata pointers.
- Exceptions
video_stream_exception
: when there is an error in the video stream.
-
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.
- Return
- Map of vectors of metadata pointers.
- Exceptions
video_stream_exception
: when there is an error in the video stream.
-
class
priv
¶ Public Functions
-
priv
()¶ Constructor.
Public Members
-
bool
c_use_metadata
¶ If this is set then we ignore any metadata included in the video stream.
-
size_t
d_num_frames
¶ This holds the number of frames in the video. If it is set to -2 it means this number still needs to be calculated.
-
vital::metadata_map::map_metadata_t
d_metadata_map
¶ Storage for the metadata map.
-
bool
d_have_frame_time
¶ This is set to indicate that we can supply a frame time of some form. If this is false, the output timestamp will not have a time set. This also is used to report the HAS_FRAME_TIME capability.
-
bool
d_have_abs_frame_time
¶ This is set to indicate that we can supply an absolute frame time rather than a relative frame time. This value is used to report the HAS_ABSOLUTE_FRAME_TIME capability.
-
bool
d_have_metadata
¶ This is set to indicate we can supply video metadata and is used to report the HAS_METADATA capability.
-
bool
d_is_seekable
¶ This is set to indicate the video stream is seekable by frame and is used to report the IS_SEEKABLE capability.
-
bool
d_have_loop_vars
¶ This is set to indicate that any variables that require a pass through the video like the number of frames or the metadata map have already been determined.
-
-
Image Memory Class¶
-
class
vil_image_memory
: public kwiver::vital::image_memory¶ An image memory class that shares memory with VXL using vil_memory_chunk.
Image Memory Chunk Class¶
Warning
doxygenclass: Cannot find class “kwiver::arrows::vxl::vil_image_memory_chunk” in doxygen xml output for project “kwiver” from directory: ./_build/xml