25 #include "VideoSource_DCAM_BumbleBee.hh"
30 #include <1394Camera.h>
31 #include <Base/Debug/TimeMeasure.hh>
32 #include <Base/Image/ImageConvert.hh>
36 #include <Base/Image/ImageIO.hh>
37 #include <dc1394/control.h>
60 if (camInfo != NULL) {
87 cout <<
"camera is not a bumblebee" << endl;
96 BIASERR(
"VideoSource::InitImage() should be called with uninitialized image");
110 BIASERR(
"camera is not a bumblebee");
120 BIASERR(
"VideoSource_DCAM_BumbleBee::InitSingleImage() should be called with uninitialized image");
132 BIASERR(
"camera is not a bumblebee");
144 BIASERR(
"camera is not a bumblebee");
167 unsigned char* grabbedPixels = allImages.
GetImageData();
168 unsigned char* sinkPixels = NULL;
171 for(
unsigned int j=0; j<3; j++)
219 for(
int index = 0; index < size; index++)
221 sinkPixels[index] = grabbedPixels[index*3 + j];
225 unsigned long long sec, usec;
229 imageMiddle.
SetTime(sec, usec);
240 BIASERR(
"camera is not a bumblebee");
255 BIASASSERT(!imageLeft.
IsEmpty());
256 BIASASSERT(!imageRight.
IsEmpty());
266 unsigned long long sec, usec;
296 register unsigned indexG0, indexG_0;
297 register unsigned indexG2, indexG_2;
298 register unsigned indexR0, indexR2;
299 register unsigned indexB0, indexB2;
301 for (
size_t row=0; row<480; row++) {
302 for (
size_t col=0; col<640; col++) {
303 indexG0 = 7680*row + 6*col;
304 indexG2 = indexG0 + 2;
305 indexB0 = indexG0 + 3;
306 indexB2 = indexG0 + 5;
307 indexR0 = indexG0 + 3840;
308 indexR2 = indexG0 + 3840 + 2;
309 indexG_0 = indexG0 + 3840 + 3;
310 indexG_2 = indexG0 + 3840 + 5;
313 sinkPixelsR[row*640 + col] =
314 (grabedPixels[indexG0] + grabedPixels[indexR0] + grabedPixels[indexB0] + grabedPixels[indexG_0])/4;
317 sinkPixelsL[row*640 + col] =
318 (grabedPixels[indexG2] + grabedPixels[indexR2] + grabedPixels[indexB2] + grabedPixels[indexG_2])/4;
323 unsigned long long sec, usec;
346 unsigned char* sinkPixels = NULL;
349 for(
unsigned int j=0; j<3; j++)
401 for(
int j = 0; j < HEIGHT_S; j++)
403 for(
int i = 0; i < WIDTH_S; i++)
406 sinkPixels[index++] = grabedPixels[indexG+offsetR];
408 sinkPixels[index++] = grabedPixels[indexG];
410 sinkPixels[index++] = grabedPixels[indexG+offsetB];
417 unsigned long long sec, usec;
421 imageMiddle.
SetTime(sec, usec);
virtual void SetSize(int w, int h, int bytesperpixel=1)
Set image size and number of bytes per pixel (e.g.
int SetLeftTop(unsigned int left, unsigned int top)
set the topleft corner for partitial scan
int GrabSingleLRGrey(BIAS::Camera< unsigned char > &allImages, BIAS::Camera< unsigned char > &imageLeft, BIAS::Camera< unsigned char > &imageRight)
Grab single for grey value images for left and right cam.
void GetTime(unsigned long long int &sec, unsigned long long int &usec)
int GrabSingle(BIAS::Camera< unsigned char > &image)
Select the port (bus-id) to use, only valid before OpenDevice()
bool IsEmpty() const
check if ImageData_ points to allocated image buffer or not
virtual int GrabSingle(BIAS::Camera< unsigned char > &allImages, BIAS::Camera< unsigned char > &imageLeft, BIAS::Camera< unsigned char > &imageMiddle, BIAS::Camera< unsigned char > &imageRight)
Grab single images.
void SetModeAndFramerate(dc1394video_mode_t mode, float framerate)
void SetColorModel(EColorModel Model)
Stores camera information such as model, vendor, framerates.
This class VideoSource_DCAM implements access to IEEE1394 (Firewire, iLink) cameras following the DCa...
unsigned int GetWidth() const
PGR XB3 in format 7 mode 3 delivers an image that consists of 3 channels with 8bbp (overal 24bpp)...
CameraModel GetModelForEuid(const u_int64_t euid)
searches for the correct cammodel by means of the euid of a camera
VideoSource_DCAM_BumbleBee(int Card=0)
Bayer_BGGR, 1 channel RGB image Bayer tile.
virtual int SetColorModel(BIAS::ImageBase::EColorModel mode)
Select colormodel to use.
Bayer_GBRG, 1 channel RGB image Bayer tile.
int SetFormat7(int mode, int bpp, dc1394color_coding_t colorCoding=DC1394_COLOR_CODING_MONO8)
this a special function to by-pass all automatic initializations and Use only in conjuction with SetS...
virtual int GrabSingleAsSmallRGB(BIAS::Camera< unsigned char > &allImages, BIAS::Camera< unsigned char > &imageLeft, BIAS::Camera< unsigned char > &imageMiddle, BIAS::Camera< unsigned char > &imageRight)
XB3 ONLY! Grab single images as RGB.
unsigned int GetHeight() const
The image template class for specific storage types.
const StorageType * GetImageData() const
overloaded GetImageData() from ImageBase
void Release(const bool reset_storage_type=false)
Free the allocated data structures Hands off: Do !!NOT!! change the default of reset_storage_type: Im...
enum EColorModel GetColorModel() const
int UpdateMetaData()
copy P_ and co.
void Init(unsigned int width, unsigned int height, unsigned int nChannels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
Initialize image size and channels.
int SetStereoDefaultMode(CameraInfo *camInfo=NULL)
Set camera to stereo/tri mode.
(8bit) unsigned char image storage type
void SetTime(unsigned long long int sec, unsigned long long int usec)
Set time and ensure correct format (seconds and useconds after 'sec')
virtual int GetNumImages()
Get number of images for this bumblebee (returns 2 for xb2, 3 for xb3)
unsigned long int GetPixelCount() const
returns number of pixels in image
This is the base class for images in BIAS.
virtual int InitSingleImage(BIAS::ImageBase &Image)
Init single image according to bumblebee type (used for demultiplexing)
virtual int InitImage(BIAS::ImageBase &Image)
Init image according to bumblebee type and stereo mode setting.