Code Analysis
https://www.pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/
Last updated
Was this helpful?
https://www.pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/
Last updated
Was this helpful?
define the green's range (29, 86, 6) ~ (64, 255, 255). pts is buffer maximum size, i use 64 dequeue's size
For processing the frame faster, blur the frame to reduce high frequency noise and allow to focus on the structural objects inside the frame.
<cv2.erode()>
thickness or size of the foreground object decreases or simply white region decreases in the image. It is useful for removing small white noises.
<cv2.dilate()>
It is just opposite of erosion. erosion removes white noises, but it also shrinks our object. So we dilate it.
erosion, dilation is use to remove any small noise
I find the largest contour inthe cnts list. -> compute minimum enclosing circle of the blob. -> compute the center (x, y)-coordinates
If complete computing (x,y)-coordinate, append value in dequeu "pts"
compute the thickness of the contrail and then draw it on the frame using cv2.line()