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 // ManagedIceObject interface
54 protected:
55 std::string getDefaultName() const override;
56
57 // CapturingImageProviderInterface interface
58 public:
59 // CapturingImageProvider interface
60 protected:
61 void onInitCapturingImageProvider() override;
62 void onExitCapturingImageProvider() override;
63 bool capture(void** ppImageBuffers) override;
64
65 bool openVideo();
66 cv::VideoCapture capturer;
67 cv::Mat image;
68
69 // CapturingImageProvider interface
70 protected:
71 void onStartCapture(float framesPerSecond) override;
72 void onStopCapture() override;
73
74 // PropertyUser interface
75 public:
77
78 // MonocularCalibrationCapturingProviderInterface interface
79 public:
80 MonocularCalibration getCalibration(const Ice::Current&);
81
82 protected:
83 MonocularCalibration calibration;
84 };
85
86} // 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.