source: pacpussensors/trunk/Vislab/VislabComponent.cpp

Last change on this file was 147, checked in by ldecherf, 8 years ago

Ajout CameraPlayer

File size: 1.6 KB
Line 
1
2
3// Includes, project.
4#include "VislabComponent.hpp"
5#include "VislabCamera.hpp"
6
7// Includes, pacpus.
8#include <Pacpus/kernel/ComponentFactory.h>
9#include <Pacpus/kernel/Log.h>
10#include <Pacpus/kernel/DbiteFileTypes.h>
11#include <Pacpus/kernel/DbiteException.h>
12#include <lib3dv/device.h>
13//#include <20150310_lib3dv-1.2.0/src/display.h>
14
15// Includes, qt.
16#include <QDir>
17#include <QMetaType>
18
19// Includes, standard.
20#include <stdexcept>
21
22#include <boost/asio/io_service.hpp>
23#include <boost/bind.hpp>
24#include <boost/ref.hpp>
25#include <boost/thread.hpp>
26
27using namespace pacpus;
28
29// Declare the logger and register the new component.
30//DECLARE_STATIC_LOGGER("pacpus.component.vislabCamera")
31//REGISTER_COMPONENT(VislabComponent, "Camera");
32
33ComponentFactory<VislabComponent> sFactory("VislabComponent");
34
35VislabComponent::VislabComponent(QString const& name)
36 :ComponentBase(name),
37 camera(name)
38{
39
40}
41
42VislabComponent::~VislabComponent()
43{
44
45
46}
47
48void
49VislabComponent::stopActivity()
50{
51 camera.close();
52}
53
54void
55VislabComponent::startActivity()
56{
57 camera.open();
58
59 try
60 {
61 camera.setVideoOutput(getTypedOutput<cv::Mat, VislabComponent>("image"));
62 camera.setDispariteOutput(getTypedOutput<cv::Mat, VislabComponent>("disparity"));
63 }
64 catch (std::exception const& e)
65 {
66 LOG_ERROR(e.what());
67 }
68
69
70}
71
72ComponentBase::COMPONENT_CONFIGURATION
73VislabComponent::configureComponent(XmlComponentConfig config)
74{
75 return ComponentBase::CONFIGURED_OK;
76}
77
78void VislabComponent::addOutputs()
79{
80 addOutput<cv::Mat, VislabComponent>("image");
81 addOutput<cv::Mat, VislabComponent>("disparity");
82}
83
84
85
Note: See TracBrowser for help on using the repository browser.