mercredi 28 octobre 2015

flycapture2.h and " class Error"

i'm not good in English. I'm researching about live stream video using live 555 but i don't stream from a file, i stream from a live camera. Here is one of file in code that i get from internet:

#ifndef PG_CAMERA_H
#define PG_CAMERA_H
#include "FlyCapture2.h"
#include <unistd.h>
#include <time.h>
#include <cv.h>
#include <highgui.h>
#include <mutex>
#include <thread>
#include <base.hpp>
#include <memory>
//#include <tr1/memory>
#define SOFTWARE_TRIGGER_CAMERA

using namespace FlyCapture2;
using namespace std;
using namespace cv;

/*s=vectors for storing camera and asssociated settings */
typedef std::vector<std::shared_ptr<Camera>> vec_cam;
typedef std::vector<std::shared_ptr<PGRGuid>> vec_guid;
typedef std::vector<std::shared_ptr<CameraInfo>> vec_CamInfo;
typedef std::vector<std::shared_ptr<Format7ImageSettings>>              vec_ImageSettings;
typedef std::vector<std::shared_ptr<FC2Config>> vec_config;
typedef std::vector<std::shared_ptr<TriggerMode>> vec_TriggerMode;



class PG_camera
{
public:
PG_camera();
~PG_camera();
//void initialise();
void default_initialise(unsigned int camera_number, Mode mode);
void disconnect(unsigned int camera_number);
void disconnect(void);
void discover();
void connect(unsigned int camera_number);
void connect(void);
void set_Nimages(unsigned int camera_number, int number);
void set_camera_mode(int mode);
vector<Mat> return_images(unsigned int camera_number);
Error change_ROI(unsigned int camera_number,unsigned int x,unsigned int y, unsigned int width,unsigned int height);
//return busMgr to private after tests
Error configure_camera_image(int camera_number);
Error configure_camera_gain(int camera_number, int gain);
Error configure_camera_framerate(int camera_number, int frame_rate);
Error configure_camera_shutter(int camera_number, int shutter);
Error configure_camera_brightness(int camera_number);
Error configure_camera_sharpness(int camera_number);
Error configure_camera_exposure(int camera_number);
Error configure_camera_gamma(int camera_number);

void get_max_res( int camera_number, int *width, int *height);
int get_number_cams(void);

vec_CamInfo VCamInfo;



private:

Error *error;    
BusManager *busMgr;

vec_cam Vcam;
vec_guid Vguid;
vec_ImageSettings VImageSettings;
vec_config VConfig;
vec_TriggerMode Vtrigmode;



unsigned int number_of_cams;
vector<bool> iscolor;
vector<int> N_images;
//int N_images;
int camera_mode;


void set_colour(unsigned int camera_number, bool colour);
void PrintBuildInfo();
void PrintCameraInfo( CameraInfo* pCamInfo );
void PrintError( Error error );
bool CheckSoftwareTriggerPresence( Camera* pCam );
bool PollForTriggerReady( Camera* pCam );
bool FireSoftwareTrigger( Camera* pCam );
int initialise_format7(Camera *cam, Format7ImageSettings     *image_settings, bool colour, Mode mode);
int trigger_mode_setup(TriggerMode *triggerMode, Camera *cam, int k_numImages);
void configure_strobe(Camera *cam);


};

#endif // PG_CAMERA_H

I have added libs and includes (standard, opencv, flycapture....), but there are no libs and includes that define " class Error". So anyone has had this problem, could u give me some advices? Thanks for reading!

Aucun commentaire:

Enregistrer un commentaire