less than 1 minute read

GaussianBlur()

cv.GaussianBlur(img, (5,5) , cv.BORDER_DEFAULT)


Blurring an image

The pixel is reduced to follow the average value of the pixels that is covered by the kernel size.

Screen Shot 2022-05-21 at 5.06.24 PM


Canny()

It is used to detect edges in an image.

canny = cv.Canny(blur, 125, 175)
# 125 is the lower threshold value in Hysteresis Thresholding
# 175 is the upper threshold value in Hysteresis Thresholding
cv.imshow('canny', canny)
cv.waitKeyEx(0)


resize()

resized = cv.resize(img, (500,500), interploation = cv.INTER_AREA)
# interploation = cv.INTER_AREA This makes the image get resized smaller than original dimension.
cv.imshow(resized)


Cropping Image

cropped = img[50:200, 200:400]

Categories:

Updated:

Leave a comment