getBackgroundImage not in Java version? [closed]
I may be asking the obvious, but imgproc in C has getBackgroundImage in BackgroundSubtractorMOG, though I can't seem to find it in the Java version;
http://docs.opencv.org/java/org/opencv/video/BackgroundSubtractorMOG.html
I'm still relatively new and feeling my way around in OpenCV, so please excuse the novice level question.
ouch! - it's fixed in master, but not in 2.4 (missing CV_WRAP tag)
if you built from src, you could just add the CV_WRAP, rerun cmake, recompile
Pardon my novice level, but is there a procedure that details all the required steps to do that?
And is the BackgroundSubtractorMOG2 in the same situation?
Thanks!
change Line 69 to:
and rebuild it as described here.
but honestly, i'm not certain, if it's worth the trouble. what do you need the bg-image for ? it's just a (very expensive, btw) visualization of the model, not needed for the actual processing.
@berak - is this present now in the 3.0 version?i am using 2.4.9 but getBackgroundimage is still not there. and i cant build using ndk on my system. please help
well, it is present in 3.0, unfortunately i can't recommend using alpha/3.0 atm, specially for java, too many things are broken. (java for the ml module, and anything in opencv_contrib is disabled/non-functional) .
and again, i doubt, that you need the Backgroundimage at all. (as a delveloper, sure you want to take a look at it, but it has no practical value for the bg-seperation, and is a very,very expensive operation)
i was thinking of using the backgroundimage method in order to remove the background from the captured frame(just one frame), so that i could detect objects, i saw the alpha version in the list but then theres no sdk for android
@Dhara Shah, in that case, you misunderstood the algorithm.
you are supposed to use the foreground-mask to mask out the background in your original image.
also, you need a continuous stream of images for this, it builds a background model over time.
if you only have 1 frame, you can't use it at all, better look at grabcut or similar then
@berak thank u for the suggestion, i will have a look at grabcut, and get back