19 #ifndef __ICUB_LUMACHROMA_H__
20 #define __ICUB_LUMACHROMA_H__
26 #include <yarp/sig/Image.h>
27 #include <yarp/os/BufferedPort.h>
28 #include <yarp/os/RFModule.h>
29 #include <yarp/os/Network.h>
30 #include <yarp/os/Time.h>
32 #include <opencv2/opencv.hpp>
36 class PROCThread :
public yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> >
40 std::string moduleName;
41 std::string whichPort;
42 std::string inputPortName;
43 std::string outputPortName;
44 std::string outputPortName1;
45 std::string outputPortName2;
46 std::string outputPortName3;
47 std::string outputPortNameDefault;
49 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> > imageOutPort;
50 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelMono> > imageOutPort1;
51 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelMono> > imageOutPort2;
52 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelMono> > imageOutPort3;
54 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelMono> > defaultPortOut;
56 yarp::sig::ImageOf<yarp::sig::PixelRgb> *inputExtImage;
58 yarp::sig::ImageOf<yarp::sig::PixelMono> *img_Y;
59 yarp::sig::ImageOf<yarp::sig::PixelMono> *img_UV;
60 yarp::sig::ImageOf<yarp::sig::PixelMono> *img_V;
61 yarp::sig::ImageOf<yarp::sig::PixelMono> *img_out_Y;
62 yarp::sig::ImageOf<yarp::sig::PixelMono> *img_out_UV;
63 yarp::sig::ImageOf<yarp::sig::PixelMono> *img_out_V;
65 cv::Size srcsize, origsize;
72 cv::Mat orig, uvimg, csTot32f;
79 yarp::sig::ImageOf<yarp::sig::PixelRgb>* extender(yarp::sig::ImageOf<yarp::sig::PixelRgb>& inputOrigImage,
int maxSize);
87 PROCThread(
const std::string &moduleName,
const std::string &imgType,
const std::string &whichPort);
96 void onRead(yarp::sig::ImageOf<yarp::sig::PixelRgb> &img);
97 void allocate(yarp::sig::ImageOf<yarp::sig::PixelRgb> &img);
101 void afterStart(
bool s)
104 std::cout<<
"Thread started successfully"<< std::endl;
106 std::cout<<
"Thread did not start"<< std::endl;
110 class lumaChroma :
public yarp::os::RFModule
113 std::string moduleName;
114 std::string imageType;
115 std::string handlerPortName;
116 std::string whichPort;
118 yarp::os::Port handlerPort;
121 PROCThread *procThread;
125 bool configure(yarp::os::ResourceFinder &rf);
126 bool interruptModule();
128 bool respond(
const yarp::os::Bottle& command, yarp::os::Bottle& reply);
An implementation modelling the centre-surround response, used for construction of spatial uniqueness...