yes, it's picam v1.3 and i'm using picamera library not picamera2, and below is few initial lines of my script,Assuming it is a Pi Camera v1.3 connected to a Raspberry Pi 5 running Raspberry Pi OS 64-bit Bookworm, are you using Picamera2 in your python script or something else?
# import the necessary packages
from pyimagesearch.centroidtracker import CentroidTracker
from pyimagesearch.trackableobject import TrackableObject
from imutils.video import VideoStream
from imutils.video import FPS
import numpy as np
import argparse
import picamera
import imutils
import time
import dlib
import cv2
import time
def main(args):
# initialize the list of class labels MobileNet SSD was trained to
# detect
CLASSES = ["background", "aeroplane", "bicycle", "bird", "boat",
"bottle", "bus", "car", "cat", "chair", "cow", "diningtable",
"dog", "horse", "motorbike", "person", "pottedplant", "sheep",
"sofa", "train", "tvmonitor"]
# load our serialized model from disk
print("[INFO] loading model...")
# prototxt and model hardcoded
prototxt = "mobilenet_ssd/MobileNetSSD_deploy.prototxt"
model = "mobilenet_ssd/MobileNetSSD_deploy.caffemodel"
net = cv2.dnn.readNetFromCaffe(prototxt,model)
# if a video path was not supplied, grab a reference to the webcam
if not args.get("input", False):
print("[INFO] starting video stream...")
vs = VideoStream(usePiCamera=True).start()
time.sleep(2.0)
# otherwise, grab a reference to the video file
else:
print("[INFO] opening video file...")
vs = cv2.VideoCapture(args["input"])
rest of script is very long so if require reply to this and thanks in advance for any help!
Statistics: Posted by hardikjp7 — Thu Apr 04, 2024 6:03 am