Background Subtraction or Foreground Extraction is any technique which allows an image’s background to be removed or foreground to be extracted for further processing like object recognition, tracking, etc.
- In this algorithm, the region is drawn in accordance with the foreground required.
- A rectangle is drawn over it. This is the rectangle that encases our main object.
- The region coordinates are decided over understanding the foreground maska and segmentation can be done more accurately by manual coordinate selection.
- This technique functions similar to a green screen in cinematics.
Python's opencv provides a method to implement Grab-Cut algorithm for our convenience which can be used as follows
cv2.grabCut()