This class represents video frame - object for working with RegionOfInterest and Tensor objects which belong to this video frame (image). RegionOfInterest describes detected object (bounding boxes) and its Tensor objects (inference results on RegionOfInterest level). Tensor describes inference results on VideoFrame level. VideoFrame also provides access to underlying GstBuffer and GstVideoInfo describing frame's video information (such as image width, height, channels, strides, etc.). You also can get cv::Mat object representing this video frame.
More...
#include <video_frame.h>
|
| VideoFrame (GstBuffer *buffer, GstVideoInfo *info) |
| Construct VideoFrame instance from GstBuffer and GstVideoInfo. This is preferred way of creating VideoFrame. More...
|
|
| VideoFrame (GstBuffer *buffer, const GstCaps *caps) |
| Construct VideoFrame instance from GstBuffer and GstCaps. More...
|
|
| VideoFrame (GstBuffer *buffer) |
| Construct VideoFrame instance from GstBuffer. Video information will be obtained from buffer. This is not recommended way of creating VideoFrame, because it relies on GstVideoMeta which can be absent for the buffer. More...
|
|
GstVideoMeta * | video_meta () |
| Get video metadata of buffer. More...
|
|
GstVideoInfo * | video_info () |
| Get GstVideoInfo of this VideoFrame. This is preferrable way of getting any image information. More...
|
|
std::vector< RegionOfInterest > | regions () |
| Get RegionOfInterest objects attached to VideoFrame. More...
|
|
const std::vector< RegionOfInterest > | regions () const |
| Get RegionOfInterest objects attached to VideoFrame. More...
|
|
std::vector< Tensor > | tensors () |
| Get Tensor objects attached to VideoFrame. More...
|
|
const std::vector< Tensor > | tensors () const |
| Get Tensor objects attached to VideoFrame. More...
|
|
std::vector< std::string > | messages () |
| Get messages attached to this VideoFrame. More...
|
|
RegionOfInterest | add_region (double x, double y, double w, double h, std::string label=std::string(), double confidence=0.0, bool normalized=false) |
| Attach RegionOfInterest to this VideoFrame. This function takes ownership of region_tensor, if passed. More...
|
|
Tensor | add_tensor () |
| Attach empty Tensor to this VideoFrame. More...
|
|
void | add_message (const std::string &message) |
| Attach message to this VideoFrame. More...
|
|
void | remove_region (const RegionOfInterest &roi) |
| Remove RegionOfInterest. More...
|
|
void | remove_tensor (const Tensor &tensor) |
| Remove Tensor. More...
|
|
|
GstBuffer * | buffer |
| GstBuffer with inference results metadata attached (Gstreamer pipeline's GstBuffer, which is output of GVA inference elements, such as gvadetect, gvainference, gvaclassify)
|
|
std::unique_ptr< GstVideoInfo, std::function< void(GstVideoInfo *)> > | info |
| GstVideoInfo containing actual video information for this VideoFrame.
|
|
This class represents video frame - object for working with RegionOfInterest and Tensor objects which belong to this video frame (image). RegionOfInterest describes detected object (bounding boxes) and its Tensor objects (inference results on RegionOfInterest level). Tensor describes inference results on VideoFrame level. VideoFrame also provides access to underlying GstBuffer and GstVideoInfo describing frame's video information (such as image width, height, channels, strides, etc.). You also can get cv::Mat object representing this video frame.
◆ VideoFrame() [1/3]
GVA::VideoFrame::VideoFrame |
( |
GstBuffer * |
buffer, |
|
|
GstVideoInfo * |
info |
|
) |
| |
|
inline |
Construct VideoFrame instance from GstBuffer and GstVideoInfo. This is preferred way of creating VideoFrame.
- Parameters
-
buffer | GstBuffer* to which metadata is attached and retrieved |
info | GstVideoInfo* containing video information |
◆ VideoFrame() [2/3]
GVA::VideoFrame::VideoFrame |
( |
GstBuffer * |
buffer, |
|
|
const GstCaps * |
caps |
|
) |
| |
|
inline |
Construct VideoFrame instance from GstBuffer and GstCaps.
- Parameters
-
buffer | GstBuffer* to which metadata is attached and retrieved |
caps | GstCaps* from which video information is obtained |
◆ VideoFrame() [3/3]
GVA::VideoFrame::VideoFrame |
( |
GstBuffer * |
buffer | ) |
|
|
inline |
Construct VideoFrame instance from GstBuffer. Video information will be obtained from buffer. This is not recommended way of creating VideoFrame, because it relies on GstVideoMeta which can be absent for the buffer.
- Parameters
-
buffer | GstBuffer* to which metadata is attached and retrieved |
◆ add_message()
void GVA::VideoFrame::add_message |
( |
const std::string & |
message | ) |
|
|
inline |
◆ add_region()
RegionOfInterest GVA::VideoFrame::add_region |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
w, |
|
|
double |
h, |
|
|
std::string |
label = std::string() , |
|
|
double |
confidence = 0.0 , |
|
|
bool |
normalized = false |
|
) |
| |
|
inline |
Attach RegionOfInterest to this VideoFrame. This function takes ownership of region_tensor, if passed.
- Parameters
-
x | x coordinate of the upper left corner of bounding box |
y | y coordinate of the upper left corner of bounding box |
w | width of the bounding box |
h | height of the bounding box |
label | object label |
confidence | detection confidence |
normalized | if False, bounding box coordinates are pixel coordinates in range from 0 to image width/height. if True, bounding box coordinates normalized to [0,1] range. |
- Returns
- new RegionOfInterest instance
◆ add_tensor()
Tensor GVA::VideoFrame::add_tensor |
( |
| ) |
|
|
inline |
◆ messages()
std::vector<std::string> GVA::VideoFrame::messages |
( |
| ) |
|
|
inline |
◆ regions() [1/2]
◆ regions() [2/2]
◆ remove_region()
◆ remove_tensor()
void GVA::VideoFrame::remove_tensor |
( |
const Tensor & |
tensor | ) |
|
|
inline |
◆ tensors() [1/2]
std::vector<Tensor> GVA::VideoFrame::tensors |
( |
| ) |
|
|
inline |
◆ tensors() [2/2]
const std::vector<Tensor> GVA::VideoFrame::tensors |
( |
| ) |
const |
|
inline |
◆ video_info()
GstVideoInfo* GVA::VideoFrame::video_info |
( |
| ) |
|
|
inline |
Get GstVideoInfo of this VideoFrame. This is preferrable way of getting any image information.
- Returns
- GstVideoInfo of this VideoFrame
◆ video_meta()
GstVideoMeta* GVA::VideoFrame::video_meta |
( |
| ) |
|
|
inline |
Get video metadata of buffer.
- Returns
- GstVideoMeta of buffer, nullptr if no GstVideoMeta available
The documentation for this class was generated from the following file: