Code Monkey home page Code Monkey logo

rpi-opencv's Introduction

Altax

rpi-opencv

Test scripts for using openCV with python, all scripts designed to work on a raspberry pi, but will work on Mac's and Linux.

rpi-opencv-python-noir

Video demo:

Drone Color tracking

Performance:

The performance tests for the color tracking algorithms was performed using a Raspberry Pi NoIR Camera, fixing the resolution at 640x480 pixels and finding the colour white (light emitted using infra-red LEDs).

Color 1 Color 2 Color 3 Color 4 Color 5 Color 6
RPI 2 0.20s 0.21s 0.165s 0.15s 0.15s 0.15s
RPI 3 0.17s 0.17s 0.129s 0.124s 0.12s 0.12s

rpi-opencv-tests

What do you need?

  • Raspberry pi (I'm using a RPI 2 and RPI 3)
  • Camera module (I'm using the NOIR camera)
  • USB webcam (I'm using a logitech pro 9000)
  • wifi dongle for the rpi or ethernet (duhhh)

How?

The first thing to do is to find out that everything is working...

Your rpi must be connected to internet, and updated...

sudo apt-get update
sudo apt-get upgrade

Install the essentials:

sudo apt-get install python-wxgtk2.8 python-matplotlib python-opencv python-pip python-numpy

Then, plug the webcam and check is working using this nice app:

sudo apt-get guvcview

If you can see video, then everything is ok, we can proceed to check the other camera module, go ahead and plug it to the CSI port of your rpi, then make sure the camera module is enabled using the configuration tool of the rpi :

sudo raspi-config

-- You may have to reboot your rpi if it wasn't enabled.

Test this module using this command:

raspivid -t 0

If you see video, then we are good!! :)

Important...

The rpi camera module is accessed via the MMAL and V4L apis... this means that we cannot use it as a webcam, but if we run this command we will able to use this great camera module as a webcam and with this examples.

sudo modprobe bcm2835-v4l2

Then pick one of the testing scripts and have fun!!

Important!! This code is not enterely mine, its copy-pasted from different codes found on the internet, I just made them easier to read and change and because I'm lazy and I prefer to code in my mac than in the rpi and github its a great way to put code inside the rpi ;)

Working on rpi!

ss-opencv-python

Working on mac!!

mac-opencv-python

rpi-opencv's People

Contributors

alduxvm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.