source: pacpussensors/trunk/StereoVisionDisparity/VDisparity.cpp@ 50

Last change on this file since 50 was 50, checked in by phudelai, 10 years ago

Flea3Component: Shared memory changed for stereovision
StereoVisionDisparity: Added for the PFE of Pierre

File size: 3.2 KB
Line 
1/*********************************************************************
2// created: 2012/03/01 - 14:06
3// filename: VDisparite.cpp
4//
5// author: Pierre Hudelaine
6// Copyright Heudiasyc UMR UTC/CNRS 7253
7//
8// version: $Id: $
9//
10// purpose: Create network socket if needed in Pacpus
11//
12*********************************************************************/
13
14#include "VDisparity.h"
15
16using namespace pacpus;
17
18
19DECLARE_STATIC_LOGGER("pacpus.base.VDisparity");
20
21
22//////////////////////////////////////////////////////////////////////////
23// Construct the factory
24//////////////////////////////////////////////////////////////////////////
25static ComponentFactory <VDisparity> sFactory("VDisparity");
26
27
28//////////////////////////////////////////////////////////////////////////
29// Constructeur
30//////////////////////////////////////////////////////////////////////////
31VDisparity::VDisparity(QString name)
32 : ComponentBase(name)
33{
34 img_width_ = 1280;
35 img_height_ = 960;
36
37 initMat();
38
39 maxImageSize_ = img_width_ * img_height_;
40 this->img_Ldata_ = (unsigned char *)malloc(maxImageSize_);
41 this->img_Rdata_ = (unsigned char *)malloc(maxImageSize_);
42 shMemLeft_ = new ShMem("Changer nom", maxImageSize_);
43 shMemRight_ = new ShMem("Changer nom", maxImageSize_);
44}
45
46
47//////////////////////////////////////////////////////////////////////////
48// Destructor
49//////////////////////////////////////////////////////////////////////////
50VDisparity::~VDisparity()
51{
52 free(this->img_Ldata_);
53 free(this->img_Rdata_);
54}
55
56
57//////////////////////////////////////////////////////////////////////////
58// Called by the ComponentManager to pass the XML parameters to the
59// component
60//////////////////////////////////////////////////////////////////////////
61ComponentBase::COMPONENT_CONFIGURATION VDisparity::configureComponent(XmlComponentConfig config)
62{
63
64
65 return ComponentBase::CONFIGURED_OK;
66}
67
68
69//////////////////////////////////////////////////////////////////////////
70// Called by the ComponentManager to start the component
71//////////////////////////////////////////////////////////////////////////
72void VDisparity::startActivity()
73{
74 // Imgae reading
75 if (this->img_Ldata_ != NULL)
76 {
77 this->shMemLeft_->read(this->img_Ldata_, this->maxImageSize_);
78 this->shMemRight_->read(this->img_Rdata_, this->maxImageSize_);
79 }
80
81 multi_obc();
82
83
84}
85
86//////////////////////////////////////////////////////////////////////////
87// Called by the ComponentManager to stop the component
88//////////////////////////////////////////////////////////////////////////
89void VDisparity::stopActivity()
90{
91
92}
93
94
95//////////////////////////////////////////////////////////////////////////
96//
97//////////////////////////////////////////////////////////////////////////
98void VDisparity::multi_obc()
99{
100
101}
102
103
104//////////////////////////////////////////////////////////////////////////
105//
106//////////////////////////////////////////////////////////////////////////
107void VDisparity::pre_detect()
108{
109
110}
111
112
113//////////////////////////////////////////////////////////////////////////
114//
115//////////////////////////////////////////////////////////////////////////
116void VDisparity::initMat()
117{
118
119}
Note: See TracBrowser for help on using the repository browser.