25 #include <opencv2/imgproc/imgproc.hpp>
27 #include <Calibration/Calibration.h>
42 return "VideoFileImageProvider";
49 ARMARX_INFO <<
"Opening video file " << getProperty<std::string>(
"VideoFilePath").getValue();
53 throw armarx::LocalException(
"Failed to open Videofile ") << getProperty<std::string>(
"VideoFilePath").getValue();
56 this->frameRate = capturer.get(cv::CAP_PROP_FPS);
57 ARMARX_INFO <<
"Video Size: " << capturer.get(cv::CAP_PROP_FRAME_WIDTH) <<
"x" << capturer.get(cv::CAP_PROP_FRAME_HEIGHT);
58 setImageFormat(ImageDimension(capturer.get(cv::CAP_PROP_FRAME_WIDTH), capturer.get(cv::CAP_PROP_FRAME_HEIGHT)), visionx::eRgb, visionx::eBayerPatternGr);
59 setImageSyncMode(visionx::eFpsSynchronization);
71 auto result = capturer.read(image);
72 if (!result && capturer.isOpened() && getProperty<bool>(
"LoopVideo").getValue())
76 result = capturer.read(image);
79 if (result && sharedMemoryProvider)
81 Ice::Byte* pixels =
static_cast<Ice::Byte*
>(image.data);
84 cv::cvtColor(image, image, cv::COLOR_RGB2BGR);
90 memcpy(ppImageBuffers[0], pixels, image.cols * image.rows * image.channels());
101 auto result = capturer.open(getProperty<std::string>(
"VideoFilePath").getValue());