euglena/lib/opencv_processing/examples/BrightestPoint/BrightestPoint.pde
2016-07-10 00:36:44 -07:00

23 lines
364 B
Plaintext

import gab.opencv.*;
OpenCV opencv;
void setup() {
PImage src = loadImage("robot_light.jpg");
src.resize(800, 0);
size(src.width, src.height);
opencv = new OpenCV(this, src);
}
void draw() {
image(opencv.getOutput(), 0, 0);
PVector loc = opencv.max();
stroke(255, 0, 0);
strokeWeight(4);
noFill();
ellipse(loc.x, loc.y, 10, 10);
}