Pipeline packaging box detection and counting application based on OpenCV (source code attached)

Introduction

    This article mainly introduces the assembly line packaging box detection and counting application based on OpenCV, and gives the source code.​ 

Download

    Complete code and video download address:

https://github.com/freedomwebtech/rpi4-conveyor-belt-boxces-counter

picture

The core code is as follows (cboxtest.py):

import cv2import numpy as npfrom tracker import*

cap=cv2.VideoCapture('box.mp4')lower_range=np.array([0,46,64])upper_range=np.array([43,115,160])
def RGB(event, x, y, flags, param):    if event == cv2.EVENT_MOUSEMOVE :          point = [x, y]        print(point)          tracker=Tracker()cv2.namedWindow('box-counter')cv2.setMous

Guess you like

Origin blog.csdn.net/stq054188/article/details/134913812