Skip to content

alperak/StreamVision-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ OpenCV ZeroMQ cppzmq nlohmann-json cpp-httplib TinyXML2 CMake Docker Doxygen Linux

Table of Contents


Overview

StreamVision is a distributed object detection system consisting of two components:

  • StreamVision-Client (this repository): C++ application that captures camera frames, sends them to a detection server, receives results, draws bounding boxes on frames, and displays live video stream in web browsers.
  • StreamVision-Server (separate repository): C++ application that receives encoded frames, decodes them, runs inference with YOLOv11/v12, and returns detection results to client.

Demo

A demo captured using YOLOV11s:

streamvision-demo


Architecture

Note: Application settings (Camera Device Index, Resolution, FPS, and Server Address, Port) are managed by ConfigXML singleton class, loaded once at startup.

┌─────────────────┐
│ CameraCapture   │ → Captures frames from camera
└────────┬────────┘
         ↓
┌─────────────────┐
│ FrameEncoder    │ → Encodes frames as JPEG
└────────┬────────┘
         ↓
┌─────────────────┐
│ FrameHandler    │ → Sends encoded frames/receives detections via ZeroMQ (REQ-REP pattern)
└────────┬────────┘
         ↓
┌─────────────────┐
│ JsonParser      │ → Parses detection results
└────────┬────────┘
         ↓
┌─────────────────┐
│ Drawer          │ → Draws bounding boxes and labels
└────────┬────────┘
         ↓
┌─────────────────┐
│ WebStream       │ → Streams MJPEG to web browser
└─────────────────┘

Dependencies

Library Version Purpose
OpenCV 4.12.0 Frame capture and image processing
ZeroMQ (libzmq) 4.3.5 Network communication
cppzmq 4.11.0 C++ bindings for ZeroMQ
nlohmann-json 3.12.0 JSON parsing
cpp-httplib 0.26.0 HTTP server for streaming
TinyXML2 11.0.0 XML configuration parsing
Doxygen Latest Documentation generation (optional)

Installation

Docker (Recommended)

The easiest way to build and run StreamVision-Client:

# Clone the repository
git clone https://github.com/yourusername/StreamVision-Client.git
cd StreamVision-Client

# Build Docker image
sudo docker build -t streamvision-client .

# Run container
sudo docker run -it --rm \
  --device=/dev/video0:/dev/video0 \
  --network host \
  streamvision-client

Note: --device=/dev/video0 mounts your camera. Adjust if using a different camera index.

You can check with v4l2-ctl --list-devices command

Manual Build

You can install dependencies by following the steps in the Dockerfile.


Usage

Quick Start

  1. Start the detection server (see StreamVision-Server repository)

  2. Configure the application by editing config/config.xml:

<Config>
    <Camera>
        <Index>0</Index>           <!-- Camera Device Index -->
        <Width>640</Width>         <!-- Camera Width -->
        <Height>480</Height>       <!-- Camera Height-->
        <FPS>30</FPS>              <!-- Camera FPS -->
    </Camera>
    <Server>
        <IP>0.0.0.0</IP>           <!-- Server IP address -->
        <Port>5555</Port>          <!-- Server port number -->
    </Server>
</Config>

Note:

  • Configure camera settings based on your device.
  • If changing server IP/port, update StreamVision-Server config accordingly.
  1. Run the client application:
./streamvision-client
  1. View the live stream in your browser:
http://localhost:8080/stream
  1. View the doxygen documentation in your browser:
http://localhost:8001

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published