plonk
This commit is contained in:
parent
514034d2c8
commit
1130906f03
@ -50,7 +50,7 @@ def run(path):
|
|||||||
if ret == True:
|
if ret == True:
|
||||||
h, w, channels = frame.shape
|
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)
|
gray = cv2.cvtColor(smol, cv2.COLOR_BGR2GRAY)
|
||||||
blurred = cv2.GaussianBlur(gray, (7, 7), 0)
|
blurred = cv2.GaussianBlur(gray, (7, 7), 0)
|
||||||
thresh = cv2.threshold(blurred, 235, 255, cv2.THRESH_BINARY)[1]
|
thresh = cv2.threshold(blurred, 235, 255, cv2.THRESH_BINARY)[1]
|
||||||
@ -59,7 +59,7 @@ def run(path):
|
|||||||
|
|
||||||
for c in cnts:
|
for c in cnts:
|
||||||
area = cv2.contourArea(c)
|
area = cv2.contourArea(c)
|
||||||
if area > 28 and area < 80:
|
if area > 20 and area < 40:
|
||||||
# compute the center of the contour
|
# compute the center of the contour
|
||||||
M = cv2.moments(c)
|
M = cv2.moments(c)
|
||||||
cX = int(M["m10"] / M["m00"])
|
cX = int(M["m10"] / M["m00"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user