diff --git a/Basics/5_Must_Know_OpenCV_Functions.py b/Basics/5_Must_Know_OpenCV_Functions.py index e22c287..0e10e22 100644 --- a/Basics/5_Must_Know_OpenCV_Functions.py +++ b/Basics/5_Must_Know_OpenCV_Functions.py @@ -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)