Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Security & Surveillance

Smart Surveillance Camera: Object Detection with OpenCV

Smart Surveillance Camera: Object Detection with OpenCV

March 11, 2026 /Posted byJayesh Jain / 0

Table of Contents

  • System Overview
  • Hardware Options
  • OpenCV Installation on Pi
  • Person Detection with MobileNet-SSD
  • Telegram Alert on Detection
  • Performance Optimisation
  • FAQ

System Overview

A smart surveillance camera with OpenCV object detection uses AI-based computer vision to distinguish people from animals, vehicles, and other moving objects – eliminating the false alarms that plague PIR-based systems. Running on Raspberry Pi 5, it processes live camera feed, detects persons with 80-90% accuracy, and sends Telegram alerts with a snapshot photograph. Build cost: Rs 5,000-8,000 versus commercial AI cameras at Rs 8,000-25,000 (Hikvision DeepinView, Dahua WizSense).

Recommended: Waveshare IMX219 Camera Module For Raspberry Pi 5, 8MP, MIPI-CSI Interface – Waveshare IMX219 8MP Camera Module for Raspberry Pi 5 – high-resolution CSI camera with low-light sensitivity for reliable AI-based surveillance.
Recommended: Arducam 12MP IMX477 Pan Tilt Zoom PTZ IR-Cut Camera for Raspberry Pi – Arducam 12MP IMX477 PTZ Camera – professional-grade PTZ camera for active tracking surveillance with motorised pan-tilt-zoom control.

Hardware Options

Platform FPS (MobileNet-SSD) Cost India Notes
Raspberry Pi 5 (8GB) 8-12 FPS Rs 8,000-10,000 Best for Indian DIY, good community support
Raspberry Pi 5 (4GB) 6-10 FPS Rs 6,500-8,000 Adequate for single camera
Jetson Nano (GPU) 20-30 FPS Rs 12,000-18,000 Better for multi-camera systems
Orange Pi 5 15-20 FPS (NPU) Rs 5,000-7,000 NPU acceleration for AI workloads

OpenCV Installation on Pi

# Install on Raspberry Pi OS (Bookworm)
sudo apt update
sudo apt install -y python3-opencv python3-pip
pip3 install opencv-contrib-python imutils

# Test camera
python3 -c "import cv2; cap=cv2.VideoCapture(0); print(cap.isOpened())"

Person Detection with MobileNet-SSD

import cv2
import numpy as np

# Load pre-trained person detector (MobileNet-SSD)
net = cv2.dnn.readNetFromCaffe('deploy.prototxt', 'mobilenet.caffemodel')
cap = cv2.VideoCapture(0) # Arducam or USB camera

while True:
    ret, frame = cap.read()
    if not ret: break
    h, w = frame.shape[:2]
    blob = cv2.dnn.blobFromImage(cv2.resize(frame,(300,300)),
        0.007843,(300,300),127.5)
    net.setInput(blob)
    detections = net.forward()
    for i in range(detections.shape[2]):
        confidence = detections[0,0,i,2]
        classID = int(detections[0,0,i,1])
        if confidence > 0.5 and classID == 15: # person class
            box = detections[0,0,i,3:7] * np.array([w,h,w,h])
            x1,y1,x2,y2 = box.astype(int)
            cv2.rectangle(frame,(x1,y1),(x2,y2),(0,255,0),2)
            print(f"Person detected! Confidence: {confidence:.2f}")
            # Trigger Telegram notification with snapshot
    cv2.imshow('Surveillance', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'): break

cap.release()

Telegram Alert on Detection

import requests, cv2
def send_telegram_photo(bot_token, chat_id, frame):
    _, buf=cv2.imencode('.jpg', frame)
    url=f"https://api.telegram.org/bot{bot_token}/sendPhoto"
    requests.post(url,
        data={'chat_id':chat_id,'caption':'Person detected!'},
        files={'photo':('alert.jpg',buf.tobytes(),'image/jpeg')},
        timeout=10)

Performance Optimisation

  • Region of interest masking: Only process detection in relevant zones (doorway, gate area) and ignore sky, ground. Reduces compute by 40-60%.
  • Frame skipping: Process every 3rd frame for detection while displaying all frames. 3x faster detection loop.
  • Resolution reduction: Run detection at 320×320 while recording at full 1920×1080. Scales linearly with resolution.
  • Hardware acceleration: On Pi 5, use OpenCV with NEON SIMD optimisation (enabled by default in Pi OS build). Enable Video4Linux2 (V4L2) camera interface for lower latency CSI capture.

Frequently Asked Questions

What is the accuracy of person detection vs motion detection?

MobileNet-SSD person detection achieves 80-90% detection rate with 5-10% false positive rate in typical Indian outdoor conditions. Standard PIR motion detectors have near-zero false negatives but 30-60% false positive rate (dogs, cats, wind-blown leaves, air conditioners). For Indian residential use, AI detection significantly reduces false alarm notifications while maintaining reliable intruder detection.

Can this system run 24/7 on Raspberry Pi without overheating?

Raspberry Pi 5 running continuous OpenCV object detection reaches 60-70 degrees CPU temperature at 8-12 FPS. At this temperature (within spec, max 85C), the Pi throttles slightly but remains stable. Use a proper heatsink and active cooling fan case. In Indian summer with ambient 35-40C ambient, a case with active fan is essential for 24/7 operation. Monitor temperature with vcgencmd measure_temp command.

Does this work with the Arducam PTZ camera for auto-tracking?

Yes – combine MobileNet-SSD detection with Arducam PTZ controller (available via Python libcamera or ArduCam PTZ library). When a person is detected, calculate the centroid of their bounding box, compare to frame centre, and send pan/tilt commands to centre the camera on the detected person. This creates an active tracking surveillance camera similar to commercial auto-tracking cameras at 10x lower cost.

What happens to stored footage in Indian power cuts?

Implement graceful shutdown: detect power cut via UPS APC relay contact or voltage sensor, save current recording file properly before system shutdown, record power cut timestamp. At restart, begin new recording file. Use a 600VA UPS to give the Pi 1-2 hours of operation during cuts. Store recordings on USB SSD rather than SD card – SD cards are prone to corruption if power is cut during a write operation.

Shop Security & Surveillance at Zbotic

Tags: AI security camera India, OpenCV motion detection, OpenCV object detection CCTV, person detection Raspberry Pi, smart surveillance camera
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Gas Leak Alarm with MQ6 LPG Se...
blog gas leak alarm with mq6 lpg sensor and gsm alert module 599873
blog wire cutter alarm tamper detection for perimeter security 599879
Wire Cutter Alarm: Tamper Dete...

Related posts

Svg%3E
Read more

Trail Camera: Wildlife and Property Monitoring India

April 1, 2026 0
Table of Contents Trail Cameras for Indian Wildlife PIR-Triggered Camera Design ESP32-CAM Configuration for Trail Use Night Vision with IR... Continue reading
Svg%3E
Read more

Solar Powered Security Camera: Off-Grid Surveillance

April 1, 2026 0
Table of Contents Off-Grid Surveillance Needs in India Solar Panel and Battery Sizing Power Management Circuit ESP32-CAM Low Power Optimisation... Continue reading
Svg%3E
Read more

Remote Viewing Setup: Access Cameras from Anywhere

April 1, 2026 0
Table of Contents Remote Viewing Options P2P Cloud vs Port Forwarding Dynamic DNS Setup VPN for Secure Access Mobile App... Continue reading
Svg%3E
Read more

Motion Detection Zones: Reduce False Alarms

April 1, 2026 0
Table of Contents The False Alarm Problem How Motion Detection Works in Cameras Setting Detection Zones Sensitivity Adjustment Object Size... Continue reading
Svg%3E
Read more

Security Camera Placement: Best Positions for Coverage

April 1, 2026 0
Table of Contents Camera Placement Principles Height and Angle Guidelines Coverage Overlap Strategy Indian Home Layouts Commercial Property Placement Avoiding... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now