visionx::imrec Namespace Reference

Namespaces

namespace  strats
 

Classes

class  AbstractPlaybackStrategy
 
class  AbstractRecordingStrategy
 Abstract interface of a recording strategy. More...
 
class  AbstractSequencedRecordingStrategy
 An object of this class behaves likee a normal recording, but is in fact a sequence of images. More...
 
struct  RegistryEntry
 

Typedefs

using Playback = std::shared_ptr<visionx::imrec::AbstractPlaybackStrategy>
 Convenience alias for an instance of any playback strategy.
 
using Recording = std::shared_ptr<AbstractRecordingStrategy>
 Convenience alias for any recording strategy.
 

Enumerations

enum class  Compression { lossy , lossless }
 
enum class  Format {
  bmp_img_seq , png_img_seq , png_fast_img_seq , png_mt_img_seq ,
  png_fast_mt_img_seq , jpg_img_seq , avi_default , mp4_default
}
 Supported recording Formats. More...
 
enum class  Framerate { static_fps , dynamic_fps }
 

Functions

void convert (const CByteImage &in, cv::Mat &out)
 Converts an IVT CByteImage to OpenCV's BGR Mat.
 
void convert (const cv::Mat &in, CByteImage &out)
 Converts an OpenCV BGR Mat to IVT's CByteImage.
 
void convert_rgb2cbi (const cv::Mat &in, CByteImage &out)
 Converts an OpenCV RGB Mat to IVT's CByteImage.
 
std::string datetime_to_string (std::chrono::microseconds ts)
 
const std::string & format2hrstr (const Format format)
 
const std::string & format2str (const Format format)
 
void from_json (const nlohmann::json &j, ChannelConfig &cc)
 
void from_json (const nlohmann::json &j, Config &c)
 
std::vector< Format > getFormats ()
 
std::map< Format, RegistryEntry > getFormatsMap ()
 
bool isFormatDynamicFramerate (Format format)
 
bool isFormatLossless (Format format)
 
visionx::imrec::Playback newPlayback (const std::filesystem::path &path)
 Instantiates and returns a new playback strategy which is capable of replaying the file or collection at path.
 
visionx::imrec::Recording newRecording (const std::filesystem::path &filePath, double fps)
 Creates a new recording given the file extension and additional parameters.
 
visionx::imrec::Recording newRecording (const std::filesystem::path &path, const std::string &name, const Format format, double fps)
 
Format str2format (const std::string &format_str)
 
void takeSnapshot (const CByteImage &image, const std::filesystem::path &filePath)
 Takes a snapshot using the default recording method for snapshots.
 
void takeSnapshot (const cv::Mat &image, const std::filesystem::path &filePath)
 Takes a snapshot using the default recording method for snapshots.
 
std::string timestamp_to_string (std::chrono::microseconds ts)
 
void to_json (nlohmann::json &j, const ChannelConfig &cc)
 
void to_json (nlohmann::json &j, const Config &c)
 

Typedef Documentation

◆ Playback

Convenience alias for an instance of any playback strategy.

◆ Recording

using Recording = std::shared_ptr<AbstractRecordingStrategy>

Convenience alias for any recording strategy.

Enumeration Type Documentation

◆ Compression

enum class Compression
strong
Enumerator
lossy 
lossless 

◆ Format

enum class Format
strong

Supported recording Formats.

Note
If you add new formats, also add them to the registry (declared in an anonymous namespace) in public_api.cpp.
Enumerator
bmp_img_seq 
png_img_seq 
png_fast_img_seq 
png_mt_img_seq 
png_fast_mt_img_seq 
jpg_img_seq 
avi_default 
mp4_default 

◆ Framerate

enum class Framerate
strong
Enumerator
static_fps 
dynamic_fps 

Function Documentation

◆ convert() [1/2]

void convert ( const CByteImage & in,
cv::Mat & out )

Converts an IVT CByteImage to OpenCV's BGR Mat.

Parameters
inCByteImage
outOutput parameter

◆ convert() [2/2]

void convert ( const cv::Mat & in,
CByteImage & out )

Converts an OpenCV BGR Mat to IVT's CByteImage.

Parameters
incv::Mat with BGR format
outOutput parameter

◆ convert_rgb2cbi()

void convert_rgb2cbi ( const cv::Mat & in,
CByteImage & out )

Converts an OpenCV RGB Mat to IVT's CByteImage.

Parameters
incv::Mat with RGB format
outOutput parameter

◆ datetime_to_string()

std::string datetime_to_string ( std::chrono::microseconds ts)

◆ format2hrstr()

const std::string & format2hrstr ( const Format format)

◆ format2str()

const std::string & format2str ( const Format format)

◆ from_json() [1/2]

void from_json ( const nlohmann::json & j,
ChannelConfig & cc )

◆ from_json() [2/2]

void from_json ( const nlohmann::json & j,
Config & c )

◆ getFormats()

std::vector< visionx::imrec::Format > getFormats ( )

◆ getFormatsMap()

std::map< visionx::imrec::Format, visionx::imrec::RegistryEntry > getFormatsMap ( )

◆ isFormatDynamicFramerate()

bool isFormatDynamicFramerate ( Format format)

◆ isFormatLossless()

bool isFormatLossless ( Format format)

◆ newPlayback()

visionx::imrec::Playback newPlayback ( const std::filesystem::path & path)

Instantiates and returns a new playback strategy which is capable of replaying the file or collection at path.

Parameters
pathPath to the recording file or collection (folder, glob, ...)
Returns
Concrete playback strategy capable of replaying the recording at path

◆ newRecording() [1/2]

visionx::imrec::Recording newRecording ( const std::filesystem::path & filePath,
double fps )

Creates a new recording given the file extension and additional parameters.

Parameters
filePathPath to where the recording file should be written to
fpsAmount of frames being recorded per second
Returns
Recording object

◆ newRecording() [2/2]

visionx::imrec::Recording newRecording ( const std::filesystem::path & path,
const std::string & name,
const Format format,
double fps )

◆ str2format()

visionx::imrec::Format str2format ( const std::string & format_str)

◆ takeSnapshot() [1/2]

void takeSnapshot ( const CByteImage & image,
const std::filesystem::path & filePath )

Takes a snapshot using the default recording method for snapshots.

Parameters
filePathPath to where the recording file should be written to
imageThe image to be saved

◆ takeSnapshot() [2/2]

void takeSnapshot ( const cv::Mat & image,
const std::filesystem::path & filePath )

Takes a snapshot using the default recording method for snapshots.

Parameters
filePathPath to where the recording file should be written to
imageThe image to be saved

◆ timestamp_to_string()

std::string timestamp_to_string ( std::chrono::microseconds ts)

◆ to_json() [1/2]

void to_json ( nlohmann::json & j,
const ChannelConfig & cc )

◆ to_json() [2/2]

void to_json ( nlohmann::json & j,
const Config & c )