Running Object detection on Raspberry Pi using OpenCV

I got an error when I ran the object-ident.py

%Run object-ident.py
Traceback (most recent call last):
File “/home/pi/Desktop/Object_Detection_Files/object-ident.py”, line 50, in <>
result, objectInfo = getObjects(img,0.45,0.2)
File “/home/pi/Desktop/Object_Detection_Files/object-ident.py”, line 21, in g>
classIds, confs, bbox = net.detect(img,confThreshold=thres,nmsThreshold=nms)
cv2.error: OpenCV(4.4.0) /home/pi/opencv-4.4.0/modules/imgproc/src/resize.cpp:3>

Please help me
OS = Raspberry Pi OS X11 64-bit
Board = Raspberry PI 4B 8GB

1 Like

I can try and help.
Are you following this tutorial by any chance?

If so, what is the print out of cap.read().
e.g.

  success, img = cap.read()
  print(success, img)
  #result, objectInfo = getObjects(img,0.45,0.2)
  #print(objectInfo)
1 Like