DFX Extraction library v4.14.5
enabling applications to perform DFX blood flow analysis
Public Types | Public Attributes | List of all members
dfx::VideoFrame Struct Reference

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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ ChannelOrder

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.

Enumerator
BGR 

channels are provided in blue, green, red order

RGB 

channels are provided in red, green, blue order

BGRA 

channels are provided in blue, green, red, alpha order

RGBA 

channels are provided in red, green, blue, alpha order

Infrared 

channels are provided as 8-bit infrared

Infrared888 

channels are provided as 3-channels of 8-bit infrared

BGR_Infrared 

channels are provided in blue, green, red, infrared order

RGB_Infrared 

channels are provided in red, green, blue, infrared order

Gray 

channels are provided as gray scale

Member Data Documentation

◆ image

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.

◆ number

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.

◆ order

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.

◆ timestamp_millisec

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.

Since
4.7
See also
https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp

◆ timestamp_ns

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.

Deprecated:
this will be removed in favor of timestamp_millisec

The documentation for this struct was generated from the following file: