added fetch as a counter-part to feed to V4D

pull/3471/head
kallaballa 2 years ago
parent aa2a1660f7
commit ca9722c66a
  1. 6
      modules/v4d/include/opencv2/v4d/v4d.hpp
  2. 9
      modules/v4d/src/v4d.cpp

@ -193,6 +193,12 @@ public:
* Called to feed an image directly to the framebuffer
*/
CV_EXPORTS void feed(cv::InputArray& in);
/*!
* Fetches a copy of frambuffer
* @return a copy of the framebuffer
*/
CV_EXPORTS InputOutputArray fetch();
/*!
* Called to capture to the framebuffer from a #cv::viz::Source object provided via #V4D::setSource().
* @return true if successful.

@ -205,6 +205,15 @@ void V4D::feed(cv::InputArray& in) {
});
}
InputOutputArray V4D::fetch() {
cv::UMat frame;
fb([frame](cv::UMat& framebuffer){
framebuffer.copyTo(frame);
});
return frame;
}
bool V4D::capture() {
return this->capture([&](cv::UMat& videoFrame) {
if (source_.isReady())

Loading…
Cancel
Save