Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adaptive background subtraction clarification in computer vision #251

Open
david-sullivan opened this issue May 19, 2017 · 1 comment
Open

Comments

@david-sullivan
Copy link

david-sullivan commented May 19, 2017

the text says "The overloaded operators for ofxCvImage make such running averages straightforward." however this only seems true for ofxCvFloatImage. If the background image is a type of ofxGrayscaleImage (or any other than floatImage), the example will not work.
my workaround, which may not be the best way, was:

`//convert grayImage and grayBg to ofxCvFloatImage versions, multiply then convert back to grayImage

    grayImageFloat = grayImage; //from ofxGrayscaleImage to ofxFloatImage
    grayBgFloat = grayBg;
    grayImageFloat *= 0.01;
    grayBgFloat *= 0.99;
    grayBgFloat += grayImageFloat;
    grayBg = grayBgFloat; // back to ofxGrayscaleImage`
@jhrtn
Copy link

jhrtn commented Aug 23, 2020

I just ran into the same issue and your workaround helped me get through the last part of the chapter. It would be good to see a clarification in the docs what the best way to do this is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants