Giter Site home page Giter Site logo

cameraboardapi's Introduction

RaspiCam and RaspiVid project

How to build:

Create a new directory for build, then run cmake and make

mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig

How to initialize /dev/video0 to have the camera stream

Installing UV4L (also accessible here: http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=14)

wget http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc && sudo apt-key add ./lrkey.asc
deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy main
sudo apt-get update
sudo apt-get install uv4l uv4l-raspicam

To initialize /dev/video0 with realtime scheduling, a 640x480 image size, YUV420 encoding, a blurring effect, auto whitebalance off, and the framerate capped at 30fps.

sudo uv4l --sched-rr --driver raspicam --auto-video_nr --width 640 --height 480 --encoding yuv420 --nopreview --imgfx blur --awb off --framerate 30

If you want to destroy /dev/video0 and re-create it, run this command and then re-initialize it by running the command above.

sudo pkill uv4l

How to run the RaspiCam test program:

This test program shows a little bit about how to use the slower but more functional RaspiCam API.

cd build/utils
LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so ./camera_test

How to run the RaspiVid test program:

This test program shows a little bit about how to use the much faster RaspiVid API that would work better for fast video processing applications.

cd build/utils
LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so ./video_test

How to build and run the example program:

The example program uses the RaspiVid API to grab 100 frames and do some OpenCV processing.

# Copy library files from when the project was built
cd examples
cp ../build/src/lib* ./

# Compile example program
g++ -L/usr/lib/uv4l/uv4lext/armv6l -I ../src/ -L ./ -lraspicam -luv4lext -Wl,-rpath,'/usr/lib/uv4l/uv4lext/armv6l' `pkg-config --cflags opencv` `pkg-config --libs opencv` -o FindContours FindContours.cpp

# Run example program
LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so ./FindContours;

Possible Problems:

  • If you are using Memory Mapping (RaspiVid::METHOD_MMAP) then when you run the program you must be sure to specify LD_PRELOAD before you execute.
  • If the framerate appears spurratic or very slow, make sure you initialized the UV4L driver with --sched-rr
  • If the camera won't start up at all, make sure you are supplying at least 5V at 1.0A to the Raspberry Pi.``

cameraboardapi's People

Contributors

rmsalinas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cameraboardapi's Issues

Add raw encoding option

Add the encoding for a raw image (such as RGB, RGBA, etc) in addition to the encodings already supported (JPEG, GIF, PNG, BMP).

Black images as well

I am having the same issue, i tried with another API and everything is normal, but with this one i'm only getting black images.

On fast capture

Hi,
I've playing a bit with userland code (without success at the moment).

Our current code is slow because uses still mode. The idea should be to use video mode and using a rgb encoder instead. This would allow to have a 30/60fps camera, which I think is the objective. I have not succeeded yet though in connecting the video output to the still encoder. In addition, in video mode we can not set JPEG or RGB encoders :(

Error while executing FindContours

I've successfully made your library work and modified it to start implementing my own CV stuff, but your the contour example doesn't work for some reason.

I executed the example program just as instructed in the readme, compilation goes well, no errors whatsoever, but I get this error when I try to launch it with ./FindContours:

./FindContours: error while loading shared libraries: libraspicam.so.0.0: cannot open shared object file: No such file or directory

I have the following files in the example folder: libraspicam.so, libraspicam.so.0.0, libraspicam.so.0.0.1, all of them take 789652 bytes, and also FindContours.cpp and the compiled FindContours file.

I have already defined LD_PRELOAD beforehand.

I've tried some solutions I've found here and there, but no luck so far. Can you give me a push?

I sincerely appreciate the way you've documented this library, that's some quality work one can start building on.

Got black imagens

I was using this API for a couple weeks but after some updates on rasp the images become black. Using "raspistill -v - o test.jpg" the imagens are normal, but when i use a simples " ./video_test" or look at imagens from example all of than are comming black. Any solution?

Capture is not good

Hi, I've just added an opencv camera module.

I've been testing the camera and the results are not comparable to original raspistill in my opinion.

First, capture is very slow(0.5fps). I have worked on changing the STILLS_FRAME_RATE_NUM and set it to 15, but I have obtained no difference. When I use jpeg in camera_test, it seems to run a bit faster.

In addition, I see the images generated to be different from these obtained by raspistill, the later seems brighter.

Problem in image generated

Hi,
i've just find out that the iamges generated and saved to file are nothing but zeros. As I see, this is happening even in your original code. I have ust noticed now that I have tried to see the images generated. Could you please confirm that the initial version captured images?

Cheers,
Rafa

Get camera picture in colour

I'm terribly sorry for a probably extremely easy question, but how does one get colour pictures with this API?

In the FindContour example I've tried to naively replace UV_8U1 with UV_8U3 and to my surprise it compiled, but then it throws a segfault, so currently I'm stuck with grayscale images and I would like to detect specific colours.

Add README

Describe the project in some way with a README file.

images go t black

Hi Josh,

I've been testing your changes. Good idea to add take_picture!

Nevertheless, I can not get good results when capturing. When I run the test, the first image obtained is very dark. However, the rest of the images are completely black. I've check that it is not because take_picture, it is always the first image very dark, and the rest in black. (No matter if I use BMP or JPEG, get the same result).
I've been playing around with iso, brightness and exposure values, but I did not succeed.
When I try with raspistill, the images are ok. I have put the images for you to check at https://dl.dropboxusercontent.com/u/89571862/images.zip

Cheers,
Rafa

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.