Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Basics/5_Must_Know_OpenCV_Functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
print(kernel)

path = "Resources/lena.png"
img = cv2.imread(path)
imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
imgBlur = cv2.GaussianBlur(imgGray,(7,7),0)
imgCanny = cv2.Canny(imgBlur,100,200)
img = cv2.imread(path) #reads image
imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) #this converts image to gray scale and opencv uses BGR not RGB
imgBlur = cv2.GaussianBlur(imgGray,(7,7),0) #kernel size (7,7) must be odd , larger means more blur
imgCanny = cv2.Canny(imgBlur,100,200) #detects sudden changes in pixel intensity
imgDilation = cv2.dilate(imgCanny,kernel , iterations = 10)
imgEroded = cv2.erode(imgDilation,kernel,iterations=2)

Expand Down