I am using createBackgroundSubtractorMOG2
which makes a mask of moving object. However, I would like to have a complete segmentation. Currently, only regions around the boundary are white and parts inside are black.
I tried various methods including thresholding but none of them worked. I also looked at cv2.fillPoly
but that also did not seem to work.
Here is what I have tried till now
ret, frame = cap.read()
frame = cv2.GaussianBlur(frame,(21,21),0)
fgmask = fbgb.apply(frame)
Any solutions on how can I obtain a proper segmentation of foreground and background.
Here is the screenshot of what I am getting when applied on a video of a dancing girl in a static background