OpenCV Programming the Raspberry Pi:Tutorial-8 Video Capture with C++ and Python

preview_player
Показать описание
OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code.
The library has more than 2500 optimized algorithms, which includes a comprehensive set of both classic and state-of-the-art computer vision and machine learning algorithms. These algorithms can be used to detect and recognize faces, identify objects, classify human actions in videos, track camera movements, track moving objects, extract 3D models of objects, produce 3D point clouds from stereo cameras, stitch images together to produce a high resolution image of an entire scene, find similar images from an image database, remove red eyes from images taken using flash, follow eye movements, recognize scenery and establish markers to overlay it with augmented reality, etc. OpenCV has more than 47 thousand people in their user community and an estimated number of downloads exceeding 7 million. The library is used extensively in companies, research groups and by governmental bodies.
The Raspberry Pi is a credit-card-sized single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools.
The Raspberry Pi has a Broadcom BCM2835 system on a chip (SoC), which includes an ARM1176JZF-S 700 MHz processor, VideoCore IV GPU, and was originally shipped with 256 megabytes of RAM, later upgraded to 512 MB. It does not include a built-in hard disk or solid-state drive, but uses an SD card for booting and persistent storage.
The Foundation provides Debian and Arch Linux ARM distributions for download. Tools are available for Python as the main programming language, with support for BBC BASIC (via the RISC OS image or the Brandy Basic clone for Linux), C, Java and Perl.

Рекомендации по теме
Комментарии
Автор

you helped us a lot... we've to work with the raspberry pi in university... your tutorials are very easy to follow and to understand, thanks for that

RocknRollFairy
Автор

Thank you for your tutorial! I have to make a 6-legged robotic spider able to detect balloons and puncture them :d

Sintaxx
Автор

Great video, I wish you could do one using the picamera

IsraelAgyemanPrempeh
Автор

Hello my friend. (sorry for bad english) I'm working in a project whre i want to detect peoples in video images...i dont want record the video...just detect and count the number of peoples on the image. Im using a raspicam, and i cannot open it, do you have a tutorial where you teach the same thing of this video, but using the raspicam?

sergiolenoo
Автор

Another great video, thank you!! Could you explain how to do the same with the raspberry pi camera, I have downloaded raspicam library but am unsure how to link the library's.

Thanks in advance.

Mh-oo
Автор

Hello Francesco,

I am currently working on OpenCV(C++) project. I get exactly same error messages of "Corrupt JPEG data: extraneous bytes before marker". Do you know what is the reason for that and how to solve it?

Thanks

korml
Автор

Hi Francesso, I connect to my pi using ssh, putty and xming. I can run the opencv samples with a usb web cam but I haven't tried using tha raspicam yet. The code I'm using is c++. I will take a look at your link. Thanks

Mh-oo
Автор

Hello Francesco, I need an advice. I have never used opencv before now. Today I have done some projects, learning from your videos. The problem is that I understand (not all) the code but if I wanna create a project from 0, I can't, because I don't know how opencv works. Can you advise me a book for beginner? Is the book on the video good for that? Thanks. PS I use C++ and C.

break
Автор

By the way, there is something wrong with the links to all the source codes on your website. Source codes for tutorial 7, 8 and 9 are all pointing to the source code of tutorial 6. Oh well, I can just type it over from the video but thought I'd let you know!

Sintaxx
Автор

Dear Francesco Piscani,
Thanks for great tutorials! I'm using logitech 270c camera but speed very slow.So, i change to pi camera module but i have some problem when load video from camera. 
Have you worked on pi camera?
Regards!

TuanNguyenChanel
Автор

Hello Francesco, great tutorials. I'm using the c++ API. When I use:
VideoCapture cap(0);
cap >> frame;
imwrite("im1.jpg", frame);
about 50% of the times I get a sort of cropped image, and noisy. Do you know why this might be? Is the raspi not quick enough to decompress the webcam frame?
Anyone that can shed some light can help.

miguellorenzo
Автор

Hi Francesco Piscani ,
Thank you again for you great tutorials and your last answer! I am moving my OpenCV project (C++) to my new Raspberry Pi2, which has a 900MHz quadcore CPU. I wanted to ask you, before running make to compile opencv, is it necessary to enable TBB support in order to take advantage of the multiple cores of the CPU, and therefore achieving significantly better performance, in terms of speed of execution? So far I failed to enable TBB, but if you tell me that openCv will somehow make advantage of the multi cores anyway, then I won't spend time trying to enable it right now. However, if you think there's a significant increase in performance to gain, how do you enable it? running "sudo apt-get install libtbb-dev" doesn't work anymore, and people get this error:

Package libtbb-dev is not available, but is refered to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libtbb-dev' has no installation candidate.

Thanks again for your great help,

Simon

simonguiroy
Автор

Hello, when i use the python code i get a message : 'cannot connect to X server'. What can I do about this sir?

ravenmooore
Автор

Nice tutorial sir. I am currently working on a project that requires me to play and process a video. I can easily do this in windows using c++ and opencv. However, once i use my code and build it in pi, nothing happens. Simply put, I cannot open and play videos in raspberry pi. Do i need to install something in order to play videos? omxplayer plays videos in my pi. Please help and Thanks :)

jekku_GG