Commits

iorodeo committed ce1e906

Worked on bias low level api demo.

  • Participants
  • Parent commits 0bd9713

Comments (0)

Files changed (10)

File src/backend/fc2/camera_device_fc2.cpp

             throw RuntimeError(ERROR_FC2_UNSUPPORTED_VIDEO_MODE, ssError.str());
         }
 
-        if (1) // Print format7 information for selected mode
+        if (0) // Print format7 information for selected mode
         {
             printFormat7Info_fc2(format7Info);
             unsigned int test0 = format7Info.pixelFormatBitField & FC2_PIXEL_FORMAT_RAW8;
         if (format7Info.pixelFormatBitField & FC2_PIXEL_FORMAT_RAW8)
         {
             pixelFormat = FC2_PIXEL_FORMAT_RAW8;
-            std::cout << "pixelFormat = FC2_PIXEL_FORMAT_RAW8" << std::endl;
+            //std::cout << "pixelFormat = FC2_PIXEL_FORMAT_RAW8" << std::endl;
         }
         else if (format7Info.pixelFormatBitField & FC2_PIXEL_FORMAT_MONO8)
         {
             pixelFormat = FC2_PIXEL_FORMAT_MONO8;
-            std::cout << "pixelFormat = FC2_PIXEL_FORMAT_MONO8" << std::endl;
+            //std::cout << "pixelFormat = FC2_PIXEL_FORMAT_MONO8" << std::endl;
         }
         else
         {
             throw RuntimeError(ERROR_FC2_INVALID_FORMAT7_SETTINGS, ssError.str());
         }
 
-        if (1)  // Print packet info
+        if (0)  // Print packet info
         {
             printFormat7ImageSettings_fc2(imageSettings);
             printFormat7PacketInfo_fc2(packetInfo);
             ssError << ": unable to get FlyCapture2 format 7 configuration"; 
             throw RuntimeError(ERROR_FC2_GET_FORMAT7_CONFIGURATION, ssError.str());
         }
-        if (1) // Print current configuration settings
+
+        if (0) // Print current configuration settings
         {
             printFormat7Configuration_fc2(imageSettings,packetSize,percentage);
         }

File src/test/CMakeLists.txt

-cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
-
-if(with_fc2)
-    project(bias_test_fc2)
-    add_executable(test_fc2 test_fc2.cpp)
-    target_link_libraries(test_fc2 ${bias_ext_link_LIBS} bias_camera_facade)
-
-endif()
-
-if(with_dc1394) 
-    project(bias_test_dc1394)
-    add_EXECUTABLE(test_dc1394 test_dc1394.cpp)
-    target_link_libraries(test_dc1394 ${bias_ext_link_LIBS} bias_camera_facade)
-endif()
-
-

File src/test/bias_demo.cpp

+#if defined(WIN32) || defined(WIN64)
+#define _CRT_SECURE_NO_WARNINGS		
+#endif
+
+#include <iostream>
+#include "camera_facade.hpp"
+
+using namespace bias;
+
+int main(int argc, char** argv)
+{        
+
+    const float frameRate = 10.0;
+    const unsigned int numberOfFrames = 100;
+
+    std::cout << std::endl;
+    std::cout << "---------" << std::endl;
+    std::cout << "BIAS Demo" << std::endl;
+    std::cout << "---------" << std::endl;
+
+
+    // Find attached cameras
+    // -----------------------------------------------------------------------------
+    std::cout << "searching for cameras ... ";
+
+    CameraFinder camFinder;
+    CameraPtrList camPtrList = camFinder.createCameraPtrList();
+    if (camPtrList.empty())
+    {
+        std::cout << "no cameras found." << std::endl << std::endl;
+        return 0;
+    }
+
+    std::cout << camPtrList.size() << " cameras" << std::endl;
+    for (CameraPtrList::iterator it=camPtrList.begin(); it!=camPtrList.end(); it++)
+    {
+        CameraPtr camPtr = *it;
+        std::cout << "guid: " << camPtr -> getGuid().toString() << std::endl;
+    }
+
+
+    // Connect to first camera found
+    // -----------------------------------------------------------------------------
+    std::cout << "connecting to first camera ... ";
+
+    CameraPtr camPtr = camPtrList.front();
+    try
+    {
+        camPtr -> connect();
+    }
+    catch (RuntimeError &runtimeError)
+    {
+        std::cout << "error: " << runtimeError.what() << std::endl << std::endl;
+        return 0;
+    }
+    std::cout << "done" << std::endl;
+
+    // Print camera info
+    std::cout << "model:  " << camPtr -> getModelName() << std::endl;
+    std::cout << "vendor: " << camPtr -> getVendorName() << std::endl;
+
+    // Set camera videomode, trigger type, and framerate
+    // -----------------------------------------------------------------------------
+    std::cout << "setting videoMode to Format7 and trigger to internal ... ";
+    try
+    {
+        camPtr -> setVideoMode(VIDEOMODE_FORMAT7);
+        camPtr -> setTriggerInternal();
+    }
+    catch (RuntimeError &runtimeError)
+    {
+        std::cout << "error: " << runtimeError.what() << std::endl << std::endl;
+        return 0;
+    }
+    std::cout << "done" << std::endl;
+
+    std::cout << "setting framerate to " << frameRate << " fps ... ";
+    try
+    {
+        PropertyInfo  frameRateInfo = camPtr -> getPropertyInfo(PROPERTY_TYPE_FRAME_RATE);
+        Property frameRateProp = camPtr -> getProperty(PROPERTY_TYPE_FRAME_RATE);
+        frameRateProp.absoluteControl = true;
+        frameRateProp.absoluteValue = frameRate;
+        frameRateProp.autoActive = false;
+        camPtr -> setProperty(frameRateProp);
+        frameRateProp = camPtr -> getProperty(PROPERTY_TYPE_FRAME_RATE);
+    }
+    catch (RuntimeError &runtimeError)
+    {
+        std::cout << "error: " << runtimeError.what() << std::endl << std::endl;
+        return 0;
+    }
+    std::cout << "done" << std::endl;
+
+    // Start image capture
+    // -----------------------------------------------------------------------------
+    std::cout << "starting image capture ... ";
+    try
+    {
+        camPtr -> startCapture();
+    }
+    catch (RuntimeError &runtimeError)
+    {
+        std::cout << "error: " << runtimeError.what() << std::endl << std::endl;
+        return 0;
+    }
+    std::cout << "done" << std::endl;
+
+    // Grab images 
+    // -----------------------------------------------------------------------------
+    std::cout << "grabbing images" << std::endl;
+    for (unsigned int i=0; i< numberOfFrames; i++)
+    {
+        std::cout << " frame " << i << " ... ";
+        cv::Mat image = camPtr -> grabImage();
+        std::cout << "done" << std::endl;
+    }
+
+    // Stop image capture
+    // -----------------------------------------------------------------------------
+    std::cout << "stopping image capture ... ";
+    try
+    {
+        camPtr -> stopCapture();
+    }
+    catch (RuntimeError &runtimeError)
+    {
+        std::cout << "error: " << runtimeError.what() << std::endl << std::endl;
+        return 0;
+    }
+    std::cout << "done" << std::endl;
+
+
+    // Disconnect from camera
+    // -----------------------------------------------------------------------------
+    std::cout << "disconnecting camera ... ";
+    try
+    {
+        camPtr -> disconnect();
+    }
+    catch (RuntimeError &runtimeError)
+    {
+        std::cout << "error: " << runtimeError.what() << std::endl << std::endl;
+        return 0;
+    }
+    std::cout << "done" << std::endl;
+    std::cout << std::endl;
+
+	return 0;
+}
+

File src/test/old/CMakeLists.txt

+cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
+
+if(with_fc2)
+    project(bias_test_fc2)
+    add_executable(test_fc2 test_fc2.cpp)
+    target_link_libraries(test_fc2 ${bias_ext_link_LIBS} bias_camera_facade)
+
+endif()
+
+if(with_dc1394) 
+    project(bias_test_dc1394)
+    add_EXECUTABLE(test_dc1394 test_dc1394.cpp)
+    target_link_libraries(test_dc1394 ${bias_ext_link_LIBS} bias_camera_facade)
+endif()
+
+

File src/test/old/debug_test_0.cpp

-#if defined(WIN32) || defined(WIN64)
-#define _CRT_SECURE_NO_WARNINGS		
-#endif
-#include <windows.h>
-#include <iostream>
-#include <memory>
-#include <sstream>
-#include <opencv2/core/core.hpp>
-
-#include "utils.hpp"
-#include "guid.hpp"
-#include "property.hpp"
-#include "camera.hpp"
-#include "camera_finder.hpp"
-#include "basic_types.hpp"
-
-using namespace std;
-using namespace bias;
-
-int main(int argc, char** argv)
-{        
-    int cnt;
-    int numGrab = 100;
-    string input;
-
-    CameraFinder camFinder;
-    cv::Mat image;
-
-    cout << endl;
-
-    // Create and Connect cameras - set videomode
-    // ------------------------------------------------------------------------
-    cnt = 0;
-    cout << "Getting list of cameras" << endl << endl;
-    CameraPtrList camPtrList = camFinder.createCameraPtrList();
-
-    if (camPtrList.empty()) 
-    {
-        cout << "No cmaeras found" << endl << endl;
-        cout << "Press enter to quit" << endl;
-        getline(cin,input);
-        return 0;
-    }
-
-    cout << "Connecting:" << endl;
-    cnt = 0;
-    for (
-            CameraPtrList::iterator it=camPtrList.begin(); 
-            it!=camPtrList.end(); 
-            it++
-        )
-    {
-        CameraPtr camPtr = *it;
-        Guid guid = camPtr -> getGuid();
-        cout << " camera: " << cnt << "guid: " << guid.toString() << endl;
-        camPtr -> connect();
-        camPtr -> setVideoMode(VIDEOMODE_FORMAT7);
-        camPtr -> setTriggerInternal();
-        cnt++;
-    }
-    cout << "Done" << endl << endl;
-
-
-    // Start capture on cameras
-    // ------------------------------------------------------------------------
-    cout << "Starting capture on cameras: ";
-    cnt = 0;
-    for (
-            CameraPtrList::iterator it=camPtrList.begin(); 
-            it!=camPtrList.end(); 
-            it++
-        ) 
-    {
-        CameraPtr camPtr = *it;
-        cout << " camera: " << cnt << endl;
-        camPtr -> startCapture();
-        cnt++;
-    }
-    cout << "done" << endl << endl;
-   
-
-    // Grab images
-    // ------------------------------------------------------------------------
-    cout << "Grabing images" << endl;
-    cout << endl;
-    for (int i=0; i<numGrab; i++) 
-    {
-        cout << " image: " << (i+1) << "/" << numGrab << endl;
-        cnt = 0;
-        for (
-                CameraPtrList::iterator it=camPtrList.begin();
-                it!=camPtrList.end(); 
-                it++
-            )
-        {
-            CameraPtr camPtr = *it;
-            cout << "  camera: " << cnt << endl;
-            camPtr -> grabImage(image);
-            cnt++;
-        } 
-        cout << endl;
-    }
-
-
-    // Stop capture on cameras
-    // ------------------------------------------------------------------------
-    cout << endl;
-    cout << "Stopping capture: ";
-    cout << endl;
-    cnt = 0;
-    for (
-            CameraPtrList::iterator it=camPtrList.begin(); 
-            it!=camPtrList.end(); 
-            it++
-        ) 
-    {
-        cout << " camera: " << cnt << endl; 
-        CameraPtr cameraPtr = *it;
-        cameraPtr -> stopCapture();
-        cnt++;
-    }
-    cout << "done" << endl << endl;
-
-    cout << "Press Enter to Quit" << endl;
-
-    getline(cin,input);
-
-	return 0;
-}
-

File src/test/old/debug_test_1.cpp

-#if defined(WIN32) || defined(WIN64)
-#define _CRT_SECURE_NO_WARNINGS		
-#endif
-#include <windows.h>
-#include <iostream>
-#include <memory>
-#include <sstream>
-#include <opencv2/core/core.hpp>
-
-#include "utils.hpp"
-#include "guid.hpp"
-#include "property.hpp"
-#include "camera.hpp"
-#include "camera_finder.hpp"
-#include "basic_types.hpp"
-
-using namespace std;
-using namespace bias;
-
-int main(int argc, char** argv)
-{        
-    int cnt;
-    int numGrab = 5;
-    string input;
-
-    CameraFinder camFinder;
-    cv::Mat image;
-
-    cout << endl;
-
-    // Create and Connect cameras - set videomode
-    // ------------------------------------------------------------------------
-    cnt = 0;
-    cout << "Getting list of cameras" << endl;
-    CameraPtrList camPtrList = camFinder.createCameraPtrList();
-    if (camPtrList.empty()) 
-    {
-        cout << "No cmaeras found" << endl << endl;
-        //cout << "Press enter to quit" << endl;
-        //getline(cin,input);
-        return 0;
-    }
-    cout << "Done" << endl << endl;
-
-    cout << "Connecting" << endl;
-    cnt = 0;
-    for (
-            CameraPtrList::iterator it=camPtrList.begin(); 
-            it!=camPtrList.end(); 
-            it++
-        )
-    {
-        CameraPtr camPtr = *it;
-        Guid guid = camPtr -> getGuid();
-        cout << "Camera: " << cnt << ", GUID: " << guid.toString() << endl;
-        camPtr -> connect();
-        camPtr -> setVideoMode(VIDEOMODE_FORMAT7);
-        camPtr -> setTriggerInternal();
-        cnt++;
-    }
-    cout << "Done" << endl << endl;
-
-
-    // Start capture on cameras
-    // ------------------------------------------------------------------------
-    cout << "Starting capture" << endl;
-    cnt = 0;
-    for (
-            CameraPtrList::iterator it=camPtrList.begin(); 
-            it!=camPtrList.end(); 
-            it++
-        ) 
-    {
-        CameraPtr camPtr = *it;
-        cout << "Camera: " << cnt << endl;
-        camPtr -> startCapture();
-        cnt++;
-    }
-    cout << "Done" << endl << endl;
-   
-
-    // Grab images
-    // ------------------------------------------------------------------------
-    cout << "Grabing images" << endl;
-    cout << endl;
-    for (int i=0; i<numGrab; i++) 
-    {
-        cout << "Image: " << (i+1) << "/" << numGrab << endl;
-        cnt = 0;
-        for (
-                CameraPtrList::iterator it=camPtrList.begin();
-                it!=camPtrList.end(); 
-                it++
-            )
-        {
-            CameraPtr camPtr = *it;
-            cout << "Camera: " << cnt << endl;
-            camPtr -> grabImage(image);
-            cnt++;
-        } 
-        cout << endl;
-    }
-
-
-    // Stop capture on cameras
-    // ------------------------------------------------------------------------
-    cout << endl;
-    cout << "Stopping capture" << endl;
-    cnt = 0;
-    for (
-            CameraPtrList::iterator it=camPtrList.begin(); 
-            it!=camPtrList.end(); 
-            it++
-        ) 
-    {
-        cout << "Camera: " << cnt << endl; 
-        CameraPtr cameraPtr = *it;
-        cameraPtr -> stopCapture();
-        cnt++;
-    }
-    cout << "Done" << endl << endl;
-
-    //cout << "Press Enter to Quit" << endl;
-    //getline(cin,input);
-
-	return 0;
-}
-

File src/test/old/test_dc1394.cpp

+#include <iostream>
+#include <vector>
+#include <stdint.h>
+#include <unistd.h>
+#include "guid.hpp"
+#include <opencv2/core/core.hpp>
+#include <opencv2/highgui/highgui.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
+#include "camera.hpp"
+#include "camera_finder.hpp"
+
+using namespace std;
+using namespace bias;
+
+int main(int argc, char *argv[]) 
+{
+    int numImage = 1000;
+    cv::Mat image;
+    cv::Mat imageScaled;
+    CameraFinder cameraFinder;
+    std::vector<std::string> windowNames;
+
+    cout << endl;
+    cout << "number of cameras: " << cameraFinder.numberOfCameras() << endl;
+
+    // Get and print list of camera guids
+
+    GuidList guidList = cameraFinder.getGuidList(); 
+
+    if (guidList.size() == 0) 
+    {
+        cout << "No cameas found" << endl;
+        return -1;
+    }
+
+    {
+        cout << endl;
+        cout << "printing guid list" << endl;
+        int cnt;
+
+        GuidList::iterator it;
+        for (it=guidList.begin(), cnt=0; it!=guidList.end(); it++, cnt++)
+        {
+            Guid guid = *it;
+            cout  << "  [" << cnt << "] guid " << guid << endl;
+        }
+    }
+
+    // Create, connect and add cameras to camera list
+    CameraPtrList cameraPtrList;
+    {
+        cout << endl;
+        cout << "creating & connecting cameras" << endl;
+        int cnt;
+        GuidList::iterator it;
+        for (it=guidList.begin(), cnt=0; it!=guidList.end(); it++, cnt++)
+        {
+            Guid guid = *it;
+            cout  << "  [" << cnt << "] guid " << guid << endl;
+            CameraPtr cameraPtr = std::make_shared<Camera>(guid);
+            cameraPtr -> connect();
+            cameraPtrList.push_back(cameraPtr);
+        }
+    }
+
+    // Create opencv named windows
+    // ------------------------------------------------------------------------
+    windowNames = std::vector<std::string>(cameraPtrList.size());
+    for (int cnt = 0; cnt < cameraPtrList.size(); cnt++)
+    {
+        std::stringstream ssName;
+        ssName << "Camera: " <<  cnt;
+        windowNames[cnt] = ssName.str();
+        cv::namedWindow(
+                windowNames[cnt],
+                CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_NORMAL
+                );
+    }
+
+    // Print camera information
+    {
+        cout << endl;
+        cout << "printing camera info" << endl;
+        int cnt;
+        CameraPtrList::iterator it;
+        for (it=cameraPtrList.begin(), cnt=0; it!=cameraPtrList.end(); it++, cnt++)
+        {
+            cout << "camera: " << cnt << endl;
+            CameraPtr cameraPtr = *it;
+            cameraPtr -> printInfo();
+        }
+    }
+
+    // Start capture
+    {
+        cout << endl;
+        cout << "starting video capture" << endl;
+        int cnt;
+        CameraPtrList::iterator it;
+        for (it=cameraPtrList.begin(), cnt=0; it!=cameraPtrList.end(); it++, cnt++)
+        {
+            cout << "  camera: " << cnt << endl;
+            CameraPtr cameraPtr = *it;
+            cameraPtr -> startCapture();
+        }
+    }
+
+    // Grab some frames
+    {
+        cout << "grabbing some images" << endl;
+        for (int i=0; i<numImage; i++) 
+        {
+            cout << "  image: " << i << "/" << numImage << endl;
+            int cnt;
+            CameraPtrList::iterator it;
+            for (it=cameraPtrList.begin(), cnt=0; it!=cameraPtrList.end(); it++, cnt++)
+            {
+                cout << "    camera: " << cnt << endl;
+                CameraPtr cameraPtr = *it;
+                image = cameraPtr -> grabImage();
+                if (i%2 == 0) {
+                    cv::resize(image, imageScaled, cv::Size(0,0), 0.8, 0.8);
+                    cv::imshow(windowNames[cnt], imageScaled);
+                    cv::waitKey(10);
+                }
+            }
+        }
+    }
+
+    // Stop capture
+    {
+        cout << endl;
+        cout << "stoping video capture" << endl;
+        int cnt;
+        CameraPtrList::iterator it;
+        for (it=cameraPtrList.begin(), cnt=0; it!=cameraPtrList.end(); it++, cnt++)
+        {
+            cout << "  camera: " << cnt << endl;
+            CameraPtr cameraPtr = *it;
+            cameraPtr -> stopCapture();
+        }
+    }
+    
+
+    return 0;
+}

File src/test/old/test_fc2.cpp

+#if defined(WIN32) || defined(WIN64)
+#define _CRT_SECURE_NO_WARNINGS		
+#endif
+#include <windows.h>
+#include <iostream>
+#include <memory>
+#include <sstream>
+#include <vector>
+#include <map>
+#include <opencv2/core/core.hpp>
+#include <opencv2/highgui/highgui.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
+
+#include "utils.hpp"
+#include "guid.hpp"
+#include "property.hpp"
+#include "camera.hpp"
+#include "camera_finder.hpp"
+#include "basic_types.hpp"
+
+using namespace std;
+using namespace bias;
+
+int main(int argc, char** argv)
+{        
+    int cnt;
+    int numGrab = 1;
+    CameraFinder camFinder;
+    cv::Mat image;
+    cv::Mat imageScaled;
+    std::vector<std::string> windowNames;
+
+    cout << endl;
+
+    // Create and Connect cameras - set videomode
+    // ------------------------------------------------------------------------
+    cnt = 0;
+    CameraPtrList camPtrList = camFinder.createCameraPtrList();
+    for (
+            CameraPtrList::iterator it=camPtrList.begin(); 
+            it!=camPtrList.end(); 
+            it++
+        )
+    {
+        CameraPtr camPtr = *it;
+        camPtr -> connect();
+        std::cout << "image mode" << camPtr -> getImageMode();
+        //camPtr -> setVideoMode(VIDEOMODE_FORMAT7);
+        //camPtr -> setTriggerInternal();
+
+        //Property prop = camPtr -> getProperty(PROPERTY_TYPE_FRAME_RATE);
+        //prop.autoActive = false;
+        //prop.value = 465;
+        //camPtr -> setProperty(prop);
+    }
+
+    // Create opencv named windows
+    // ------------------------------------------------------------------------
+    windowNames = std::vector<std::string>(camPtrList.size());
+    for ( cnt = 0; cnt < camPtrList.size(); cnt++)
+    {
+        std::stringstream ssName;
+        ssName << "Camera: " <<  cnt;
+        windowNames[cnt] = ssName.str();
+        cv::namedWindow(
+                windowNames[cnt],
+                CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_EXPANDED
+                );
+    }
+
+    // Print camera information
+    // ------------------------------------------------------------------------
+    if (false) 
+    {
+        cnt = 0;
+        for (
+                CameraPtrList::iterator it=camPtrList.begin(); 
+                it!=camPtrList.end(); 
+                it++
+            ) 
+        {
+            cout << endl << "Camera " << cnt << endl;
+            CameraPtr camPtr = *it;
+            camPtr -> printInfo();
+            cnt++;
+        }
+    }
+
+    // Print Property information for all cameras
+    // ------------------------------------------------------------------------
+    if (true) 
+    {
+        cnt = 0;
+        for (
+                CameraPtrList::iterator it=camPtrList.begin();
+                it!=camPtrList.end();
+                it++
+            )
+        {
+            cout << endl << "Camera " << cnt << " Property Information" << endl;
+            CameraPtr camPtr = *it;
+            camPtr -> printAllPropertyInfos();
+            cnt++;
+        }
+    }
+
+    // Print property values for all cameras
+    // ------------------------------------------------------------------------
+    if (false)
+    {
+        cnt = 0;
+        for (
+                CameraPtrList::iterator it=camPtrList.begin();
+                it!=camPtrList.end();
+                it++
+            )
+        {
+            cout << endl << "Camera " << cnt << " Property Values" << endl;
+            CameraPtr camPtr = *it;
+            camPtr -> printAllProperties();
+            cnt++;
+        }
+    }
+
+    //// Start capture on cameras
+    //// ------------------------------------------------------------------------
+    //cout << "Starting capture on cameras: ";
+    //cnt = 0;
+    //for (
+    //        CameraPtrList::iterator it=camPtrList.begin(); 
+    //        it!=camPtrList.end(); 
+    //        it++
+    //    ) 
+    //{
+    //    cout << cnt << " ";
+    //    CameraPtr camPtr = *it;
+    //    camPtr -> startCapture();
+    //    cnt++;
+    //}
+    //cout << "done" << endl;
+    //cout << endl;
+   
+
+    //// Grab images
+    //// ------------------------------------------------------------------------
+    //cout << "Grabing images" << endl;
+    //cout << endl;
+    //for (int i=0; i<numGrab; i++) 
+    //{
+    //    cout << "  image: " << (i+1) << "/" << numGrab << " camera: ";
+    //    cnt = 0;
+    //    for (
+    //            CameraPtrList::iterator it=camPtrList.begin();
+    //            it!=camPtrList.end(); 
+    //            it++
+    //        )
+    //    {
+    //        CameraPtr cameraPtr = *it;
+    //        cameraPtr -> grabImage(image);
+
+    //        if (cnt%10 == 0) {
+    //            cv::resize(image,imageScaled, cv::Size(0,0), 0.5, 0.5);
+    //            cv::imshow(windowNames[cnt], imageScaled);
+    //            cv::waitKey(1);
+    //        }
+
+    //        cout << cnt << " ";
+    //        cnt++;
+    //    } 
+    //    cout << endl;
+    //}
+
+
+    //// Stop capture on cameras
+    //// ------------------------------------------------------------------------
+    //cout << endl;
+    //cout << "Stopping capture on cameras: ";
+    //cnt = 0;
+    //for (
+    //        CameraPtrList::iterator it=camPtrList.begin(); 
+    //        it!=camPtrList.end(); 
+    //        it++
+    //    ) 
+    //{
+    //    cout << cnt << " "; 
+    //    CameraPtr cameraPtr = *it;
+    //    cameraPtr -> stopCapture();
+    //    cnt++;
+    //}
+    //cout << "done" << endl << endl;
+
+
+
+	return 0;
+}
+

File src/test/test_dc1394.cpp

-#include <iostream>
-#include <vector>
-#include <stdint.h>
-#include <unistd.h>
-#include "guid.hpp"
-#include <opencv2/core/core.hpp>
-#include <opencv2/highgui/highgui.hpp>
-#include <opencv2/imgproc/imgproc.hpp>
-#include "camera.hpp"
-#include "camera_finder.hpp"
-
-using namespace std;
-using namespace bias;
-
-int main(int argc, char *argv[]) 
-{
-    int numImage = 1000;
-    cv::Mat image;
-    cv::Mat imageScaled;
-    CameraFinder cameraFinder;
-    std::vector<std::string> windowNames;
-
-    cout << endl;
-    cout << "number of cameras: " << cameraFinder.numberOfCameras() << endl;
-
-    // Get and print list of camera guids
-
-    GuidList guidList = cameraFinder.getGuidList(); 
-
-    if (guidList.size() == 0) 
-    {
-        cout << "No cameas found" << endl;
-        return -1;
-    }
-
-    {
-        cout << endl;
-        cout << "printing guid list" << endl;
-        int cnt;
-
-        GuidList::iterator it;
-        for (it=guidList.begin(), cnt=0; it!=guidList.end(); it++, cnt++)
-        {
-            Guid guid = *it;
-            cout  << "  [" << cnt << "] guid " << guid << endl;
-        }
-    }
-
-    // Create, connect and add cameras to camera list
-    CameraPtrList cameraPtrList;
-    {
-        cout << endl;
-        cout << "creating & connecting cameras" << endl;
-        int cnt;
-        GuidList::iterator it;
-        for (it=guidList.begin(), cnt=0; it!=guidList.end(); it++, cnt++)
-        {
-            Guid guid = *it;
-            cout  << "  [" << cnt << "] guid " << guid << endl;
-            CameraPtr cameraPtr = std::make_shared<Camera>(guid);
-            cameraPtr -> connect();
-            cameraPtrList.push_back(cameraPtr);
-        }
-    }
-
-    // Create opencv named windows
-    // ------------------------------------------------------------------------
-    windowNames = std::vector<std::string>(cameraPtrList.size());
-    for (int cnt = 0; cnt < cameraPtrList.size(); cnt++)
-    {
-        std::stringstream ssName;
-        ssName << "Camera: " <<  cnt;
-        windowNames[cnt] = ssName.str();
-        cv::namedWindow(
-                windowNames[cnt],
-                CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_NORMAL
-                );
-    }
-
-    // Print camera information
-    {
-        cout << endl;
-        cout << "printing camera info" << endl;
-        int cnt;
-        CameraPtrList::iterator it;
-        for (it=cameraPtrList.begin(), cnt=0; it!=cameraPtrList.end(); it++, cnt++)
-        {
-            cout << "camera: " << cnt << endl;
-            CameraPtr cameraPtr = *it;
-            cameraPtr -> printInfo();
-        }
-    }
-
-    // Start capture
-    {
-        cout << endl;
-        cout << "starting video capture" << endl;
-        int cnt;
-        CameraPtrList::iterator it;
-        for (it=cameraPtrList.begin(), cnt=0; it!=cameraPtrList.end(); it++, cnt++)
-        {
-            cout << "  camera: " << cnt << endl;
-            CameraPtr cameraPtr = *it;
-            cameraPtr -> startCapture();
-        }
-    }
-
-    // Grab some frames
-    {
-        cout << "grabbing some images" << endl;
-        for (int i=0; i<numImage; i++) 
-        {
-            cout << "  image: " << i << "/" << numImage << endl;
-            int cnt;
-            CameraPtrList::iterator it;
-            for (it=cameraPtrList.begin(), cnt=0; it!=cameraPtrList.end(); it++, cnt++)
-            {
-                cout << "    camera: " << cnt << endl;
-                CameraPtr cameraPtr = *it;
-                image = cameraPtr -> grabImage();
-                if (i%2 == 0) {
-                    cv::resize(image, imageScaled, cv::Size(0,0), 0.8, 0.8);
-                    cv::imshow(windowNames[cnt], imageScaled);
-                    cv::waitKey(10);
-                }
-            }
-        }
-    }
-
-    // Stop capture
-    {
-        cout << endl;
-        cout << "stoping video capture" << endl;
-        int cnt;
-        CameraPtrList::iterator it;
-        for (it=cameraPtrList.begin(), cnt=0; it!=cameraPtrList.end(); it++, cnt++)
-        {
-            cout << "  camera: " << cnt << endl;
-            CameraPtr cameraPtr = *it;
-            cameraPtr -> stopCapture();
-        }
-    }
-    
-
-    return 0;
-}

File src/test/test_fc2.cpp

-#if defined(WIN32) || defined(WIN64)
-#define _CRT_SECURE_NO_WARNINGS		
-#endif
-#include <windows.h>
-#include <iostream>
-#include <memory>
-#include <sstream>
-#include <vector>
-#include <map>
-#include <opencv2/core/core.hpp>
-#include <opencv2/highgui/highgui.hpp>
-#include <opencv2/imgproc/imgproc.hpp>
-
-#include "utils.hpp"
-#include "guid.hpp"
-#include "property.hpp"
-#include "camera.hpp"
-#include "camera_finder.hpp"
-#include "basic_types.hpp"
-
-using namespace std;
-using namespace bias;
-
-int main(int argc, char** argv)
-{        
-    int cnt;
-    int numGrab = 1;
-    CameraFinder camFinder;
-    cv::Mat image;
-    cv::Mat imageScaled;
-    std::vector<std::string> windowNames;
-
-    cout << endl;
-
-    // Create and Connect cameras - set videomode
-    // ------------------------------------------------------------------------
-    cnt = 0;
-    CameraPtrList camPtrList = camFinder.createCameraPtrList();
-    for (
-            CameraPtrList::iterator it=camPtrList.begin(); 
-            it!=camPtrList.end(); 
-            it++
-        )
-    {
-        CameraPtr camPtr = *it;
-        camPtr -> connect();
-        std::cout << "image mode" << camPtr -> getImageMode();
-        //camPtr -> setVideoMode(VIDEOMODE_FORMAT7);
-        //camPtr -> setTriggerInternal();
-
-        //Property prop = camPtr -> getProperty(PROPERTY_TYPE_FRAME_RATE);
-        //prop.autoActive = false;
-        //prop.value = 465;
-        //camPtr -> setProperty(prop);
-    }
-
-    // Create opencv named windows
-    // ------------------------------------------------------------------------
-    windowNames = std::vector<std::string>(camPtrList.size());
-    for ( cnt = 0; cnt < camPtrList.size(); cnt++)
-    {
-        std::stringstream ssName;
-        ssName << "Camera: " <<  cnt;
-        windowNames[cnt] = ssName.str();
-        cv::namedWindow(
-                windowNames[cnt],
-                CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_EXPANDED
-                );
-    }
-
-    // Print camera information
-    // ------------------------------------------------------------------------
-    if (false) 
-    {
-        cnt = 0;
-        for (
-                CameraPtrList::iterator it=camPtrList.begin(); 
-                it!=camPtrList.end(); 
-                it++
-            ) 
-        {
-            cout << endl << "Camera " << cnt << endl;
-            CameraPtr camPtr = *it;
-            camPtr -> printInfo();
-            cnt++;
-        }
-    }
-
-    // Print Property information for all cameras
-    // ------------------------------------------------------------------------
-    if (true) 
-    {
-        cnt = 0;
-        for (
-                CameraPtrList::iterator it=camPtrList.begin();
-                it!=camPtrList.end();
-                it++
-            )
-        {
-            cout << endl << "Camera " << cnt << " Property Information" << endl;
-            CameraPtr camPtr = *it;
-            camPtr -> printAllPropertyInfos();
-            cnt++;
-        }
-    }
-
-    // Print property values for all cameras
-    // ------------------------------------------------------------------------
-    if (false)
-    {
-        cnt = 0;
-        for (
-                CameraPtrList::iterator it=camPtrList.begin();
-                it!=camPtrList.end();
-                it++
-            )
-        {
-            cout << endl << "Camera " << cnt << " Property Values" << endl;
-            CameraPtr camPtr = *it;
-            camPtr -> printAllProperties();
-            cnt++;
-        }
-    }
-
-    //// Start capture on cameras
-    //// ------------------------------------------------------------------------
-    //cout << "Starting capture on cameras: ";
-    //cnt = 0;
-    //for (
-    //        CameraPtrList::iterator it=camPtrList.begin(); 
-    //        it!=camPtrList.end(); 
-    //        it++
-    //    ) 
-    //{
-    //    cout << cnt << " ";
-    //    CameraPtr camPtr = *it;
-    //    camPtr -> startCapture();
-    //    cnt++;
-    //}
-    //cout << "done" << endl;
-    //cout << endl;
-   
-
-    //// Grab images
-    //// ------------------------------------------------------------------------
-    //cout << "Grabing images" << endl;
-    //cout << endl;
-    //for (int i=0; i<numGrab; i++) 
-    //{
-    //    cout << "  image: " << (i+1) << "/" << numGrab << " camera: ";
-    //    cnt = 0;
-    //    for (
-    //            CameraPtrList::iterator it=camPtrList.begin();
-    //            it!=camPtrList.end(); 
-    //            it++
-    //        )
-    //    {
-    //        CameraPtr cameraPtr = *it;
-    //        cameraPtr -> grabImage(image);
-
-    //        if (cnt%10 == 0) {
-    //            cv::resize(image,imageScaled, cv::Size(0,0), 0.5, 0.5);
-    //            cv::imshow(windowNames[cnt], imageScaled);
-    //            cv::waitKey(1);
-    //        }
-
-    //        cout << cnt << " ";
-    //        cnt++;
-    //    } 
-    //    cout << endl;
-    //}
-
-
-    //// Stop capture on cameras
-    //// ------------------------------------------------------------------------
-    //cout << endl;
-    //cout << "Stopping capture on cameras: ";
-    //cnt = 0;
-    //for (
-    //        CameraPtrList::iterator it=camPtrList.begin(); 
-    //        it!=camPtrList.end(); 
-    //        it++
-    //    ) 
-    //{
-    //    cout << cnt << " "; 
-    //    CameraPtr cameraPtr = *it;
-    //    cameraPtr -> stopCapture();
-    //    cnt++;
-    //}
-    //cout << "done" << endl << endl;
-
-
-
-	return 0;
-}
-