Hi!
I'm using for the first time the openCV library for a school project.
I'm trying to track blobs on form a movie file. It all works well, but the problem is the the identified blobs don't appear to be " fixed". If you run the code you will see a line starting from the mouse position that should point at the centroid of ONE of the two blobs, but it constantly changes from one to the other. Doing some research i saw that probably the issue is that the blobs don't have specific IDs....but i couldn't find any example of how to solve that in processing....
Can anyone help me?? :)
import hypermedia.video.*;
OpenCV opencv;
void setup() {
size( 800, 548 );
// open video stream opencv = new OpenCV( this ); opencv.movie( "prova.mov", width, height ); }
void draw() {
opencv.read(); // read a new frame image( opencv.image(), 0, 0 ); // and display image // grab frame from camera opencv.threshold(80); // set black & white threshold fill(250, 0, 255, 80); noStroke(); ellipse(mouseX, mouseY, 50, 50); // find blobs Blob[] blobs = opencv.blobs( 10, width*height/2, 100, true, OpenCV.MAX_VERTICES*4 );