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
26#include <opencv2/highgui/highgui.hpp>
27
29#include <VisionX/interface/components/Calibration.h>
30
31namespace visionx
32{
34 {
35 public:
38 {
40 "Path to the video file that should be streamed");
42 "LoopVideo", true, "If true, the video file will be played in a loop");
43 }
44 };
45
47 // public MonocularCalibrationCapturingProviderInterface,
49 {
50 public:
52
53 static std::string GetDefaultName();
54 // ManagedIceObject interface
55 protected:
56 std::string getDefaultName() const override;
57
58 // CapturingImageProviderInterface interface
59 public:
60 // CapturingImageProvider interface
61 protected:
62 void onInitCapturingImageProvider() override;
63 void onExitCapturingImageProvider() override;
64 bool capture(void** ppImageBuffers) override;
65
66 bool openVideo();
67 cv::VideoCapture capturer;
68 cv::Mat image;
69
70 // CapturingImageProvider interface
71 protected:
72 void onStartCapture(float framesPerSecond) override;
73 void onStopCapture() override;
74
75 // PropertyUser interface
76 public:
78
79 // MonocularCalibrationCapturingProviderInterface interface
80 public:
81 MonocularCalibration getCalibration(const Ice::Current&);
82
83 protected:
84 MonocularCalibration calibration;
85 };
86
87} // namespace visionx
Default component property definition container.
Definition Component.h:70
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
PropertyDefinition< PropertyType > & defineRequiredProperty(const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
The CapturingImageProvider provides a callback function to trigger the capturing of images with diffe...
MonocularCalibration getCalibration(const Ice::Current &)
void onStartCapture(float framesPerSecond) override
This is called when the image provider capturing has been started.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onStopCapture() override
This is called when the image provider capturing has been stopped.
void onExitCapturingImageProvider() override
This is called when the Component::onExitComponent() setup is called.
void onInitCapturingImageProvider() override
This is called when the Component::onInitComponent() is called.
std::string getDefaultName() const override
Retrieve default name of component.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
ArmarX headers.