20int main(
int argc,
char *argv[])
24 BufferedPort<ImageOf<PixelRgb> > imagePort;
25 BufferedPort<ImageOf<PixelRgb> > outPort;
27 imagePort.open(
"/imageProc/image/in");
28 outPort.open(
"/imageProc/image/out");
31 ImageOf<PixelRgb> *image = imagePort.read();
32 ImageOf<PixelRgb> &outImage = outPort.prepare();
41 for (
int x=0;
x<image->width();
x++) {
42 for (
int y=0;
y<image->height();
y++) {
43 PixelRgb& pixel = image->pixel(
x,
y);
46 if (pixel.b>pixel.r*1.2+10 && pixel.b>pixel.g*1.2+10) {
61 if (ct>(image->width()/20)*(image->height()/20)) {
62 printf(
"Best guess at blue target: %g %g\n", xMean, yMean);