void ofxCvCheckerboardPreview::setTestImage(ofPixelsRef pixels) {

    if(pixels.getImageType() != OF_IMAGE_GRAYSCALE) {
        ofLogError("ofxCvCheckerboardPreview -- must use grayscale image");
        return;
    }

    lock();
    testImage = pixels;
    if(!internalPixels.isAllocated()) {
        internalPixels.allocate(pixels.getWidth(), pixels.getHeight(), OF_IMAGE_GRAYSCALE);
    }
    newBoardToFind = true;
    boardFound = false;
    unlock();
}