How to combine two codes for real-time object detection on digital camera

Dear All:
In order to perform a real-time object detection, I connected a Canon digital camera via usb to a Raspberry Pi 2 platform. Then I installed Gphoto2. Now, I got two separate files which are built and perfectly work via two separate builders. However, I cannot combine them for the above purpose; and I want you, experts, to resolve this problem for me, as follows:
1- First one is a C program based file that captures several images and send to the Raspberry Pi. This file is built on Terminal by:
gcc –o filename filename.c –lgphoto2
(Reference: http://sepharads.blogspot.com.tr/2011/11/camera-tethered-capturing-using.html )
2- The second one is a c++ program based file that captures video from a webcam for video analysis by OpenCV. This file is built by CMakeLists.txt.
(References:
http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html
http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html )
I need to have a single file capable of both abovementioned jobs, except I need video (GP_CAPTURE_MOVIE) rather a sequence of images. The operating system is Debian Jessie.
(References: http://www.gphoto.org/doc/api/gphoto2-camera_8h.html#a6a66768c14ce761d6810f64572c79ec1afa8c68bfa3fa365ad562ca6929e6cee7 ).
Thank you in advance.
Cheeeers.
Topic archived. No new replies allowed.