[go: nahoru, domu]

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

set mask in Python ? #189

Open
peijason opened this issue Sep 15, 2020 · 1 comment
Open

set mask in Python ? #189

peijason opened this issue Sep 15, 2020 · 1 comment

Comments

@peijason
Copy link

Tested both c++ and python.

  1. In c++:
    bgs->process(img_input, img_mask, img_bkgmodel);
    we can input a img_mask.

  2. In python:
    from demo.py and demo2.py.
    img_output = algorithm.apply(frame)

it looks there is nowhere for me to input an mask image?

Any suggestions?

@andrewssobral
Copy link
Owner

Hi @peijason , sorry for my delayed feedback to you.

In c++: bgs->process(img_input, img_mask, img_bkgmodel);
img_mask and img_bkgmodel are references to be filled by the process method.

In python the behavior is different.

img_output = algorithm.apply(frame)

img_output is equivalent to img_mask (but it returns by value instead of reference)
and img_bkgmodel can be given by:

img_bkgmodel = algorithm.getBackgroundModel()

Hope this helps you.

For info, I just released a new version of the BGSLibrary, now v3.1.0.
I tested it on Windows, Mac and Linux, both compiling the C++ library on OpenCV 3.4.7, 3.4.16 and 4.6.0.
I also tested its respective Python wrapper and GT user interface.
Thanks,
Andrews

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

No branches or pull requests

2 participants