Tutorial Processing
BoofCV provides an easy to use interface tailored for Processing. Don't know what Processing is? Here is a summary taken from its website:
Processing is a programming language, development environment, and online community. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology. Initially created to serve as a software sketchbook and to teach computer programming fundamentals within a visual context, Processing evolved into a development tool for professionals. Today, there are tens of thousands of students, artists, designers, researchers, and hobbyists who use Processing for learning, prototyping, and production.
Usage examples can be found on GitHub in the examples directory. The interface provided is more object oriented than most of BoofCV and allows for commands to be chained in a sequence. Consider the example below, contours are found by chaining several commands together; threshold, erode, and contour.
import boofcv.processing.*;
import boofcv.struct.image.*;
PImage imgContour;
PImage imgBlobs;
void setup() {
PImage input = loadImage("particles01.jpg");
// Convert the image into a simplified BoofCV data type
SimpleGray gray = Boof.gray(input,ImageDataType.F32);
// Threshold the image using its mean value
double threshold = gray.mean();
// find blobs and contour of the particles
ResultsBlob results = gray.threshold(threshold,true).erode8(1).contour();
// Visualize the results
imgContour = results.getContours().visualize();
imgBlobs = results.getLabeledImage().visualize();
size(input.width, input.height);
}
void draw() {
background(0);
if( mousePressed ) {
image(imgBlobs, 0, 0);
} else {
image(imgContour, 0, 0);
}
}