5 #include <yarp/os/Network.h>
6 #include <yarp/os/BufferedPort.h>
7 #include <yarp/os/Port.h>
9 #include "SegmModule.h"
11 using namespace yarp::os;
12 using namespace yarp::sig;
14 int main(
int argc,
char *argv[]) {
18 if (!yarp.checkNetwork())
24 BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> > maskPort;
28 rf.configure(argc, argv);
29 std::string name=
"testGbsClient";
32 name=rf.find(
"name").asString();
35 std::string slash=
"/";
36 clientPort.open(slash+name+slash +
"rpc:o");
37 fixationPort.open(slash+name+slash +
"interestPoint:i");
38 maskPort.open(slash+name+slash +
"mask:o");
42 segmIf.yarp().attachAsClient(clientPort);
49 fixationPort.read(fixIn);
53 double fix_x = fixIn.get(0).asFloat64();
54 double fix_y = fixIn.get(1).asFloat64();
58 std::cout<<
"asked server"<<std::endl;
59 yarp::sig::ImageOf< yarp::sig::PixelRgb > &img=maskPort.prepare();
62 for(std::vector<Pixel>::const_iterator pixIt=pixelList.begin(); pixIt!=pixelList.end(); ++pixIt)
64 img.pixel(pixIt->x, pixIt->y) = yarp::sig::PixelRgb(255, 255, 255);
Pixel position in the image frame.
Interface for module that performs graph-based segmentation.
virtual std::vector< Pixel > get_component_around(const Pixel &objCenter)
Get the list of pixels corresponding to the component to which a given pixel belongs.