Home

User`s Manual

image

Contents

1. ADVANS gt Embedded Electronics e Sequence of image files jpg png e Video file avi Image stream using Advansee s protocol e Webcam e Platform camera ov7962 on Seeklop and Mipsee 2 2 2 VideoSink on Seeklop only videoSinkSeeklop This module provides functions to output images to S VIDEO or TFT outputs of Seeklop s board 2 2 3 Advansee TCP Image Stream videoTcpFlow This module provides function to output images from Seeklop or Mipsee to a distant PC via Ethernet Due to limited resources on host platform or bandwith of Ethernet cable stream is limited to following performances for VGA images e jpeg image type 30FPS grayscale images 30FPS e color images 15 FPS 2 2 4 Command Protocol commandTcpServer This module provides functions to control Seeklop or Mipsee s applications by a distant PC 2 2 5 Special File Access advFileAccess Provides access to special files on Seeklop or Mipsee in order to control e leds e gyroscope e luminosity sensor 2 2 6 Synchronize advSynchronize Provides inter thread synchronization functions 2 2 7 Trace trace h Provides standard output method wrapper for printf that can be easily turned on or off at compile time using defines macro 2 3 HTML Documentation AdvLib source code is fully documented This documentation is available in HTML format in documentation directory To open AdvLib Source code documentation open file lib docume
2. a prefix including directory location an image number and an extension Images are decoded with opencv so many formats are supported at least bmp jpeg png Additionally to parameters described in 4 1 3 following variables of AdvVideoSource must be set e filename set images prefix e extName set images extension e start set first image number default 0 e stop set last image number default 10000 e stillFactor set to number increment to load one of X images default 1 4 1 3 4 Video File Source VIDEO _ SOURCE _VIDEO In this mode a video file is opened and images are extracted from this file Opencv is used to open the video file so many formats are supported Additionally to parameters described in 4 1 3 following variables of AdvVideoSource must be set filename complete video file name 4 1 3 5 Webcam Source VIDEO_SOURCE_WEBCAM Webcam is opened using v4l2 standard API and opencv Framerate is not settable in this mode Additionally to parameters described in 4 1 3 following variables of AdvVideoSource must be set filename device name usually dev video0 4 1 3 6 Advansee TCP stream Source VIDEO _SOURCE_TCP This mode will receive images sent using Advansee s TCP stream protocol Additionally to parameters described in 4 1 3 following variables of AdvVideoSource must be set filename server hostname ex mipsee000245 4 1 4 Example Allocate source struct AdvVideoSource vid
3. exit 1 Convert image to YUV420 type 12 bytes per pixel unsigned char imageConverted 640 480 3 2 adv convertRgb2Yuv420 myImage gt imageData imageConverted 640 480 1 if adv videoSinkDisplay videoSink imageConverted 640 480 3 2 eOK TRACE ERROR Ss Error in displaying frame _ func Image is displayed until a new image comes in or until sink is stopped In that case wait 10s then stop sleep 10 TRACE INFO s Stopping Video Sink func Document ADV_UM_9009_LibAdvansee_v1 1 ADVANSEE SARL 2012 2013 Tous droits r serv s page 11 ADVANS Embedded Electronics adv_videoSinkStop videoMg gt videoSink adv videoSinkFree videoMg gt videoSink Document ADV_UM_9009_LibAdvansee_v1 1 ADVANSEE SARL 2012 2013 Tous droits r serv s page 12 ADVANS gt Embedded Electronics 4 3 Advansee TCP Image Stream To use this module you need to include videoTcpFlow h to your code 4 3 1 Generalities Transfer images over network Images can be sent in sent in several formats Grayscale up to 30FPS in VGA Raw UYVY up to 10FPS in VGA Raw YUV420 or NV12 up to 15FPS in VGA Jpeg up to 30FPS in 720p This module creates a server listening on a specified port recommended use of macro STREAM_PORT to use port 5412 When clients connect to this port using server s machine hostname server starts sending dat
4. if TRACE LEVEL gt TRACE LEVEL DEBUG TRACE INFO Info message d n 1 will not be displayed if TRACE LEVEL gt TRACE LEVEL INFO TRACE FATAL Fatal error s n strerror errno ADVANS gt Embedded Electronics 5 Secondary Modules Description 5 1 Command Protocol To use this module you need to include commandTcpServer h to your code 5 1 1 Generalities Commands server for remote control of applications on Advansee s Seeklop or Mipsee Clients can send flags to the server On platform user can retrieve the value of flags at any time For each flag 2 bytes of data can be stored A message is made of 3 bytes in following order FLAG NB DATA 1 DATA 2 Where e __ FLAG NB is flag identification 0 31 e DATA_1 is the MSB of data e DATA_2 is the LSB of data After message reception server will answer following acknowledge message Oxff DATA 1 DATA 2 With DATA _1 and DATA _2 same as received Acknowledge only means that message has been completely received not necessarily understood Server will close connection after sending acknowledge message 5 1 2 Basic usage 1 Call function adv_startCommandServer e This function will start a thread listening for incoming messages e server will update an int variable with flags sent by clients User can ask the value of current flag
5. variable at any time using adv_getCommandFlag Last data sent by client is stored for each flag user can get its value with adv_getFlagData To reset the command flag use adv_resetCommandFlag Ot N Call function adv_stopCommandServer to stop the server thread and free memory 5 1 3 Parameters e Use defined macro FLAG to convert from int to flag mask e adv_getFlagData will return received data converted to an integer of the form 0x0000XXYY where XX is DATA_1 and YY is DATA_2 5 1 4 Example include commandTcpServer h define FLAG ONE 1 define FLAG TWO 2 define FLAG THREE 3 struct AdvServerData commandConf adv_startCommandServer 4305 if commandConf ASVANS Embedded Electronics TRACE ERROR Could not initialize command server exit EXIT_FAILURE Every second check flags and exit if FLAG ONE is received Print data associated with FLAG ONE int loop 1 while Loop sleep 1 Gt current flag int commands adv_getCommandFlag commandConf if commands amp FLAG FLAG ONE int data adv getFlagData commandConf FLAG ONE adv_resetCommandF lag commandConf FLAG ONE printf Received DATA for FLAG ONE is d data loop 0 adv_stopCommandServer commandConf 5 2 Special File Access To use this module you n
6. 0FPS videoSourceConf gt width 640 videoSourceConf gt height 480 videoSourceConf gt fps 30 ifndef PC On Seeklop or Mipsee set camera source on video0 videoSourceConf gt filename dev video0 videoSourceConf gt videoSourceType VIDEO SOURCE PLATFORM CAMERA videoSourceConf gt imageType FORMAT ADV JPG else On PC set video source to Tcp Stream videoSourceConf gt filename SEEKLOP HOSTNAME videoSourceConf gt videoSourceType VIDEO SOURCE TCP videoSourceConf gt imageType FORMAT ADV BGR endif T Init structures Ipl Image to receive color BGR IPL DEPTH 8U 3 NULL TRACE ERROR Memory allocation failed for s in s n grabFrame _ func return 1 Video Source if adv videoSourceInit videoSourceConf lt 0 TRACE ERROR Could not initialize video source n return EXIT FAILURE ifndef PC On mipsee or Seeklop Create Streaming server streamingConf adv_streamCreate STREAM PORT Streaming data structure dataHeader adv_streamCreateImageHeader videoSourceConf gt imageType videoSourceConf gt width videoSourceConf gt height videoSourceConf gt height videoSourceConf gt width 3 endif Go to next state TRACE INFO System Operationnal n OPERATIONAL STATE Perform image processing loop yd if grabFrame cv
7. ABBCC of SEEKLOP_HOSTNAME variable with your Seeklop s hostname Standard lib include lt stdio h gt include lt unistd h gt include lt getopt h gt include lt signal h gt include lt time h gt include lt sys time h gt Opencv include opencv cv h include opencv highgui h Advansee lib headers include trace h include videoSource h include videoTcpFlow h define SEEKLOP HOSTNAME seeklopAABECC int main int argc char argv Printi UFAAREAAAA RARE REREAEREREAEREREKERERRAERE RENIN printf Advansee n printf Template for Image Processing Project n printf n PEINEE UFAAPEARAA SAR ER RER RER KERRIE RE RER ERREUR ER EN NI Alloc structures and variables xy struct AdvVideoSource videoSourceConf adv_videoSourceCreate if videoSourceConf NULL TRACE ERROR Could not create video source n return EXIT FAILURE Iplimage grabFrame NULL struct timeval tv struct AdvStreamServer streamingConf NULL struct AdvStreamBuffer dataHeader NULL Frame counter int imageCnter 0 ADVANS Embedded Electronics RE PP RP a a a OP a ee POS PER Ls INIT STATE Initialize all variables E Vi Only called once at first execution ey SSS SSeS SSS Sa SS aaa SS Se SS a Sa a Sa ee Sea ae aa eee k TRACE INFO System Init n Set Camera Parameters VGA 3
8. ADVANS Embedded Electronics User s Manual ADVANSEE AdvLib R f rence Document ADV_UM_9009_LibAdvansee Auteurs E Pauchard R vision 1 1 Date Feb 13 2013 ADV_UM 1 3 20120608 ADVANSEE 9 rue Alfred Kastler CS30750 44307 Nantes cedex 3 France T l 33 0 2 4050 2173 Email contact advansee com www advansee com SARL au capital de 40 200 510 580 814 RCS Nantes SIRET 510 580 814 00034 TVAI FR 31 510 580 814 ASVANS Embedded Electronics Document history 1 0 Feb 13 2013 E Pauchard First release 1 1 Oct 4 2013 E Poirier Typo corrections Document ADV_UM_9009_LibAdvansee_v1 1 ADVANSEE SARL 2012 2013 Tous droits r serv s page 2 ADVANS gt Embedded Electronics Table of Contents A IMMPOGUCUION Hume En ne mt a en EEE Ni ara E E ods 3 2 Library Structure OV CIO Ws uen nn tinn lee tae diner te uit a lies oreien annee 4 2 BINAN CR ee 4 2 2 Modules Overview isa 5 2 3 HTML Documentatin ss atssnrssnnerneemneteeenpenenneiteitenentedrieen nimnnnnenananenereredenet tete 6 3 Dependencies sisareen e cannccesecacsnenessdayanauusdesstaenenes EA ans ententes 6 31 DU oi inna a nn na ie line ener 6 9 2 PACKAGES 1 ta ae desde hante es tant ee trees ia 6 4 Main Modules description 7 4 1 Video SOUNCE Lai ccccienesedecehisscccenactenesdanatalag naana iaa deana aeaa adana aaan oa 7 4 2
9. CreateImageHeader cvSize videoSourceConf gt width videoSourceConf gt height Document ADV_UM_9009_LibAdvansee_v1 1 ADVANSEE SARL 2012 2013 Tous droits r serv s page 21 ADVANS Embedded Electronics This state is called for each image processed using the while 1 loop am int exit 0 while exit Get Frame and check error code if adv_videoSourceGetFrame videoSourceConf grabFrame 0 TRACE INFO Image Capture Error n Try again break ifndef PC On Mipsee or Seeklop send image via TCP memcpy dataHeader gt imagePtr unsigned char grabFrame gt imageData grabFrame gt imagesize gettimeofday amp tv NULL adv streanNewData streamingConf dataHeader grabFrame gt imageSize amp tv NULL NULL endif ifdef PC On EC display image cvShowImage Test grabFrame char esc 1 esc cvWaitKey 33 if esc q exit 1 endif Increment image counter imageCnter CEREREA xx UNINIT STATE Release all memory allocated during Vs the init phase and exit program XX SEEE XX TRACE INFO System Uninit n release all structures adv videoSourceClose videoSourceConf ifndef PC adv streanClose streamingConf adv_streamReleaseImageHeader dataHeader endif cvReleaseImageHeader amp grabFrame printf Application Ends n en
10. Frame Document ADV_UM_9009_LibAdvansee_v1 1 ADVANSEE SARL 2012 2013 Tous droits r serv s page 9 ADVANS gt Embedded Electronics 4 2 Video Sink This module is only operational on Seeklop To use this module you need to include videoSinkSeeklop h to your code 4 2 1 Generalities This code provides functions to output images on Seeklop S VIDEO or TFT output Images are scaled color converted by IPU Image rotation is also available 4 2 2 Basic usage Create Video Sink Structure AdvVideoSinkSeeklop with adv_videoSinkCreate Manually fill structure parameters Initialize Video Sink with adv_videoSinklnit Send an image to the sink image will be copied to IPU s buffers with adv_videoSinkDisplay Stop video sink with adv_videoSinkStop On e 0O N Free video sink with adv_videoSinkFree 4 2 3 Parameters 4 2 3 1 Input image parameters e ImageType Advansee s input image color format see videoSource h o Following formats should be compatible FORMAT_ADV_YUV420 recommended FORMAT_ADV_NV12 FORMAT_ADV_RGB565 FORMAT_ADV_UYVY o To convert from a RGB image please consider adv_convertRgb2Yuv420 from VideoSource module see html documentation input width input image width in pixels e input_height input image height in pixels 4 2 3 2 Output image parameters image transform e crop_left crop pixels from left of input image e crop_right crop pixels from right of input image
11. Vide0 SINK arenen a a e Pitt ot an 10 4 3 Advansee TCP Image Stream 13 CAR AE OR EE a dae ER 0 15 5 Secondary Modules De scriphon ssssssnsesnsein centimes 16 5 1 Command Protocol dinientit desnebien lactis a E E acetates 16 5 2 Special File ACCESS iii 17 5 3 SYMCNLONIZAL ON 2x soisceksbessdacctn petewatedeees a ea aE a EEE EREE Eaa TEE 18 6 Complete Example sise 20 6 1 SOUrc Code MAIN Crossan here sure antenne alone tenue eee 20 6 2 Project compilation ss 23 6 3 Project testirana en aN E EE aAA E E teen tentes dt de 23 1 Introduction Advansee s library provides all elementary functions needed to capture images from Mipsee or Seeklop It provides portable code on all platforms so algorithm can be developed on PC and directly ported to MIPSEE or SEEKLOP making debug easier The main features of this library are e Portable code on PC Mipsee or Seeklop e Different video sources image files video file ov7962 e Image transmission using Advansee TCP format e Image display on Seeklop S Video or TFT Command server for distant interaction from PC The best way to use Advansee s library is within the Advansee s SDK providing a 100 preconfigured project environment Library structure is presented in section 2 you should have all the files listed in this chapter For a quick start with Advansee s library please refer to section 4 where you will find description of the most important modu
12. a First int sent will be for each frame ADV_MAGIC_NUMBER 0xAD1A15EE All values of header are converted to network endianness 4 3 2 Basic usage 1 2 3 4 5 6 Create Streaming Server AdvStreamServer using adv_streamCreate Create buffer AdvStreamBuffer using adv_streamCreatelmageHeader o AdvStreamBuffer includes allocated space for image data and Advansee s image header Copy your image to allocated space pointed to by AdvStreamBuffer gt imagePtr Send image over network using adv_streamNewData Close server to end image stream using adv_streamClose Release buffer using adv_streamReleaselmageHeader 4 3 3 Parameters 4 3 3 1 AdvStreamBuffer sheader Header structure can be updated for each frame imagePtr Pointer to memory allocated in adv_streamCreatelmageHeader function To reallocate this memory in case of dynamic image size change for example please use adv_streamUpdateStreamHeader see html documentation 4 3 3 2 AdvStreamHeader These parameters are initialized using adv_streamCreatelmageHeader all values are automatically converted to network endianness magic will always be the first integer transferred usadvformat Advansee s image format uswidth image width usheight image height dataSize number of bytes to allocate for buffer These parameters are updated for each new frame using adv_streamNewData all values are automatically converted to network endianness ADVANS Embed
13. all other capture parameters Initialize video source using this structure Retrieve as many frames as needed oak YN Close video source 4 1 3 Parameters 4 1 3 1 General parameters of video source structure These parameters of AdvVideoSource should be set for any video source type e width expected width default 640 e height expected height default 480 e imageType set to FORMAT_ADV_GRAY to load grayscale images otherwise opencv color BGR image will be loaded 4 1 3 2 Platform s Camera Source VIDEO_SOURCE_PLATFORM_CAMERA This video mode is recommended for use on Seeklop or Mipsee e filename device name usually dev video0 fps capture framerate possible values 30 15 10 6 5 3 2 1 e rotation rotation of image source supported values ROTATION_VFLIP on Seeklop ROTATION_VFLIP and ROTATION_HFLIP on Mipsee Note On Seeklop it is possible to use FORMAT_ADV_JPG to get jpeg compressed images from video source module Images are captured using camera compressed to jpeg using Seeklop s VPU and buffer is sent to user The buffer pointer is stored in provided Ipllmage s imageData parameter and buffer size is stored in provided Ipllmage s imageSize parameter see examples below ADVANS gt Embedded Electronics 4 1 3 3 File source Usage VIDEO _SOURCE_STILLS This video mode is recommended for use on PC In this mode images are sequentially loaded from a succession of images Images should be named using
14. cute application ssh root seekLopAABBCC mainSeeklop Start PC application and receive frames mainPC
15. d application return 0 main Document ADV UM 9009 LibAdvansee_v1 1 ADVANSEE SARL 2012 2013 Tous droits r serv s page 22 ADVANS Embedded Electronics 6 2 Project compilation Please create an executable file named compile sh and paste following text in it Set all variables in bold with correct path to indicated directory bin bash Directory containing Advansee s library headers LIBINCLUDEDIR Compile For PC Directory containing libadvansee a for PC LIBBINPCDIR gcc c DPC ISLIBINCLUDEDIR main c gcc o mainPc main o L LIBBINPCDIR ladvansee lpthread lopencv highgui lopencv imgproc lopencv core 7 7 Compile for Seeklop Directory containing libadvansee a for Seeklop LIBBINSEEKDIR Seeklop staging dir SYSROOT Seeklop compile toolchain CC arm advseeklop linux gnueabi CC gcc c DSEEKLOP ISLIBINCLUDEDIR sysroot SSYSROOT main c CC gcc o mainSeeklop main o sysroot SYSROOT LSLIBBINSEEKDIR lipu lvpu ladvansee lpthread lopencv highgui lopencv_imgproc lopencv core T 6 3 Project test Put main c and compile sh in same directory Execute compile sh to compile code Copy executable mainSeeklop to Seeklop platform using command replace seeklopAABBCC by your Seeklop hostname scp p mainSeeklop root seeklopAABBCC root Connect to your Seeklop platform in SSH and exe
16. d lum value int lum adv_readIntFromFile ASTRINGZ LUM if lum lt 0 printf Error in reading else if lum UINT MAX printf Error in number conversion else printf Luminosity is d n lum char rotation 16 if adv copyCharFromFile ASTRINGZ GYRO rotation 16 lt 0 printf Could not read gyroscopic value n else printf Rotation angles are s n rotation 5 3 Synchronization To use this module you need to include advSynchronize h to your code 5 3 1 Generalities Useful functions to synchronize different threads This module is needed by several other modules but can also be used directly by user Calling threads can be blocked until a specific signal is sent All blocked threads are then released sequentially 5 3 2 Basic usage 1 Create and initialize a synchronization structure using adv_synclnit Block for specific signal using adv_syncWaitEvent with a possible timeout When thread is released it will have ownership of synchronization mutex and should release it once not needed 4 To signal a flag use adv_syncNotifyEvent This will release all threads blocked on this flag 5 3 3 Parameters 5 3 3 1 AdvSynchroConf e mutexAccess this mutex is owned by the thread returning from adv_syncWaitEvent It should be manually released ADVANS Embedded Electronics 5 3 4 Example Initialize sync structure with defa
17. ded Electronics e usNumTrame frame counter e dataSize actual number of bytes of image data e Sec image timestamp number of seconds since epoch e MSec image timestamp number of milliseconds since epoch e cLuminosity string of 16 characters containing luminosity information not on all platforms e cPosition string of 16 characters containing gyroscopic information not on all platforms 4 3 4 Example include videoTcpFlow h include videoSource h include lt sys time h gt Create a streaming server struct AdvStreamServer streamingServer adv streanCreate if streamingServer NULL printf Error unable to create streaming server exit 1 Create an image data buffer structure with enough space to hold entire image data no verification performed struct AdvStreamBuffer dataBuffer adv_streamCreateImageHeader FORMAT ADV JPG 640 480 640 480 sizeof char 3 2 Use your usual function to read an image and retrieve a pointer to its data and its size may be varying ie for JPEG unsigned char myImg read an image file int dataSize get image size Copy image to your structure memcpy dataBuffer gt imagePtr mylmg dataSize T Set timestamp if not available NOTE need to include lt sys time h gt struct timeval tv gettimeofday amp tv NULL Send image if adv streanNewData streamingServer dataBuffer dataS
18. e crop_top crop pixels from top of input image e crop_bottom crop pixels from bottom of input image e rotate Image rotation see videoSource h 4 2 3 3 Output image parameters display e axis_left Left border of image axis on screen e axis_top Top border of image axis on screen e disp_width width of image on screen ADVANS Embedded Electronics e disp_height height of image on screen e tv_out Set to 1 to use S VIDEO output 0 to use TFT output e tv_mode 0 NTSC 1 PAL 2 720p 4 2 4 Example include videoSinkSeeklop h include trace h For image conversion include videoSource h Create and init video display pipeline struct AdvVideoSinkSeeklop videoSink adv videoSinkCreate if videoSink NULL TRACE ERROR Ss could not init sink _ func goto srcFail videoSink gt input width 640 videoSink gt input height 480 videoSink gt imageType FORMAT ADV YUV420 videoSink gt disp width 720 videoSink gt disp height 480 videoSink gt tv out tv out videoSink gt tv mode SEEKLOP SINK TV NTSC videoSink gt rotate ROTATION HFLIP T if adv videoSinkInit videoSink lt 0 TRACE ERROR s could not init sink _ func_ exit 1 load VGA image from jpeg IpliImage myImage cvLoadImage image jpg CV LOAD IMAGE COLOR if myImage TRACE ERROR Ss could not load image _ func
19. eed to include advFileAccess h to your code 5 2 1 Generalities On Seeklop access to green led red led and luminosity value On Mipsee with OV7962 access to green led red led gyroscopic and luminosity values On Mipsee with MT9M131 access to green led red led No gyroscope nor luminosity sensor To pass defined argument to functions please use ASTRINGZ macro to correctly expand values ex adv_writelntToFile ASTRINGZ LEDR 1 5 2 2 Basic usage 1 Specify which camera board you are using by defining OV7962 or MT9M131 before including advFileAccess h 2 For LED control use adv_writelntToFile e argument LEDG will control green led LEDR will control red led e On Seeklop writing 0 will turn led on 1 will turn led off e On Mipsee writing 1 will turn led on O will turn led off 3 To retrieve values from gyroscope use adv_copyCharFromFile e Allocate a buffer of 16 bytes e use adv_copyCharFromFile to copy value to this buffer incase of error buffer will be filled with 0 0 4 To retrieve values from luminosity sensor use adv_readintFromFile e incase of file error 1 will be returned ADVANS Embedded Electronics e in case of number conversion error UINT MAX will be returned 5 2 3 Parameters 5 2 4 Example On MIPSEE with OV7962 turn green led on and read luminosity and gyroscopic values define OV7962 include advFileAccess h Turn green led ON adv_writeIntToFile ASTRINGZ LEDG 0 Rea
20. eoSourceConf adv_videoSourceCreate if videoSourceConf NULL TRACE ERROR Could not create video source return EXIT FATLURE Set Camera Parameters for PLATFORM acquisition of VGA 30fps videoSourceConf gt filename dev video0 videoSourceConf gt videoSourceType VIDEO SOURCE PLATFORM CAMERA videoSourceConf gt width 640 videoSourceConf gt height 480 videoSourceConf gt imageType FORMAT ADV GRAY ADVANS Embedded Electronics videoSourceConf gt fps 30 init source with these values if adv_videoSourceInit videoSourceConf lt 0 TRACE ERROR Could not initialize video source return EXIT FAILURE Warning Init an opencv image HEADER if grabFrame cvCreateImageHeader cvSize videoSourceConf gt width videoSourceConf gt height IPL DEPTH 8U videoSourceConf gt imageType FORMAT ADV GRAY 1 3 NULL ALLOC_FATLURE grabFrame while 1 get image if adv_videoSourceGetFrame videoSourceConf grabFrame lt 0 TRACE INFO Image Capture Error localSystemState UNINIT break New image is available in grabFrame Use image as any Iplimage with Opencv cvCanny grabFrame grabFrame 100 200 3 Release Memory adv_videoSourceClose videoSourceConf cvReleaseImageHeader amp grab
21. ize amp tv lt 0 printf Error while streaming image Close server and release memory adv streanClose streamingServer release memory used by image header adv_streamReleaseImageHeader dataBuffer ous droits r serv s Document ADV_UM_9C ADVANS Embedded Electronics 44 Trace To use this module you need to include trace h to your code 4 4 1 Generalities Output messages to STDOUT Messages can be belong to different categories DEBUG INFO WARNING ERROR FATAL At compile time it is possible to exclude some message categories example exclude all DEBUG messages 4 4 2 Basic usage e Use TRACE DEBUG TRACE INFO TRACE WARNING TRACE_ERROR TRACE_FATAL instead of printf same arguments e At compile time define TRACE _ LEVEL to exclude all inferior categories from build o TRACE LEVEL _ DEBUG TRACE _LEVEL_ INFO TRACE_LEVEL WARNING TRACE _LEVEL_ERROR TRACE _LEVEL_ FATAL e In Advansee s SDK debug build defines TRACE LEVEL as TRACE _ LEVEL DEBUG e In Advansee s SDK release build defines TRACE _ LEVEL as TRACE _LEVEL_ INFO 4 4 3 Parameters 4 4 4 Example Do not display DEBUG nor INFO messages define TRACE LEVEL TRACE LEVEL WARNING include trace h For errno and strerror include lt string h gt include lt errno h gt TRACE DEBUG Debug message n will not be displayed
22. les of the library Section 5 presents modules of secondary importance Finally section 6 gives a complete example of Advansee s library usage ADVANS Embedded Electronics 2 Library Structure overview lib documentation t include advCommandProtocol h t advFileAccess h advSynchronize h commandTcpServer h trace h t videoSinkSeeklop h t videoSource h videoTcpFlow h libadvansee mipsee debug L libadvansee a libadvansee a f libadvansee pc debug L libadvansee a L libadvansee a f libadvansee seeklop debug L libadvansee a libadvansee a libadvansee v1 10 tar bz2 2 1 Binaries The Advansee Library has been compiled statically and the binary file is called libadvansee a Binaries are provided for 3 targets e PC x86 32bits e Seeklop Arm cortex A 8 e Mipsee Arm 11 For each target the binary is placed in the corresponding folder e libadvansee_mipsee binary for MIPSEE e libadvansee_seeklop binary for SEEKLOP e libadvansee_pc binary for PC For each target a debug version is provided in the debug directory This version outputs more info on stdout during execution of programs 2 2 Modules Overview 2 2 1 VideoSource videoSource h This module is used to capture images Same code is nearly 100 portable on all 3 targets mipsee seeklop and PC It is possible to get image from
23. ntation html index html 3 Dependencies The library has been compiled statically in C You need to have some packages on your computer in order to compile your programs with Advansee Library 3 1 Ubuntu AdvLib has been developped on Ubuntu ADVANS Embedded Electronics 3 2 Packages AdvLib needs the following packages to be installed pthread opencv 2 4 2 For Seeklop target AdvLib needs two additional librairies e libipu e libvpu These libraries are included in Advansee s SDK If you use the library in the SDK context it should not be a problem Document ADV_UM_9009_LibAdvansee_v1 1 ADVANSEE SARL 2012 2013 Tous droits r serv s page 6 ADVANS gt Embedded Electronics 4 Main Modules description 4 1 Video Source You need to include videoSource h to your source code to use this module 4 1 1 Generalities This module allows image capture from multiple sources Code using this module is nearly 100 portable on all Advansee s platform Seeklop Mipsee or PC All capture parameters are directly accessible in the video structure AdvVideoSource To retrieve image from video source e declare and alloc an IpllmageHeader structure e pass a pointer of this header to the adv_videoSourceGetFrame function e use this image as a standard Ipllmage opencv compatible 4 1 2 Basic Usage Create video structure Set video source type by setting videoSourceType variable Set
24. ult flags struct AdvSynchroConf strFlags adv_syncInit 0 if videoSource gt strFlags NULL Manage error From one thread block until the flag is signaled adv_syncWaitEvent strFlags FLAG ON 0 When control is gained don t forget to unlock mutex pthread mutex unlock amp strFlags gt mutexAccess Same example with timeout if adv_syncWaitEvent strFlags FLAG ON 1000 lt 0 1000ms Time out release mutex and leav pthread mutex unlock amp strFlags gt mutexAccess return 1 From an other thread signal a new flag adv syncNotifyEvent strFlags FLAG ON This will cause all threads calling adv waitEvent on specified flag to return as owner of the mutex release synchronization structure adv syncFree strFlags See http linux die net man 3 pthread cond signal for more information Document ADV_UM_9009_LibAdvansee_v1 1 ADVANSEE SARL 2012 2013 Tous droits r serv s page 19 ADVANS amp Embedded Electronics 6 Complete Example We will demonstrate the portability of Advansee s library by using nearly the same source code on Seeklop and PC On Seeklop it will capture an image compress it to JPEG and send it using Advansee s image stream protocol On PC it will receive this stream and display it on screen 6 1 Source code main c Create a text file named main c and paste following text in it Please replace seeklopA

Download Pdf Manuals

image

Related Search

Related Contents

Descarga - Hidrostal  American Standard 2425E-LHO User's Manual  Podadora Power PrunerTM  住宅情報盤 住宅情報盤  S2354_S2454 Service Manual  Manuel d`utilisation - Liste de pièces de rechange R2  DIN 6799 Crescent C ASS  LO280 - LO400 IDEA Series Light oil Burners  MANUAL DE INSTRUÇÕES Profibus-DP Junction Box DP  Pack `N Play®  

Copyright © All rights reserved.
Failed to retrieve file