source: pacpussensors/trunk/Vislab/VislabComponent.cpp@ 142

Last change on this file since 142 was 142, checked in by ldecherf, 7 years ago

Ajout de la classe outputter et modification d'openCV

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