Home

PUMA2-- Short User Guide

image

Contents

1. PUMA Short User Guide Detlev Droege 21 11 2007 Arbeitsgruppe Aktives Sehen AGAS Institut f r Computervisualistik Universit t Koblenz Landau Universit tsstra e 1 56070 Koblenz droege uni koblenz de http www uni koblenz de droege Inhaltsverzeichnis 1 Introduction El o ce AR 2 Creating applications with PUMA2 2 1 Makenle 4 4 080 rr a Pa ee bu 22 POB 254 Keen Bea are 2 3 Using the prabber library cea 26856604 oe an a aa Ee A a oo 3 Documentation Ruy w a Document history Aukor 21 112007 DD inimalvenion 30 11 2007 DD added sample code 1 Introduction This document describes the basic usage of PUMA2 that is the end user perspective to the packages provided e g as RPM packages These contain libraries and header files to develop applications based on PUMA2 The term end user is meant from the perspective of the PUMA2 developer team In this sense end users are those developers using the PUMA2 Libraries to develop their own applications 1 1 Prerequisites Currently PUMA2 packages are distibuted as RPM files only Following packages are available currently libpuma2 This is the core library and must be installed in any case to develop PUMA2 based applications It provides the basic image classes and a limited number of image operations Currently this package requires the presence of ImageMagick OpenCV libpng and libjpeg libpuma2grabber This package pro
2. ageRGB8 An example include lt ColorImageRGB8 h gt include lt ImageWriter h gt include lt ImageReader h gt using namespace Puma2_NS int main int argc char xargv ColorImageRGB8 cinto 0 std string cfilename some image jpg ImageReader readImage cin cfilename int pleft cin getWidth 4 int pright 3xcin getWidth 4 int ptop cin getHeight 4 int pbottom 3xcin getHeight 4 for int y ptop y lt pbottom y cin y pleft 0 255 cin y pleft 1 0 cin y pleft 2 0 cin y pright 0 Os cin y pright 1 255 cin y pright 2 0 for int x pleft x lt pright x cin ptop x 0 255 cin ptop x 1 gz cin ptop x 2 255 cin pbottom x 0 255 cin pbottom x 1 255 cin pbottom x 2 De ImageWriter writelmage cin marked image png 2 3 Using the grabber library To capture images from live cameras the PUMA2 extension library 1ibpuma2grabber is used After installing this additional package the following code should grab 50 frames from one of the attached cameras you have to answer interactively which one to use Store the following C source code as simpleGrabber cpp TKK KK RR RK RK ARA ROR RR OR RR RA RARA RARA a simple demo application using the puma2grabber to read some frames into puma2 color images and write x them to disk x Author Benjamin Knopp lt bknopp uni koblenz
3. de gt OK IK KK KK OK OK OK OK OK HH OK OK OK OK OK OK OK OK U KK RK KKK include GrabbingDeviceManager h include GrabbingDevice h include lt ColorImageRGB8 h gt include lt ImageWriter h gt using namespace Puma2_NS 2 3 Using the grabber library 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 using namespace std grab a maximum of 15 frames per second static const float FPS 15 0 static const int NUM_FRAMES 50 int main int argc char xargv get instance of GrabbingDeviceManager GrabbingDeviceManagerx myManager GrabbingDeviceManager getGrabbingDeviceManager check if supported devices are present if myManager gt getNumDevices cerr lt lt no supported devices found sorry lt lt endl return EXIT_FAILURE list all supported devices myManager gt printDevicelist unsigned int devNum myManager gt getNumDevices 1 while devNum gt myManager gt getNumDevices cout lt lt pleas nter device number lt lt endl cin gt gt devNum GrabbingDevice myCam connect to GrabbingDevice bool camFound myManager gt connectGrabbingDevice amp myCam devNum if camFound return EXIT_FAILURE
4. myCam gt printFormatsList choose first camera format which could be converted to rgb myCam gt setFormat2 width height in out RGB start capture process myCam gt startCapture puma2 rgb image ColorImageRGB8 image string filename capture NUM_FRAMES frames for int i 0 i lt NUM_FRAMES i usleep int 1000000 0 FPS should be minus grabtime try to grab image and write it to disk if myCam gt grablmage image cout lt lt b b lt lt toString i lt lt flush filename frame_ toString i Jpg WARNING writing png to disk is SLOW ImageWriter writelmage image filename c_str stop capturing process myCam gt stopCapture delete myCam return EXIT_SUCCESS 79 For the makefile with respect to the one shown in section 2 1 itis sufficient to change the pkg config package parameter to libpuma2grabber as this will automatically include 1ibpuma2 and other libraries needed as well 00 JD Bon Rh tle ill ood WNr oo INCPATH shell pkg config cflags libpuma2grabber LIBPATH shell pkg config libs libpuma2grabber CXXFLAGS LDFLAGS g 02 S INCPATH g LIBPATH all simpleGrabber simpleGrabber simpleGrabber o S CXX simpleGrabber o LDFLAGS CXXFLAGS o simpleGrabber clean rm simpleGrabber simpleGrabber o 3 Documentation is currently very poor Plea
5. se refer to the doxygen generated API description at http www uni koblenz de puma doc
6. vides access to live video data Based on the UniCap library it allows the use of cameras attached via FireWire USB or specialized capture hardware Obviously all required packages have to be installed using the usual mechanisms rpm or some high level package management tool like Yast2 The standard development tools expected are the GNU C compiler suite g and the GNU make program 2 Creating applications with PUMA2 2 1 Makefile Unless an integrated development environment is used which normally create makefiles on their own the usage of makefiles for controlling the code generation is highly recommended As PUMA2 provides the necessary information for the increasingly common tool pkg config writing makefiles is is quite simple CXXFLAGS shell pkg config cflags libpuma2 LIBS shell pkg config libs libpuma2 SRC minidemo cc OBJS SRC cc 0 demo OBJS CXX o S CXXFLAGS OBJS S LIBS Be sure to check that the indented command lines in the Makfile start with a TAB character not with a series of blanks Inttp unicap sf net 2 2 Program 4 0 DURA UU UY UY 0UY Y YY UY NN DN DD NN DD Dy e e a a RRR Re XAO UubhUNROvDOO JJ PRUODHODOo Sa 4uYRSRAoNnNR rOowwoN DO a un Ri BunN oOowwo 2 2 Program The C program your write of course has to include some header files like image classes and operations In most cases for now you will use GrayLevelImage8 or ColorIm

Download Pdf Manuals

image

Related Search

Related Contents

Installation av ParaSol  1734-TD002B-EN-P, POINT I/O Technical Data  0973_8262_06_DE EN ES FR IT NL PT SV  User`s Manual - Manual del Usuario  Access Control Database User Manual  LH-3500A Series MANUEL D`UTILISATION (FRANCAIS)  FLaT ToP Tower CraNe  音声メールユニット 取扱説明書 - NTT東日本 Web116.jp  . RF17N/H Series - Marmon  Mode d`emploi Vacanciers  

Copyright © All rights reserved.
Failed to retrieve file