How to subtract two images using python opencv2 to get the foreground object

前端 未结 4 846
北海茫月
北海茫月 2021-02-19 18:48

Is there any way to subtract two images in python opencv2 ?

  • Image 1 : Any image (eg. a house Image) (static image)
  • Image 2 : The same Image with an Objec
4条回答
  •  误落风尘
    2021-02-19 19:10

    Try background subtraction.

    Use cv2.subtract(img1,img2) instead of arithmetic operation, as cv2 will take care of negative values.

提交回复
热议问题