Skip to content

Instantly share code, notes, and snippets.

@Praveen76
Created April 15, 2022 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Praveen76/13e83a345170e3a29daff59bed83bb53 to your computer and use it in GitHub Desktop.
Save Praveen76/13e83a345170e3a29daff59bed83bb53 to your computer and use it in GitHub Desktop.
import cv2 as cv
img=cv.imread('D:\img.jpg')
#Gaussian Blur
GaussBlr=cv.GaussianBlur(img,(5,5),cv.BORDER_DEFAULT)
canny=cv.Canny(GaussBlr,125,175)
cv.imshow('canny',canny)
contours,hiearchies=cv.findContours(canny,cv.RETER_LIST,cv.CHAIN_APPROX_SIMPLE)
cv.drawContours(img,contours,-1,(255,0,0),thickness=2)
cv.imshow('draw',img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment