euglena/lib/opencv_processing/examples/CalibrationDemo/CalibrationDemo.pde

26 lines
449 B
Plaintext
Raw Permalink Normal View History

2016-07-10 00:36:44 -07:00
import gab.opencv.*;
PImage src;
ArrayList<PVector> cornerPoints;
OpenCV opencv;
void setup() {
src = loadImage("checkerboard.jpg");
src.resize(500, 0);
size(src.width, src.height);
opencv = new OpenCV(this, src);
opencv.gray();
cornerPoints = opencv.findChessboardCorners(9,6);
}
void draw() {
image( opencv.getOutput(), 0, 0);
fill(255,0,0);
noStroke();
for(PVector p : cornerPoints){
ellipse(p.x, p.y, 5, 5);
}
}