8 #include <Tools/BIASShowCamWX/ShowCamWxVideoSourceFactory.hh>
10 # include <Gui/VideoSource_Controller.hh>
12 # include <VideoSource/VideoSource_V4L.hh>
13 #endif // BIAS_HAVE_V4L
16 # include <Gui/VideoSource_Controller_XB3.hh>
17 # include <VideoSource/VideoSource_DCAM_BumbleBee.hh>
18 #endif // BIAS_HAVE_DCAM
20 #ifdef BIAS_HAVE_PMD_PMDTec
21 # include <Gui/VideoSource_Controller_PMD.hh>
22 # include <VideoSource/VideoSource_PMD.hh>
23 #endif // BIAS_HAVE_PMD_PMDTec
25 #ifdef BIAS_HAVE_PMD_PMDZess
26 # include <Gui/VideoSource_Controller_PMDZess.hh>
27 # include <VideoSource/VideoSource_PMDZess.hh>
28 #endif // BIAS_HAVE_PMD_PMDZess
30 #ifdef BIAS_HAVE_SWISSRANGER
31 # include <Gui/VideoSource_Controller_SwissRanger.hh>
32 # include <VideoSource/VideoSource_SwissRanger.hh>
35 #include <Gui/VideoSource_Controller_Kinect.hh>
37 #ifdef BIAS_HAVE_KINECT
38 # include <VideoSource/VideoSource_Kinect.hh>
41 #ifdef BIAS_HAVE_OPENNI
42 # include <VideoSource/VideoSource_OpenNI.hh>
45 #ifdef BIAS_HAVE_KINECT2
46 # include <VideoSource/VideoSource_Kinect2.hh>
49 #ifdef BIAS_HAVE_DSHOW
50 # include <VideoSource/VideoSource_DSHOW.hh>
54 # include <VideoSource/VideoSource_uEye.hh>
58 #include <VideoSource/VideoSource_Shm.hh>
59 #include <VideoSource/VideoSource_Net.hh>
68 ShowCamWxVideoSourceFactory::ShowCamWxVideoSourceFactory() {
72 ShowCamWxVideoSourceFactory::~ShowCamWxVideoSourceFactory() {
77 const std::string& title,
86 #ifdef BIAS_HAVE_PMD_PMDZess
91 #ifdef BIAS_HAVE_PMD_PMDTec
96 #ifdef BIAS_HAVE_SWISSRANGER
101 #ifdef BIAS_HAVE_DCAM
126 string thetitle =
"Camera: "+title;
140 CreateDCAM(
bool firewireB,
bool user_mode,
int dcam_mode,
141 float fps,
int Format7BpP,
int Format7ColorMode,
145 #ifdef BIAS_HAVE_DCAM
152 dc1394video_mode_t mode = (dc1394video_mode_t)dcam_mode;
155 if (mode >= DC1394_VIDEO_MODE_FORMAT7_0) {
156 cam->
SetFormat7(mode - DC1394_VIDEO_MODE_FORMAT7_MIN, Format7BpP,
157 (dc1394color_coding_t) Format7ColorMode);
158 cam->
SetLeftTop(Format7LeftTop[0], Format7LeftTop[1]);
159 cam->
SetSize(Format7WidthHeight[0], Format7WidthHeight[1]);
172 CreatePMDZess(std::string bitfile)
174 #ifdef BIAS_HAVE_PMD_PMDZess
186 #ifdef BIAS_HAVE_UEYE
195 CreateFromTypeIfSupported(
int type)
197 return CreateFromTypeIfSupported((
CameraType)type);
206 #ifdef BIAS_HAVE_TIFF
216 #ifdef BIAS_HAVE_SWISSRANGER
221 #ifdef BIAS_HAVE_KINECT
226 #ifdef BIAS_HAVE_OPENNI
231 #ifdef BIAS_HAVE_KINECT2
236 BIASERR(
"try specialized method for " << type <<
" camera");
249 #ifdef BIAS_HAVE_DSHOW
261 #ifdef BIAS_HAVE_DCAM
272 CreatePMD(
string sourcePlugin,
string procPlugin)
275 #ifdef BIAS_HAVE_PMD_PMDTec
278 (
dynamic_cast<VideoSource_PMD*
>(cam))->SetProcessingPlugin(procPlugin);
283 int ShowCamWxVideoSourceFactory::
284 OpenDevice(
int type,
VideoSource* cam, std::string deviceName,
int param)
287 if (cam == NULL)
return -1;
291 case ShowCamWxVideoSourceFactory::XB3:
292 case ShowCamWxVideoSourceFactory::DCAM:
293 if (deviceName !=
"") {
296 if (cam->
OpenDevice(atoi(deviceName.c_str())) < 0)
299 cout<<
"Camera number " << deviceName <<
" successfully opened"<<endl;
305 if (cam->
OpenDevice(Win32DCAMNumber_++) < 0) {
320 case ShowCamWxVideoSourceFactory::PMD: {
321 #ifdef BIAS_HAVE_PMD_PMDTec
332 case ShowCamWxVideoSourceFactory::NET: {
343 case ShowCamWxVideoSourceFactory::OPENNI: {
344 if (deviceName !=
"") {
345 return cam->
OpenDevice(atoi(deviceName.c_str()));
351 case ShowCamWxVideoSourceFactory::FREENECT2: {
352 if (deviceName !=
"") {
353 return cam->
OpenDevice(atoi(deviceName.c_str()));
360 if (deviceName !=
"") {
361 cout<<
"Opening device:"<<deviceName<<endl;
364 cout<<
"Opening device without device name."<<endl;
379 #ifdef BIAS_HAVE_DCAM
380 if (dynamic_cast<VideoSource_DCAM_BumbleBee*>(cam) != NULL)
390 #ifdef BIAS_HAVE_PMD_PMDZess
392 if (dynamic_cast<VideoSource_PMDZess*>(cam) != NULL)
397 #endif // BIAS_HAVE_PMD_PMDZess
400 #ifdef BIAS_HAVE_PMD_PMDTec
407 #ifdef BIAS_HAVE_PMD_PMDTec
416 #ifdef BIAS_HAVE_KINECT2
virtual void SetSize(int w, int h, int bytesperpixel=1)
Set image size and number of bytes per pixel (e.g.
virtual int InitImage(BIAS::ImageBase &Image)
int SetLeftTop(unsigned int left, unsigned int top)
set the topleft corner for partitial scan
represents Zess PMD camera driver interface TODO: include support for normal images (2DImg_)...
Defines a common interface to different devices.
void AddDebugLevel(const long int lv)
Use the Kinect2 class to grab images from the Microsoft Kinect2.
virtual int OpenDevice(const char *serverName)
use given port and ip address to connect to videoserver
This class implements a video streaming client using shared memory to receive images from another app...
void SetModeAndFramerate(dc1394video_mode_t mode, float framerate)
Use OpenNI just like the ToF Cameras.
void SetSourcePlugin(std::string plugin)
only set the plugin to be opened at OpenDevice
void SetColorModel(EColorModel Model)
virtual void GetBrightnessRange(double &min, double &max)
Support for SwissRanger usb cam.
This class VideoSource_DCAM implements access to IEEE1394 (Firewire, iLink) cameras following the DCa...
virtual void SetContrastRange(unsigned int min, unsigned int max)
int SetFPNCalibrationOn(bool on)
unsigned int GetWidth() const
virtual void GetContrastRange(double &min, double &max)
This class extends VideoSource for the use of DirectShow devices you need Microsoft Windows SDK versi...
virtual void SetBrightnessRange(unsigned int min, unsigned int max)
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...
Support for CamCube usb cam.
virtual int OpenDevice()
selects the first available device to open (e.g.
void SetDebugLevel(const long int lv)
unsigned int GetHeight() const
virtual int OpenDevice()
selects the first available device to open (e.g.
void SetFirewireB(bool on)
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.
void SetBitFile(std::string file)
virtual int CloseDevice()
static int Win32DCAMNumber_
Use Kinect with the libfreenect drivers just like the ToF Cameras.
This class extends VideoSource for the use of IDS uEye devices.
This class extends VideoSource for the use of Video4Linux supported devices like framegrabber, USB cameras.
This class implements a video streaming client using TCP.
Use Kinect just like the ToF Cameras.
This is the base class for images in BIAS.