VideoFileImageProvider.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2017, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package ArmarX
19  * @author Mirko Waechter( mirko.waechter at kit dot edu)
20  * @date 2017
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
27 #include <VisionX/interface/components/Calibration.h>
28 #include <opencv2/highgui/highgui.hpp>
29 
30 
31 namespace visionx
32 {
34  {
35  public:
37  {
38  defineRequiredProperty<std::string>("VideoFilePath", "Path to the video file that should be streamed");
39  defineOptionalProperty<bool>("LoopVideo", true, "If true, the video file will be played in a loop");
40  }
41  };
42 
43 
45  // public MonocularCalibrationCapturingProviderInterface,
47  {
48  public:
50 
51  // ManagedIceObject interface
52  protected:
53  std::string getDefaultName() const override;
54 
55  // CapturingImageProviderInterface interface
56  public:
57  // CapturingImageProvider interface
58  protected:
59  void onInitCapturingImageProvider() override;
60  void onExitCapturingImageProvider() override;
61  bool capture(void** ppImageBuffers) override;
62 
63  bool openVideo();
64  cv::VideoCapture capturer;
65  cv::Mat image;
66 
67  // CapturingImageProvider interface
68  protected:
69  void onStartCapture(float framesPerSecond) override;
70  void onStopCapture() override;
71 
72  // PropertyUser interface
73  public:
75 
76  // MonocularCalibrationCapturingProviderInterface interface
77  public:
78  MonocularCalibration getCalibration(const Ice::Current&);
79  protected:
80  MonocularCalibration calibration;
81  };
82 
83 } // namespace visionx
84 
85 
visionx::VideoFileImageProvider::onExitCapturingImageProvider
void onExitCapturingImageProvider() override
This is called when the Component::onExitComponent() setup is called.
Definition: VideoFileImageProvider.cpp:62
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::VideoFileImageProvider::onInitCapturingImageProvider
void onInitCapturingImageProvider() override
This is called when the Component::onInitComponent() is called.
Definition: VideoFileImageProvider.cpp:47
visionx::VideoFileImageProvider
Definition: VideoFileImageProvider.h:44
visionx::VideoFileImageProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: VideoFileImageProvider.cpp:121
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
visionx::VideoFileImageProvider::openVideo
bool openVideo()
Definition: VideoFileImageProvider.cpp:99
visionx::VideoFileImageProvider::VideoFileImageProvider
VideoFileImageProvider()
Definition: VideoFileImageProvider.cpp:32
visionx::VideoFileImageProviderPropertyDefinitions
Definition: VideoFileImageProvider.h:33
visionx::VideoFileImageProvider::getCalibration
MonocularCalibration getCalibration(const Ice::Current &)
Definition: VideoFileImageProvider.cpp:127
visionx::VideoFileImageProvider::capturer
cv::VideoCapture capturer
Definition: VideoFileImageProvider.h:64
visionx::VideoFileImageProviderPropertyDefinitions::VideoFileImageProviderPropertyDefinitions
VideoFileImageProviderPropertyDefinitions(std::string prefix)
Definition: VideoFileImageProvider.h:36
visionx::VideoFileImageProvider::onStartCapture
void onStartCapture(float framesPerSecond) override
This is called when the image provider capturing has been started.
Definition: VideoFileImageProvider.cpp:109
visionx::CapturingImageProvider::capture
virtual void capture()
Definition: CapturingImageProvider.cpp:106
visionx::CapturingImageProvider
The CapturingImageProvider provides a callback function to trigger the capturing of images with diffe...
Definition: CapturingImageProvider.h:52
visionx::VideoFileImageProvider::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: VideoFileImageProvider.cpp:40
CapturingImageProvider.h
visionx::VideoFileImageProvider::image
cv::Mat image
Definition: VideoFileImageProvider.h:65
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::ComponentPropertyDefinitions::ComponentPropertyDefinitions
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition: Component.cpp:37
visionx::VideoFileImageProvider::calibration
MonocularCalibration calibration
Definition: VideoFileImageProvider.h:80
visionx::VideoFileImageProvider::onStopCapture
void onStopCapture() override
This is called when the image provider capturing has been stopped.
Definition: VideoFileImageProvider.cpp:116