AI Watch A1
Multi-person 3D skeleton detection using Intel RealSense and OpenPose with Kafka support.
|
OpenCV_Manager class is used for general-purpose tasks on the captured frames. More...
#include <OpenCV_Manager.hpp>
Public Member Functions | |
virtual | ~OpenCV_Manager ()=default |
Destroy the OpenCV_Manager object. More... | |
cv::Mat | realsenseFrameToMat (const rs2::frame &singleFrame) |
This method converts a frame of type rs2::frame to cv::Mat. More... | |
void | getVideoFramesCV (unsigned int user_nFrame, rs2::pipeline &pipelineStream, float scale, const unsigned short int framesToSkip) |
Get user_nFrame video frames from the pipeline by applying a specific scaling factor. More... | |
void | showSkeletonsCV (unsigned int user_nFrame, const float skeletonThreshold) |
Retrieve OpenPose's output, convert it to RealSense coordinate's space, show results and save them. More... | |
OpenCV_Manager class is used for general-purpose tasks on the captured frames.
OpenCV_Manager class is a class that is responsible for converting a rs2::frame to a cv::Mat, retrieving video frames from the camera and handling them, showing the skeletons, producing related output, and saving results.
Definition at line 23 of file OpenCV_Manager.hpp.
|
virtualdefault |
Destroy the OpenCV_Manager object.
void OpenCV_Manager::getVideoFramesCV | ( | unsigned int | user_nFrame, |
rs2::pipeline & | pipelineStream, | ||
float | scale, | ||
const unsigned short int | framesToSkip | ||
) |
Get user_nFrame video frames from the pipeline by applying a specific scaling factor.
user_nFrame | frame's number to capture according to user choice. |
pipelineStream | The pipeline simplifies the user interaction with the device and computer vision processing modules. The class abstracts the camera configuration and streaming, and the vision modules triggering and threading. It lets the application focus on the computer vision output of the modules, or the device output data. The pipeline can manage computer vision modules, which are implemented as a processing block. The pipeline is the consumer of the processing block interface, while the application consumes the computer vision interface. |
scale | Scaling factor. |
framesToSkip | Frames' number to skip in order to ignore a certain amount of frames and extend the recording interval. A '0' value means 'capture each frame'. |
Definition at line 37 of file OpenCV_Manager.cpp.
References FACADE_SINGLETON_NULLPTR_ERROR, FACADE_SINGLETON_NULLPTR_SCOPE, UsageManager::get_argv(), FacadeSingleton::getCameraManager(), RealSenseManager::getFrameID(), FacadeSingleton::getImageManager(), FacadeSingleton::getInstance(), UsageManager::getInstance(), RealSenseManager::getVideoFramesRS(), imagesFolderOffset, realsenseFrameToMat(), ImageManager::releaseImages(), ImageManager::saveImages(), USAGE_MANAGER_NULLPTR_ERROR, and USAGE_MANAGER_NULLPTR_SCOPE.
Referenced by FacadeSingleton::getVideoFrames().
cv::Mat OpenCV_Manager::realsenseFrameToMat | ( | const rs2::frame & | singleFrame | ) |
This method converts a frame of type rs2::frame to cv::Mat.
singleFrame | A frame of type rs2::frame. |
Definition at line 15 of file OpenCV_Manager.cpp.
Referenced by getVideoFramesCV().
void OpenCV_Manager::showSkeletonsCV | ( | unsigned int | user_nFrame, |
const float | skeletonThreshold | ||
) |
Retrieve OpenPose's output, convert it to RealSense coordinate's space, show results and save them.
user_nFrame | frame's number to capture according to user choice. |
skeletonThreshold | The magnitude or intensity that must be exceeded for a specific reaction, phenomenon, result, or condition to occur or be manifested. In this case, if the skeleton's confidence mean value is greater than "skeletonThreshold", then the skeleton will be considered a meaningful skeleton. |
Definition at line 74 of file OpenCV_Manager.cpp.
References OutputManagerJSON::createJSON(), FACADE_SINGLETON_NULLPTR_ERROR, FACADE_SINGLETON_NULLPTR_SCOPE, UsageManager::get_argv(), FacadeSingleton::getCameraManager(), RealSenseManager::getFrameID(), FacadeSingleton::getImageManager(), FacadeSingleton::getInstance(), FacadeSingleton::getOutputManager(), FacadeSingleton::getUsageManager(), OutputManagerJSON::getValueAt(), imagesFolderOffset, ImageManager::loadImage(), OutputManagerJSON::loadJSON(), outputFolderOffset, ImageManager::releaseImages(), ImageManager::saveImages(), ImageManager::showImages(), USAGE_MANAGER_NULLPTR_ERROR, and USAGE_MANAGER_NULLPTR_SCOPE.
Referenced by FacadeSingleton::showSkeletons().