Skip to content

Instantly share code, notes, and snippets.

View DynamiteC's full-sized avatar
🎯
Focusing

Shail Sheth DynamiteC

🎯
Focusing
View GitHub Profile
@DynamiteC
DynamiteC / remove_white_background.py
Created February 24, 2023 10:27
Remove White Background From Image
import cv2
import numpy as np
# Read the input image
img = cv2.imread('input.png')
# Convert the image to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Threshold the image to create a binary mask