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

前端 未结 4 2062
清歌不尽
清歌不尽 2021-02-19 18:26

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:34

    Try background subtraction.

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

提交回复
热议问题