#include "bpRecognizer.h" void bpRecognizer::update(ofxCvGrayscaleImage image, int video_width, int video_height) { //subtracted.absDiff(image, background); subtracted.allocate(video_width, video_height); for (int i = 0; i < video_width * video_height; i++) { subtracted.getPixels()[i] = image.getPixels()[i] > background.getPixels()[i] + threshhold ? 255 : 0; } binarized = subtracted; //binarized.threshold(threshhold); contourFinder.findContours( binarized, 10, video_height * video_width / 10, 10, true); } void bpRecognizer::setThreshhold(int threshhold) { this->threshhold = threshhold; } void bpRecognizer::setBackground(ofxCvGrayscaleImage image) { this->background = image; }