OpenCV Tutorial: Multiple Object Tracking in Real Time (1/3)
Why Stack Overflow recommends it
Stack Overflow users link it as a practical starting point for color-based object tracking in OpenCV, and many askers say they built their own projects from its code.
Recommended by 2 people across 2 different months, 2013 to 2016.
What it is
A 17-minute C++ OpenCV tutorial by Kyle Hounslow, part one of three, extending his single-object tracker to detect and track multiple colored objects from a webcam stream using HSV thresholding, contours and image moments. Source code is linked from GitHub.
What people said
Recommends user3061694 · 2014-04 · Stack Overflow · on “openCV Animal (mice) Recognition”
Given the mice are white if you were to track them on a counter of a different colour, say a solid colour, a relatively easy approach would be to use opencv's cvtColor(src,dst,COLOR_BGR2HSV); and then find the min and max HSV values of your mice on the given background. Threshold the output to a binary image using inRange , white being your mice and black being your background, and use findCountours and the moments method to locate your mice and track them. Source and full tutorial: link [this video] Disclaimer:This is not my video, all credit to the author of the channel.
Recommends tektok tek · 2016-03 · Stack Overflow · on “Background subtraction + MOOSE filter”
Background subtraction will return a binary image that contains black and white pixels. By detecting the center of the white contour you can draw a rectangle around the center. The width and height will depend on the contour size. There are a lot of algorithms, but this YouTube video [this video] can provide you with a function to get the center of the contour and draw whatever you like around of it.
Cites user2763236 · 2013-10 · Stack Overflow · on “Webcam freezes when I send Serial data”
Im using openCV with an arduino. My code tracks objects just fine and when a object is found it sends the arduino a message to send out an HIGH signal. The thing is my code works and I am able to see the webcam feed and track desired objects. But the problem is that when I send serial data from my code (computer) to an arduino UNO the webcam freezes. I'm pretty sure that i'm interrupting the camera feed somehow, but i'm using different USB plugs on the same computer. The camera is 30Hz, 1.3MP. So i'm thinking that i am interrupting some byte packages from the webcam by sending randomly out signals from the USB to the arduino. Which freezes the webcam feed. I'm using this for serial communica
Cites Marcelo Borges · 2014-06 · Stack Overflow · on “Adaptation in a script for OpenCV (Raspberry PI)”
I've been working in an adaptation of a tutorial I've been following: [this video] This tutorial shows how to make multiple object tracking using OpenCV through a camera, but on Windows. I did this in my Pi and it's working fine, how it was supposed to be. Now I'm trying to adapt this for a project I'm working. This project I'm working aims to track the movement of chickens in a farm, and given their coordinates we would analyze the movement during the day and study their behavior with a lot of other factors (temperature, moisture, food, etc). The difference is that now I want to make the tracking on pictures taken by my Raspicam every 10 minutes, to generate less processing and unnecessary data.
Cites Jonas Martinsson · 2015-02 · Stack Overflow · on “OpenCV Get 360 degree rotaion from T shaped body”
Of course! Just snippets or the whole thing? The base of the code is taken from this tutorial [this video] The pca analasys comes from an example in OpenCV. Which part of the code is the interesting one?
Cites DMEM · 2015-04 · Stack Overflow · on “Error compiling an OpenCV project with CMake”
I followed this tutorial [this video] trying to create some OpenCV project. It worked great in Windows and Visual Studio but then I tried to run it in my Ubunto VM using CMake by using the following CmakeLists.txt: cmake_minimum_required(VERSION 2.8) project( TrackObj ) find_package( OpenCV REQUIRED ) add_executable( TrackObj Source.cpp Fruit.cpp Fruit.h) target_link_libraries( TrackObj ${OpenCV_LIBS} ) When I run cmake . it seems like everything is fine: vm@vm-ubuntu:~/Desktop/TrackObj$ cmake . -- The C compiler identification is GNU 4.8.2 -- The CXX compiler identification is GNU 4.8.2 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detectin