I have some questions about offsetting ofGetPixels
I down sampled my video (see top image), copied the pixels into ofPixels and created a dot matrix of circles. Im now getting repeated videos, I only want one and centred in the middle. (see lower image)
-h
ofVideoGrabber video; //Declare the video player object
ofxCvGrayscaleImage mask;
ofPixels pixels;
-cpp
//put mask into pixels
pixels = mask.getPixels();
// draw the matrix
for (int i =0; i<(ofGetWidth()/spacing); i++) {
for (int j = 0; j<(ofGetHeight()/spacing); j++) {
int locX = startPos + ( i * spacing);
int locY = startPos + ( j * spacing);
ofPushMatrix();
ofTranslate(locX, locY);
ofColor c = pixels.getColor(locX, locY);
int brightness = c.getBrightness();
float maxSize = spacing/2;
float radius = ofMap(brightness, 0, 255, 0, maxSize);
ofPushStyle();
ofSetColor(0);
ofDrawCircle(0, 0, maxSize);
ofPopStyle();
ofDrawCircle(0, 0, radius);
ofPopMatrix();
Any advice on how to do this?
Thanks in advance