The class I'd like use is BackgroundSubtractorMOG2. The confusing part is that you cannot use its constructor to create an instance. Video.createBackgroundSubtractorMOG2() is needed for this task.
1. Create an instance of BackgroundSubtractorMOG2.
- BackgroundSubtractorMOG2 fgbg =Video.createBackgroundSubtractorMOG2();
2. Apply it to the incoming image.
- fgbg.apply(mat, mask);
where mat is RGB image from a webcam, and mask is the output gray scale foreground mask
I also updated my ImageConvertor, so it can convert both three channel and one channel OpenCV Mat to BufferedImage for displaying. Here is a screenshot of example: after waiting for a while so my office scene disappears from the mask, I put my hand in the view.
Top is mat, bottom is mask
And where is the removed background in your example you stupid dick? I see only mask. What to do next with this fucking mask??? This fucking opencv pisses me off. Nothin simple, no documentation. Fucking shit.
ReplyDeleteChill out man
Deletefuck you all
ReplyDelete