how to call vibe in python? [closed]

asked 2014-07-29 13:02:57 -0600

Shiloh gravatar image

updated 2014-07-30 00:23:38 -0600

berak gravatar image

I want to detect vehicle and I got problem with winding trees.. I tried MOG and MOG2, not so much satisfy with the result, and I found video example of vibe that can reduce false foreground detection.. I search in opencv documentation but only for c++, any other way to call it in python?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-04 09:23:29.519842

Comments

there was a gpu:vibe in 2.4.6, but it is no more. (and no, you can't interact with opencv cuda code from python)

berak gravatar imageberak ( 2014-07-30 00:23:10 -0600 )edit

I can't use gpu, my laptop not compatible.. any other bgs algorithm like vibe one?? I need to handle the winding trees..

Shiloh gravatar imageShiloh ( 2014-07-30 00:29:18 -0600 )edit

you could try to port the pseudocode to numpy

berak gravatar imageberak ( 2014-07-30 00:35:43 -0600 )edit

thanks @berak, I'll try it...

Shiloh gravatar imageShiloh ( 2014-07-30 00:46:09 -0600 )edit

uhm @berak, I want to ask again.. there code in the link "distance = getEuclideanDist(image[x][y], samples[x][y][index]);" where samples[x][y] is background samples, doesn't we used bgs algorithm like vibe to find background sample so we can know foreground? Do I need implemented like mog to get background model and used it to vibe?

Shiloh gravatar imageShiloh ( 2014-07-30 06:56:31 -0600 )edit

no problem asking again ;)

the 'samples' are a stack of images, the 'model'. maybe 'background' samples is confusing, it is more like caching 'history'. if enough of those samples agree on a pixel being 'backgound', the pixel in the final segmentation image is set to 0.

berak gravatar imageberak ( 2014-07-30 07:05:53 -0600 )edit

@berak, uhm sorry disturbing you again but I don't get it how to program to get samples[x][y][index], could you help me?

Shiloh gravatar imageShiloh ( 2014-08-02 05:50:59 -0600 )edit

maybe it gets easier, if samples is an array of np.uint8 images ? so you'd have samples[index][y][x] in python / numpy

berak gravatar imageberak ( 2014-08-02 05:57:06 -0600 )edit

@berak what images, you mean numpy array of next frames? and do you mean about indexing of numpy array? I'm so sorry, I'm really newbie in image processing..

Shiloh gravatar imageShiloh ( 2014-08-02 06:55:10 -0600 )edit