18 #include <yarp/os/all.h>
19 #include <yarp/sig/all.h>
23 #pragma package <opencv>
26 #include <opencv2/opencv.hpp>
27 #include <opencv2/core/types_c.h>
28 #include <opencv2/imgproc/imgproc_c.h>
32 #define PI 3.1415926535897932384626433832795
33 #define SCATTER(s) ( (s*(double)rand()/(double)RAND_MAX)-0.5*s )
36 using namespace yarp::os;
37 using namespace yarp::sig;
40 class pf3dBottomup :
public RFModule
47 typedef struct MbMoments
53 typedef struct CameraModel
65 typedef struct ObjectModel
84 string _inputVideoPortName;
85 BufferedPort<ImageOf<PixelRgb> > _inputVideoPort;
86 string _outputParticlePortName;
87 BufferedPort<Bottle> _outputParticlePort;
89 double _perspectiveFx;
90 double _perspectiveFy;
91 double _perspectiveCx;
92 double _perspectiveCy;
93 int _calibrationImageWidth;
94 int _calibrationImageHeight;
95 bool _doneInitializing;
99 ImageOf<PixelRgb> *_yarpImage;
103 int _maskVmin, _maskVmax, _maskSmin, _blur;
104 int _scaleSpaceLevels;
105 double _scaleSpaceScales[3];
110 ObjectModel _object_model;
113 IplImage *image, *infloat, *hsv, *hue, *sat, *val, *mask, *backproject, *backprojectmask2;
116 void calc_hist_from_model_2D(
string file, CvHistogram **objhist,
int _vmin,
int _vmax);
117 void normalize_to_global_max(IplImage *img);
118 void scale_space_segmentation(IplImage *img, ScaleSpace *ss, IplImage *result);
119 int object_localization_simple(IplImage *segm, ObjectModel *model, CameraModel *camera);
127 virtual bool configure(ResourceFinder &rf);
128 virtual bool close();
129 virtual bool interruptModule();
130 virtual bool updateModule();
136 void cvFloodFill2( CvArr* arr, CvPoint seed_point, CvScalar newVal, CvScalar lo_diff, CvScalar up_diff, CvConnectedComp* comp,
int flags, CvArr* maskarr );
Implements a Gaussian Scale Space for floating point images.