Commit 05eac85b authored by rokka's avatar rokka

Used THRESH_BINARY_INV instead of THRESH_BINARY and inverting manual

no windows to destroy, when cv.imshow is commented out
parent 5d0695d4
......@@ -46,12 +46,10 @@ def _count_bees_in_frame(frame):
gray = cv.cvtColor(crop, cv.COLOR_BGR2GRAY)
ret_tresh, thresh = cv.threshold(gray, 64, 255, cv.THRESH_BINARY)
inv = cv.bitwise_not(thresh)
ret_tresh, thresh = cv.threshold(gray, 64, 255, cv.THRESH_BINARY_INV)
kernel = np.ones((7, 7), np.uint8)
erode = cv.erode(inv, kernel, iterations=1)
erode = cv.erode(thresh, kernel, iterations=1)
blur = cv.blur(erode, (7, 7))
bcopy = blur.copy()
......@@ -100,7 +98,7 @@ def _process_capture(capture, start_datetime):
logger.debug('%s: %d' % (frame_time, bee_count))
capture.release()
cv.destroyAllWindows()
#cv.destroyAllWindows()
influxdb_client.write_points(influx_points)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment