I am trying to get just the image of a human hand separated from background. I first captured the background which will be static in my case and then captured image with a hand in it. Then I used cv2.absdiff() to subtract both the images but the result is not as expected. Please help me get this right. Here is the output:



Code:
while(cap.isOpened()):
    grabbed, frame = cap.read()
    if not grabbed:
        continue
    Original_Image = frame.copy()
    Original_Image = cv2.cvtColor(contourFrame,cv2.COLOR_BGR2GRAY)
    Output_Image = cv2.absdiff(Background_Image, Original_Image)