This commit is contained in:
Piotr Dobrowolski 2020-04-14 18:25:45 +02:00
parent 514034d2c8
commit 1130906f03

View File

@ -50,7 +50,7 @@ def run(path):
if ret == True:
h, w, channels = frame.shape
smol = frame[int(h*0.5):int(h*0.9), int(w*0.55):int(w*0.8)]
smol = frame[int(h*0.5):int(h*0.9), int(w*0.63):int(w*0.8)]
gray = cv2.cvtColor(smol, cv2.COLOR_BGR2GRAY)
blurred = cv2.GaussianBlur(gray, (7, 7), 0)
thresh = cv2.threshold(blurred, 235, 255, cv2.THRESH_BINARY)[1]
@ -59,7 +59,7 @@ def run(path):
for c in cnts:
area = cv2.contourArea(c)
if area > 28 and area < 80:
if area > 20 and area < 40:
# compute the center of the contour
M = cv2.moments(c)
cX = int(M["m10"] / M["m00"])