3 #ifndef __SEGMENTOR_THREAD_HPP__
4 #define __SEGMENTOR_THREAD_HPP__
6 #include <yarp/os/RFModule.h>
7 #include <yarp/os/Network.h>
8 #include <yarp/os/Port.h>
9 #include <yarp/os/BufferedPort.h>
10 #include <yarp/os/PeriodicThread.h>
11 #include <yarp/os/Property.h>
13 #include <yarp/dev/all.h>
14 #include <yarp/dev/IRGBDSensor.h>
16 #include <yarp/sig/all.h>
18 #define DEFAULT_ALGORITHM "blueMinusRed"
19 #define DEFAULT_LOCATE "centroid"
20 #define DEFAULT_MAX_NUM_BLOBS 2
21 #define DEFAULT_MORPH_CLOSING 2
22 #define DEFAULT_MORPH_OPENING 0
23 #define DEFAULT_OUT_FEATURES "mmX mmY mmZ"
24 #define DEFAULT_OUT_FEATURES_FORMAT 0
25 #define DEFAULT_OUT_IMAGE 1
26 #define DEFAULT_RATE_MS 20
27 #define DEFAULT_SEE_BOUNDING 3
28 #define DEFAULT_THRESHOLD 55
31 #define DEFAULT_SEARCH_AREA_DILATATION 10
32 #define DEFAULT_DEPTH_LOW_THRESHOLD 0.730
33 #define DEFAULT_DEPTH_HIGH_THRESHOLD 1.25
34 #define DEFAULT_OCCUPANCY_THRESHOLD 100
35 #define DEFAULT_VOXEL_RESOLUTION 4
36 #define DEFAULT_UTILITY_DEPTH_LOW_THRESHOLD 1.350
37 #define DEFAULT_UTILITY_DEPTH_HIGH_THRESHOLD 1.450
38 #define DEFAULT_NUMBER_UTILITY_VOXELS 4
40 #define DEFAULT_LOW_W_THRESHOLD 0.17
41 #define DEFAULT_HIGH_W_THRESHOLD 0.87
42 #define DEFAULT_LOW_H_THRESHOLD 0.45
43 #define DEFAULT_HIGH_H_THRESHOLD 0.52
55 virtual bool read(yarp::os::ConnectionReader& connection)
60 printf(
"Got %s\n", b.toString().c_str());
64 xKeep = b.get(0).asInt32();
65 yKeep = b.get(1).asInt32();
70 if (b.get(0).asInt32() < xKeep || b.get(1).asInt32() < yKeep)
81 w = b.get(0).asInt32() - x;
82 h = b.get(1).asInt32() - y;
111 yarp::dev::IRGBDSensor *iRGBDSensor;
112 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelMono16> > *pOutImg;
113 yarp::os::Port *pOutPort;
115 std::string algorithm;
120 int outFeaturesFormat;
125 double fx_d,fy_d,cx_d,cy_d,fx_rgb,fy_rgb,cx_rgb,cy_rgb;
127 yarp::os::Bottle outFeatures;
130 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> >* outCropSelectorImg;
131 yarp::os::Port* inCropSelectorPort;
135 int searchAreaDilatation;
136 float depthLowThreshold;
137 float depthHighThreshold;
138 int occupancyThreshold;
140 float utilityDepthLowThreshold;
141 float utilityDepthHighThreshold;
142 int numberUtilityVoxels;
144 float highWThreshold;
146 float highHThreshold;
150 void setIRGBDSensor(yarp::dev::IRGBDSensor * _iRGBDSensor);
151 void setOutImg(yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelMono16> > * _pOutImg);
152 void setOutPort(yarp::os::Port *_pOutPort);
153 void init(yarp::os::ResourceFinder &rf);
156 void setCropSelector(
int cropSelector) { this->cropSelector = cropSelector; }
157 void setOutCropSelectorImg(yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> >* outCropSelectorImg) { this->outCropSelectorImg = outCropSelectorImg; }
158 void setInCropSelectorPort(yarp::os::Port* inCropSelectorPort) { this->inCropSelectorPort = inCropSelectorPort; }
Implements voxelOccupancyDetection callback on Bottle.
Definition: SegmentorThread.hpp:54
Implements voxelOccupancyDetection PeriodicThread.
Definition: SegmentorThread.hpp:109
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:5