Skip to content
Snippets Groups Projects
Commit a4947465 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added some new functions to the ladybug API to simplify its use.

parent 977d2350
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,6 @@ void CBumblebee::set_config(unsigned int *left_off,unsigned int *top_off,unsigne
dc1394error_t error;
uint32_t min_bpp;
uint32_t max_bpp;
unsigned int bpp;
// set the operation mode
......@@ -58,7 +57,7 @@ void CBumblebee::set_config(unsigned int *left_off,unsigned int *top_off,unsigne
}
this->mode=DC1394_VIDEO_MODE_FORMAT7_3;
// configure the camera
if(coding==MONO)
if(this->stereo_coding==MONO)
{
this->coding=MONO;
dc1394_coding=DC1394_COLOR_CODING_MONO16;
......
......@@ -7,7 +7,7 @@
#include <sstream>
#include <iostream>
const int num_frames=10;
const int num_frames=1000;
int main(int argc, char *argv[])
{
......
......@@ -24,8 +24,6 @@ int main(int argc, char *argv[])
char *front=NULL,*front_right=NULL,*rear_right=NULL,*rear_left=NULL,*front_left=NULL,*top=NULL;
std::string new_frame,filename;
std::stringstream text;
uint64_t guid=0x0000b09d01006b6fb5;
// uint64_t guid=0x00B09D01007D6D85LL;
std::list<std::string> events;
try
......@@ -36,16 +34,18 @@ int main(int argc, char *argv[])
server->init();
std::cout << "Num. Cam. : " << server->get_num_cameras() << std::endl;
/* get the new camera with index 0 */
/* get the new camera with guid = 0x00B09D01007D6D85 */
// server->get_pgr_stereo_camera_guid(guid,&camera1);
server->get_ladybug_camera(0,&ladybug);
/* get the reference to the event server */
event_server=CEventServer::instance();
ladybug->get_config(&left_off,&top_off,&width,&height,&framerate,&depth,&coding);
std::cout << "Fremerate: " << framerate << std::endl;
// coding=MONO;
coding=RGB;
framerate=10;
ladybug->set_config(&left_off,&top_off,&width,&height,&framerate,depth,coding);
ladybug->get_multi_config(&width,&height,&framerate,&depth,&coding);
std::cout << "Image size: " << width << "x" << height << std::endl;
std::cout << "Fremerate: " << framerate << std::endl;
std::cout << "Color coding: " << (int)coding << "-" << (int)depth << std::endl;
ladybug->get_new_frame_event_id(new_frame);
events.push_back(new_frame);
ladybug->start();
......
......@@ -47,6 +47,15 @@ void CLadyBug::set_config(unsigned int *left_off,unsigned int *top_off,unsigned
this->multi_coding=RGB;
}
void CLadyBug::get_multi_config(unsigned int *width,unsigned int *height, float *framerate, depths_t *depth, codings_t *coding)
{
(*width)=this->multi_width;
(*height)=this->multi_height;
(*framerate)=this->framerate;
(*depth)=this->multi_depth;
(*coding)=this->multi_coding;
}
void CLadyBug::get_images(char **front, char **front_right, char **rear_right, char **rear_left, char **front_left, char **top)
{
int depth;
......
......@@ -37,6 +37,11 @@ class CLadyBug : public CPTGCamera
*
*/
void set_config(unsigned int *left_off,unsigned int *top_off,unsigned int *width,unsigned int *height, float *framerate, depths_t depth, codings_t coding);
/**
* \brief
*
*/
void get_multi_config(unsigned int *width,unsigned int *height, float *framerate, depths_t *depth, codings_t *coding);
/**
* \brief
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment