DFX Extraction library v4.14.5
enabling applications to perform DFX blood flow analysis
|
Represents the internal structure for how image frames are passed to the DFX Engine since there is little in the way of standards. More...
#include "dfx/VideoFrame.h"
Public Types | |
enum | ChannelOrder { ChannelOrder::BGR = 1, ChannelOrder::RGB = 2, ChannelOrder::BGRA = 3, ChannelOrder::RGBA = 4, ChannelOrder::Infrared = 5, ChannelOrder::Infrared888 = 6, ChannelOrder::BGR_Infrared = 7, ChannelOrder::RGB_Infrared = 8, ChannelOrder::Gray = 9 } |
Public Attributes | |
cv::Mat | image |
the image color channels for the frame. More... | |
ChannelOrder | order |
the image channel ordering. More... | |
uint64_t | timestamp_ns |
the timestamp of this video frame. More... | |
uint32_t | number |
the video frame number within the video sequence. More... | |
double | timestamp_millisec {std::numeric_limits<double>::quiet_NaN()} |
the timestamp of the video frame in milliseconds More... | |
Represents the internal structure for how image frames are passed to the DFX Engine since there is little in the way of standards.
DFX requires having all three color channels and an accurate timestamp for the video frame along with knowing it's position within the stream.
|
strong |
is used to identify the channel order of a VideoFrame.
Typically, OpenCV uses BGRA but different client platforms have different internal representations which can be identified through the ChannelOrder format so the library knows where to find the channels of interest when processing regions of interest.
cv::Mat dfx::VideoFrame::image |
the image color channels for the frame.
OpenCV cv::Mat structure is used as a convenience when specifying the image data.
uint32_t dfx::VideoFrame::number |
the video frame number within the video sequence.
Frame numbers are expected to be sequentially provided for a measurement and the number of sequential frames must be sufficient for the study measurement requirements to be fulfilled. Since multiple measurements can be performed on a video sequence, the frame number helps identify positioning within a video and if a frame is lost.
ChannelOrder dfx::VideoFrame::order |
the image channel ordering.
The order is used to help identify the internal format of the cv::Mat structure since it internally doesn't provide a way to identified the color channels.
double dfx::VideoFrame::timestamp_millisec {std::numeric_limits<double>::quiet_NaN()} |
the timestamp of the video frame in milliseconds
When this value is provided, not NaN, it will be used and timestamp_ns will be ignored. The addition of this while keeping timestamp_ns is to allow for a brief transition period.
The value has type double to allow for fractions of a millisecond and is analogous to how the web handles DOMHighResTimeStamp.
Migrating code from timestamp_ns to timestamp_millisec can be done by converting from:
frame.timestamp_ns = getTimestamp()
to: frame.timstamp_millisec = getTimestamp()/static_cast<double>(1e6);
Accurate DFX predictions require a consistent and accurate timestamp for the video frames. This is easily achievable when processing offline videos, but will require some effort for processing real-time camera feeds to ensure the frames maintain a consistent inter-frame interval.
uint64_t dfx::VideoFrame::timestamp_ns |
the timestamp of this video frame.
Accurate DFX predictions require a consistent and accurate timestamp for the video frames. This is easily achievable when processing offline videos, but will require some effort for processing real-time camera feeds to ensure the frames maintain a consistent inter-frame interval.