Sep 14, 2015

[ Raspberry Pi2 ] OpenCV using Picam 4


This posting is using not still-shot but video.



copy camcv.c to RaspiVid.c 

Editing RaspiVid.c file. 
  1. We  delete- all lines related to the preview component,
  2. - all lines related to the encoder component.
  3. - all lines related to inline command parsing and picture info…
  4. We change :
  5. - add the callback directly to the video_port  (line 286)
  6. - create and attach the pool (to get/send message)  to the video port… (line 320)
  7. - change format encoding to ENCODING_I420 in line (268) (instead of OPAQUE)
But, recommend down load raspiVid.c file

and editing Line 489
  1. else if (!raspipreview_create(&state.preview_parameters))
  2. => else if ( (status = raspipreview_create(&state.preview_parameters)) != MMAL_SUCCESS)



rename raspiVid.c to camcv.c
(If you download above link, you getting camcv_vid0.c )
  1. mv RaspiVid.c camcv.c


build


RUN (using xrdp or rasberry pi x-window)
1
./camcv
cs

If you change color or gray and frame, see Line 124 and Line 119~120.

picam FPS in Pi 1

  • 320×240 color : FPS = 27,2
  • 320×240 gray : FPS = 28,6
  • 640×480 color : FPS = 8
  • 640×480 gray : FPS = 17

  • picam FPS in Pi 2

  • 320×240 color : FPS = 29.9
  • 320×240 gray : FPS = 29.9
  • 640×480 color : FPS = 24.3
  • 640×480 gray : FPS = 29.9
  • 1280x960 color : FPS=6.6
  • 1280x960 gray : FPS=15

  • maybe fps limit 29.9

    No comments:

    Post a Comment