Changeset 142 in pacpussensors for trunk/Vislab/VislabCamera.cpp


Ignore:
Timestamp:
Mar 30, 2017, 4:18:32 PM (8 years ago)
Author:
ldecherf
Message:

Ajout de la classe outputter et modification d'openCV

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Vislab/VislabCamera.cpp

    r134 r142  
    1010
    1111// Includes lib3dv
    12 #include <lib3dv-1.2.0/lib3dv/device.h>
     12#include <lib3dv/device.h>
    1313#include "DiskWriter.h"
    1414#include "Display.h"
     
    4343void VislabCamera::open()
    4444{
    45        
    46     curr_devices = lib3dv::device::enumerate(boost::asio::ip::address_v4::from_string("192.168.0.1"), 1, error);
    47     if(error != lib3dv::error::NONE)
    48         std::cout << "[EE] 3dv-client: error detected: " << error << std::endl;
     45    curr_devices = lib3dv::device::enumerate(boost::asio::ip::address_v4::from_string("192.168.0.2"), 0);
     46        if (error != lib3dv::error::NONE)
     47        {
     48                std::cout << "[EE] 3dv-client: error detected: " << error << std::endl;
     49                return;
     50        }
    4951
    5052    if(curr_devices.empty())
    5153    {
    5254        std::cout << "[EE] 3dv-client: no devices found" << std::endl;
     55                return;
    5356        //return lib3dv::error::NONE;
    5457    }
    5558      //disk_writer = boost::shared_ptr< ::disk_writer>(new ::disk_writer(paths, data_format, autonumber, params, guid_type, log_level));
    56         curr_devices[0].log_level(2);
    57         curr_devices[0].timeout(boost::posix_time::milliseconds(5000));
    58     curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &displayVideo, _1, _2)));
    59     curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &displayDisparite, _1, _2)));
    60     curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterVideo, _1, _2)));
    61     curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>, unsigned int)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterDisparite, _1, _2)));
    62     curr_devices[0].start_transmission(error);
     59
     60    //curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &displayVideo, _1)));
     61    //curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &displayDisparite, _1)));
     62    //curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterVideo, _1)));
     63    //curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &diskwriterDisparite, _1)));
     64        curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &outputVideo, _1)));
     65        curr_devices[0].connect_image_callback(boost::function<void(boost::shared_ptr< const lib3dv::image>)>(boost::bind(&::VislabImageProcessor::image_callback, &outputDisparite, _1)));
     66        curr_devices[0].start_transmission(false);
    6367    if(error != lib3dv::error::NONE)
    6468      std::cout << "[EE] 3dv-client: error detected: " << error << std::endl;
     
    6973void VislabCamera::close()
    7074{
    71   curr_devices[0].stop_transmission(error);
    72   //curr_devices[0].poweroff(error);
     75        if (curr_devices.empty())
     76        {
     77                std::cout << "[EE] 3dv-client: no devices found" << std::endl;
     78                return;
     79                //return lib3dv::error::NONE;
     80        }
     81        else
     82        {
     83                curr_devices[0].stop_transmission();
     84        }
     85               
     86  //curr_devices[0].poweroff();
    7387}
    7488
Note: See TracChangeset for help on using the changeset viewer.