Filters and Kernels in OpenCV for Python - Beginner Tutorial #7

preview_player
Показать описание


Amazon Links:

I may earn commission if you purchase from the links above

TIMESTAMPS:
0:00 Intro
0:44 Setting up
1:54 filter2D
6:10 No filter
8:14 Blur
9:13 Gaussian blur
10:30 Sharpening
12:47 Edge detection
15:47 Happy coding!
Рекомендации по теме
Комментарии
Автор

Fantastic tutorial! Your hands‑on examples and clear explanations made image processing so much easier to grasp. This really helped me ace my college assignment. Big thanks, and warm greetings from Argentina!

Letur-Lefr
Автор

Thank you for the step-by-step comparisons.

PalKrammer
Автор

Following up your video, very interesting and informative, waiting for next video!!!!

samadriaz
Автор

Enjoy following both your biking and programming videos. I have a quandary. I can get trackbars to work on videos and np.zerro arrays. But not on photos, .jpeg, .png etc. When I paste a portion of a photo into a np.zero array where the trackballs work fine, the trackballs will work in the zero array but not in the photo portion. This goes for moving circles/shapes, and altering colors. But all is fine on videos. Can you shed some sunlight on this. Here is one example. import cv2
import numpy as np

img = np.zeros((512, 512, 3), np.uint8)
img1 = cv2.imread(' image path ')
img1 =cv2.resize(img1, (512, 512))
img = img1[0:, :]
img = img1[0:256, :]
# img = img1[0:256, :]
def passfunction():
pass
cv2.namedWindow('trackbar')
cv2.createTrackbar('B', 'trackbar', 0, 255, passfunction)
cv2.createTrackbar('G', 'trackbar', 0, 255, passfunction)
cv2.createTrackbar('R', 'trackbar', 0, 255, passfunction)
cv2.createTrackbar('xPos', 'trackbar', 256, 512, passfunction)
cv2.createTrackbar('yPos', 'trackbar', 256, 512, passfunction)
# cv2.createTrackbar('B', 'trackbar', 0, 255, passfunction)

while True:
cv2.imshow('image', img)
cv2.imshow('img_1', img1)
button = cv2.waitKey(1) & 0xff
if button == ord('q'):
break
b = cv2.getTrackbarPos('B', 'trackbar')
g = cv2.getTrackbarPos('G', 'trackbar')
r = cv2.getTrackbarPos('R', 'trackbar')
xPos = cv2.getTrackbarPos('xPos', 'trackbar')
yPos = cv2.getTrackbarPos('yPos', 'trackbar')

img[:] = [b, g, r]
cv2.circle(img, (xPos, yPos), 25, (127, 127, 0), 3)
cv2.destroyAllWindows()

jbelmont
welcome to shbcf.ru