25 #include "ShowCamWxFrame.hh"
26 #include "ShowCamWxThreads.hh"
27 #include "ShowCamWxFormat7Frame.hh"
31 #include <img/miplogochars32x32.xpm>
32 #include <wx/artprov.h>
33 #include <wx/aboutdlg.h>
34 #include <VideoSource/VideoSourceCapabilities.hh>
35 #include <Tools/BIASShowCamWX/ShowCamWxVideoSourceFactory.hh>
36 #include <Gui/wxTwoFilesInputDialog.h>
41 #define PARAM_FILE_NAME "ShowCamWx.param"
42 #define BUFFER_SIZE 50
100 const wxPoint& pos, const wxSize& size)
101 : wxFrame((wxFrame*)NULL, -1, title, pos, size) ,
106 SetIcon(wxIcon(miplogochars32x32_xpm));
108 bSingleSaveDirCreated_ =
false;
109 dSingleDirIndex_ = 0;
111 tauControllerFrame_ = NULL;
112 #ifdef BIAS_HAVE_PANTILT
113 viscaControllerFrame_ = NULL;
116 #ifdef BIAS_HAVE_PANTILT_DP
117 panTiltControl_=NULL;
118 panTiltControlDialog_=NULL;
119 #endif //BIAS_HAVE_PANTILT_DP
122 OpenedDevices_ =
false;
123 InitCameras_ =
false;
125 bSaveImages_ =
false;
126 bWriteBuffered_ =
false;
127 EmptyDevice_ =
false;
133 Win32DCAMNumber_ = 0;
135 #ifdef BIAS_HAVE_DCAM
138 FirstCameraID_ = 10000;
139 LastCameraID_ = FirstCameraID_;
140 TimerActive_ =
false;
144 grabMasterThread_ = NULL;
151 Timer_.SetOwner(
this, ID_Timer);
154 for (
int i = 0; i < NUMBER_CAMERAS; i++)
157 CamImg_.push_back(NULL);
158 CamImgMiddle_.push_back(NULL);
159 CamImgRight_.push_back(NULL);
161 CamImgPMDDepth_.push_back(NULL);
162 CamImgPMDAmp_.push_back(NULL);
163 CamImgPMDInt_.push_back(NULL);
164 XB3AllInOne_.push_back(NULL);
166 ThreadInited_.push_back(
false);
167 CameraActive_.push_back(
false);
168 CameraInitialized_.push_back(
false);
169 SetFirewireB_.push_back(
false);
170 SetTrigger_.push_back(
false);
171 SetUserMode_.push_back(
true);
172 SelectedFps_.push_back(15.0);
175 Format7BpP_.push_back(0);
176 Format7ColorMode_.push_back(0);
178 grabSingleThread_.push_back(NULL);
179 saveThreads_.push_back(NULL);
181 grabMasterThread_ = NULL;
184 BufferAccess_.push_back(NULL);
185 WriteIndex_.push_back(0);
186 ReadIndex_.push_back(BUFFER_SIZE-1);
195 for(
int j=0;j<BUFFER_SIZE;j++){
196 ImageBuffer_[i]->push_back(NULL);
197 ImageBufferMiddle_[i]->push_back(NULL);
198 ImageBufferRight_[i]->push_back(NULL);
199 ImageBufferPMDDepth_[i]->push_back(NULL);
200 ImageBufferPMDAmp_[i]->push_back(NULL);
201 ImageBufferPMDInt_[i]->push_back(NULL);
206 VideoControllers_.push_back(NULL);
207 std::vector<string> tmp;
208 DeviceChannelNames_.push_back(tmp);
209 DeviceChannel_.push_back(-1);
214 wxToolBar* toolBar = CreateToolBar();
215 toolBar->SetToolBitmapSize( wxSize( 24,24 ) );
216 toolBar->SetToolSeparation( 0 );
217 toolBar->SetToolPacking( 0 );
218 wxSize smallButtonSize(60,25);
219 wxSize mediumButtonSize(80,25);
220 wxSize largeButtonSize(110,25);
222 pButtonGrab=
new wxButton(toolBar, ID_Grab, wxT(
"Grab"),wxDefaultPosition,smallButtonSize);
223 pButtonGrab->SetToolTip(wxT(
"Grab single image."));
224 toolBar->AddControl(pButtonGrab);
226 pButtonContinuous=
new wxButton(toolBar, ID_GrabContinuous, wxT(
"Grab Cont."),wxDefaultPosition,mediumButtonSize);
227 pButtonContinuous->SetToolTip(wxT(
"Toggle grabbing continuously."));
228 toolBar->AddControl(pButtonContinuous);
233 pButtonStream=
new wxButton(toolBar, ID_GrabToStream, wxT(
"Grab To Stream"),wxDefaultPosition,largeButtonSize);
234 pButtonStream->SetToolTip(wxT(
"Toggle grabbing to stream."));
235 toolBar->AddControl(pButtonStream);
236 toolBar->AddSeparator();
238 pButtonIEEE1394=
new wxButton(toolBar,ID_FindIEEE1394, wxT(
"Find IEEE1394"),wxDefaultPosition,largeButtonSize);
239 pButtonIEEE1394->SetToolTip(wxT(
"Find Firewire IEEE1394 cameras."));
240 toolBar->AddControl(pButtonIEEE1394);
242 pButtonWebCams=
new wxButton(toolBar,ID_FindWebcams, wxT(
"Find V4L"),wxDefaultPosition,largeButtonSize);
243 pButtonWebCams->SetToolTip(wxT(
"Find V4L Cameras."));
244 toolBar->AddControl(pButtonWebCams);
246 #ifdef BIAS_HAVE_DSHOW
247 pButtonWebCams=
new wxButton(toolBar,ID_FindWebcams, wxT(
"Find DShow"),wxDefaultPosition,largeButtonSize);
248 pButtonWebCams->SetToolTip(wxT(
"Find DSHOW Cameras."));
249 toolBar->AddControl(pButtonWebCams);
251 #ifdef BIAS_HAVE_SWISSRANGER
252 pButtonSR=
new wxButton(toolBar,ID_FindSwissranger, wxT(
"Find SR"),wxDefaultPosition,smallButtonSize);
253 pButtonSR->SetToolTip(wxT(
"Find Swissranger ToF cameras."));
254 toolBar->AddControl(pButtonSR);
256 #ifdef BIAS_HAVE_PMD_PMDTec
257 pButtonPMDTec=
new wxButton(toolBar,ID_FindPMDTec, wxT(
"Find PMDTec"),wxDefaultPosition,largeButtonSize);
258 pButtonPMDTec->SetToolTip(wxT(
"Find PMDTec ToF cameras."));
259 toolBar->AddControl(pButtonPMDTec);
261 toolBar->AddSeparator();
263 pButtonController=
new wxButton(toolBar,ID_Controller, wxT(
"Controller"),wxDefaultPosition,mediumButtonSize);
264 pButtonController->SetToolTip(wxT(
"Show Videosource Controller"));
265 toolBar->AddControl(pButtonController);
266 toolBar->AddSeparator();
268 pCheckBoxFit =
new wxCheckBox(toolBar, ID_Fit, wxT(
"Fit window"));
269 toolBar->AddControl(pCheckBoxFit);
270 pCheckBoxKeepScrollPosition =
new wxCheckBox(toolBar, ID_KeepScroll, wxT(
"Keep Scroll"));
271 toolBar->AddControl(pCheckBoxKeepScrollPosition);
272 pCheckBoxKeepScrollPosition->SetValue(
true);
280 text.Printf(wxT(
"size: %4dx%4d"),0, 0);
281 SetStatusText(text, 1);
286 wxDefaultSize,wxSP_3D | wxSP_LIVE_UPDATE);
287 splitterWindow_->SetMinimumPaneSize(100);
290 wxSize imageSize(640,480);
291 IC_ =
new ImageCanvas(splitterWindow_,GetStatusBar(), 0,-1,wxDefaultPosition,imageSize);
292 IC_->SetEvtHandlerEnabled(
true);
293 IC_->KeepScrollPosition(
true);
295 cameraListPanel_ =
new wxPanel(splitterWindow_);
296 wxString choices[10];
297 for(
unsigned i=0;i<10;i++){
298 wxString str; str.Printf(wxT(
"Camera %d"),i);
301 cameraListBox_ =
new wxListBox(cameraListPanel_,ID_CAMERAS_LISTBOX,
302 wxDefaultPosition,wxSize(100,500), 10, choices,wxLB_SINGLE);
303 wxSize buttonSize(50,35);
304 wxButton *hideButton =
new wxButton(cameraListPanel_,ID_HIDE_CAMERALIST,
305 wxT(
"Hide"),wxDefaultPosition,buttonSize);
307 wxFlexGridSizer *rightPanelSizer =
new wxFlexGridSizer(2,1,2,2);
308 rightPanelSizer->AddGrowableRow(0);
309 rightPanelSizer->Add(cameraListBox_,1, wxEXPAND |wxALL , 5);
310 rightPanelSizer->Add(hideButton,1, wxALL , 5);
311 cameraListPanel_->SetSizer(rightPanelSizer);
314 splitterWindow_->SplitVertically(IC_,cameraListPanel_,-1);
317 string img = BIAS_IMG_DIR; img +=
"mipTestImage.gif";
320 ShowImage_.Init(640,480,3);
321 unsigned char color[3]={255,255,255};
322 ShowImage_.FillImageWithConstValue(color);
324 IC_->Show(ShowImage_,
"Camera Image");
327 wxBoxSizer *vbox =
new wxBoxSizer(wxVERTICAL);
328 vbox->Add(splitterWindow_,1, wxEXPAND |wxALL , 5);
336 Timer_.Start(Delay_);
345 for(
int i = 0; i < NUMBER_CAMERAS; i++){
346 if(grabSingleThread_[i] != NULL){
347 delete grabSingleThread_[i];
349 if(saveThreads_[i] != NULL){
350 delete saveThreads_[i];
360 vector<string> colorModels;
361 colorModels.push_back(
"CM_Default");
362 colorModels.push_back(
"CM_Grey");
363 colorModels.push_back(
"CM_RGB");
364 colorModels.push_back(
"CM_BGR");
365 colorModels.push_back(
"CM_YUYV422");
366 colorModels.push_back(
"CM_UYVY422");
367 colorModels.push_back(
"CM_YUV420P");
368 colorModels.push_back(
"CM_YUV444");
369 colorModels.push_back(
"CM_YUV411");
370 colorModels.push_back(
"CM_HSV");
371 colorModels.push_back(
"CM_HSI_OBS");
372 colorModels.push_back(
"CM_DV");
373 colorModels.push_back(
"CM_RGBA");
374 colorModels.push_back(
"CM_GreyA");
375 colorModels.push_back(
"CM_Bayer_RGGB");
376 colorModels.push_back(
"CM_Bayer_GBRG");
377 colorModels.push_back(
"CM_Bayer_GRBG");
378 colorModels.push_back(
"CM_Bayer_BGGR");
379 colorModels.push_back(
"CM_HSL");
380 colorModels.push_back(
"CM_hsL");
381 colorModels.push_back(
"CM_SymTensor2x2");
382 colorModels.push_back(
"CM_BGRA");
383 colorModels.push_back(
"CM_RGBE");
387 for (
int i = 0; i < NUMBER_CAMERAS; i++)
392 ParamCameras_[i] = AddParamEnum(
"CameraType" + number.str(),
393 "Type of camera", cameraNames_, 0, NULL, 0, i);
394 ParamColorModel_[i] = AddParamEnum(
"CameraColorModel" + number.str(),
395 "Color Model for camera", colorModels,
397 ParamFPS_[i] = AddParamDouble(
"CameraFPS" + number.str(),
398 "fps possibilities: 1.875 3.75 7.5 15.0 30.0 60.0 120.0 240.0",
399 0.0, 0.0, 240.0, 0, i);
400 ParamWidth_[i] = AddParamInt(
"CameraWidth" + number.str(),
401 "Width of camera", 0, 0, 10000, 0, i);
402 ParamHeight_[i] = AddParamInt(
"CameraHeight" + number.str(),
403 "Height of camera", 0, 0, 10000, 0, i);
406 ParamDown_[i] = AddParamInt(
"CameraDownsampling" + number.str(),
407 "Downsampling of camera", 0, 0, 10, 0, i);
408 ParamPort_[i] = AddParamInt(
"CameraPort" + number.str(),
409 "Port of NET camera", 0, 0, 100000, 0, i);
410 ParamIP_[i] = AddParamString(
"CameraIP" + number.str(),
411 "IP of NET camera",
"", 0, i);
412 ParamBitFile_[i]= AddParamString(
"CameraBitFile" + number.str(),
413 "Bit file for usb pmd cameras",
"", 0, i);
414 ParamDevice_[i] = AddParamString(
"CameraDevice" + number.str(),
415 "Device/Interface name of camera",
419 text<<number.str()<<
". Camera";
420 SetGroupName(i, text.str());
422 #ifdef BIAS_HAVE_PANTILT_DP
423 bUsePanTiltUnit_ = AddParamBool(
"UsePanTiltUnit",
"Use the Pan-Tilt-Unit?",
false,
424 'p', NUMBER_CAMERAS);
427 SetGroupName(NUMBER_CAMERAS, text.str());
430 ifstream ifs(PARAM_FILE_NAME);
432 WriteParameter(PARAM_FILE_NAME);
436 ReadParameter(PARAM_FILE_NAME);
438 UpdateParameter(argc, argv, PARAM_FILE_NAME);
452 #ifdef BIAS_HAVE_PANTILT_DP
454 if(panTiltControl_==NULL)
455 ret = InitPanTiltUnit();
456 if(ret && panTiltControlDialog_!=NULL)
457 panTiltControlDialog_->Show(
true);
462 #ifdef BIAS_HAVE_PANTILT_DP
465 bool ShowCamWxFrame::
470 if(panTiltControl_==NULL)
473 if(panTiltControlDialog_==NULL)
475 wxT(
"Pan-Tilt-Unit Control"));
477 bRet = panTiltControl_->InitPanTiltUnit(
"COM1");
479 bRet = panTiltControl_->InitPanTiltUnit(
"/dev/ttyUSB0");
482 panTiltControlDialog_->SetDPControl(panTiltControl_);
483 panTiltControlDialog_->Show(
true);
488 txt <<
"Could not open port for Directed Perception Control";
489 wxMessageDialog errorDialog1(
this,
AsciiToWx(txt.str().c_str()),
490 wxT(
"ShowCamWx - Error"),wxICON_ERROR|wxOK);
491 errorDialog1.ShowModal();
495 #endif //BIAS_HAVE_PANTILT_DP
503 BIASERR(
"Initialize params first");
507 bool foundCamera =
false;
508 for (
int i = 0; i < NUMBER_CAMERAS; i++) {
509 Cameras_.push_back(NULL);
520 # ifdef BIAS_HAVE_DCAM
522 # endif //BIAS_HAVE_DCAM
523 for(
int i = 0; i < NUMBER_CAMERAS; i++){
525 stringstream errorText;
527 if(*ParamCameras_[i] == 1){
528 #ifdef BIAS_HAVE_DCAM
531 if(CameraMenu_ == NULL)
532 CameraMenu_ =
new wxMenu;
534 for(
unsigned int k=0; k< IEEECameraInfo_.size();k++){
535 if(IEEECameraInfo_[k].camid == atoi((*ParamDevice_[i]).c_str())){
537 AddIEEECameraToMenu(i,k,
true);
542 errorText <<
"DCAM Camera in param file, please enable support in BIAS\n";
543 BIASERR(
"DCAM Camera in param file, please enable support in BIAS");
549 for(
int i = 0; i < NUMBER_CAMERAS; i++){
550 stringstream errorText;
552 if(*ParamCameras_[i] == 1){
553 #ifdef BIAS_HAVE_DCAM
556 if(CameraMenu_ == NULL)
557 CameraMenu_ =
new wxMenu;
559 for(
unsigned int k=0; k< IEEECameraInfo_.size();k++){
560 if(IEEECameraInfo_[k].camid == NumDcams + 1){
564 *ParamDevice_[i] = ss.str();
565 AddIEEECameraToMenu(i,k,
true);
571 errorText <<
"DCAM Camera in param file, please enable support in BIAS\n";
572 BIASERR(
"DCAM Camera in param file, please enable support in BIAS");
577 if(*ParamCameras_[i] == 2){
578 #ifdef BIAS_HAVE_PMD_PMDTec
579 AddPMDTecCameraToMenu(i,
true);
581 errorText <<
"PMDTec Camera in param file, please enable support in BIAS\n";
582 BIASERR(
"PMDTec Camera in param file, please enable support in BIAS");
588 if(*ParamCameras_[i] == 3){
589 #ifdef BIAS_HAVE_PMD_PMDZess
590 AddZessCameraToMenu(i,
true,
"");
592 errorText <<
"PMD Zess Camera in param file, please enable support in BIAS\n";
593 BIASERR(
"PMD Zess Camera in param file, please enable support in BIAS");
597 if(*ParamCameras_[i] == 5){
598 #ifdef BIAS_HAVE_UEYE
599 AddUEyeCameraToMenu(i,
"",
true);
601 errorText <<
"UEYE Camera in param file, please enable support in BIAS\n";
602 BIASERR(
"UEYE Camera in param file, please enable support in BIAS");
606 if(*ParamCameras_[i] == 9){
607 #ifdef BIAS_HAVE_SWISSRANGER
608 AddSwissRangerCameraToMenu(i,
true);
610 errorText <<
"SwissRanger Camera in param file, please enable support in BIAS\n";
611 BIASERR(
"SwissRanger Camera in param file, please enable support in BIAS");
616 if(*ParamCameras_[i] != 0) {
617 cout <<
"INIT CAM" << endl;
632 stringstream errorText;
634 BufferAccess_[i] =
new wxMutex;
636 ReadIndex_[i] = BUFFER_SIZE - 1;
638 if(CamImg_[i] == NULL)
643 switch(*ParamCameras_[i]){
651 SelectedModeFromMenu(i),
654 Format7ColorMode_[i],
656 Format7WidthHeight_[i]
671 if (*ParamBitFile_[i] ==
"") {
672 BIASERR(
"Specify bit file for usb pmd camera");
686 #ifdef BIAS_HAVE_DCAM
699 if (Cameras_[camindex] != NULL) {
700 switch(*ParamCameras_[camindex]) {
702 if(CamImgPMDDepth_[camindex] == NULL)
704 if(CamImgPMDAmp_[camindex] == NULL)
706 if(CamImgPMDInt_[camindex] == NULL)
710 if(CamImgPMDDepth_[camindex] == NULL)
712 if(CamImgPMDAmp_[camindex] == NULL)
716 ColorModels_[i] = Cameras_[i]->GetColorModel();
717 if(XB3AllInOne_[camindex] == NULL)
719 if(CamImgMiddle_[camindex] == NULL)
721 if(CamImgRight_[camindex] == NULL)
726 if(CamImgPMDDepth_[camindex] == NULL)
730 if(CamImgPMDDepth_[camindex] == NULL)
732 if(CamImgPMDInt_[camindex] == NULL)
741 if (Cameras_[i] == NULL) {
743 errorText << cameraNames_[i] <<
" Camera in param file, please enable support in BIAS\n";
745 BIASERR(cameraNames_[i] <<
" Camera in param file, please enable support in BIAS");
746 wxMessageDialog errorDialog1(
this,
748 wxT(
"ShowCamWx - Error"),
750 errorDialog1.ShowModal();
753 if (*ParamHeight_[i] != 0 && *ParamWidth_[i] != 0 && Cameras_[i] != NULL) {
754 Cameras_[i]->SetSize(*ParamWidth_[i], *ParamHeight_[i]);
758 if (*ParamFPS_[i] != 0.0 && Cameras_[i] != NULL) {
759 cout<<
"Setting "<<i<<
". camera fps to "<<*ParamFPS_[i]<<endl;
760 Cameras_[i]->SetFPS((
float) *ParamFPS_[i]);
763 CameraInitialized_[i] =
true;
778 if(!CameraInitialized_[i]){
784 if (*ParamDevice_[i] !=
"") {
785 if (Cameras_[i]->GetCapabilities((*ParamDevice_[i]).c_str(),caps) != 0 ) {
786 BIASERR(
"Could not get Capabilities for device:"<<*ParamDevice_[i]);
790 if ( Cameras_[i]->GetCapabilities(caps) != 0 ) {
791 BIASERR(
"Could not get Capabilities.");
795 Cameras_[i]->SetDeviceChannel(DeviceChannel_[i]);
796 Cameras_[i]->SetExternalTrigger(SetTrigger_[i]);
800 switch(*ParamCameras_[i]) {
805 if (!CameraInitialized_[i]) {
819 text <<
"Found more than one camera with no device name!\n";
821 wxMessageDialog errorDialog(
this,
823 wxT(
"ShowCamWx - Error"),
825 errorDialog.ShowModal();
829 text <<
"Camera DCAM " << i <<
" could not be opened";
830 wxMessageDialog errorDialog(
this,
832 wxT(
"ShowCamWx - Error"),
834 errorDialog.ShowModal();
841 if (!CameraInitialized_[i]) {
849 text <<
"Camera " << cameraNames_[ *ParamCameras_[i] ] <<
" " << i <<
" could not be opened";
850 wxMessageDialog errorDialog(
this,
852 wxT(
"ShowCamWx - Error"),
854 errorDialog.ShowModal();
862 NumCamSel_ = camindex;
866 if (Cameras_[i] != NULL)
870 Cameras_[i]->SetColorModel(ColorModels_[i]);
873 Cameras_[i]->InitImage(*CamImg_[i]);
875 switch(*ParamCameras_[i]) {
896 cout<<
"Initialized image with size "<<CamImg_[i]->GetWidth()<<
" x "<<CamImg_[i]->GetHeight()
897 <<
" and "<<CamImg_[i]->GetChannelCount()<<
" color channels"<<endl;
900 ret = Cameras_[i]->PreGrab();
901 if(ret < 0)
return ret;
902 Cameras_[i]->SetDebugLevel(1);
905 if(dynamic_cast<VideoSource_V4L*>(Cameras_[i]) != NULL)
906 Cameras_[i]->SetWaitForNew(
true);
911 if(!ThreadInited_[camindex])
912 ret = CreateGrabThreadForCamera_(i);
913 if(ret < 0)
return ret;
918 CameraActive_[camindex] =
true;
919 OpenedDevices_ =
true;
923 menuShow->Enable(
ID_Show1 + camindex,
true);
940 if(grabSingleThread_[camindex] != NULL){
941 ThreadInited_[camindex] =
false;
942 grabSingleThread_[camindex]->Delete();
944 grabSingleThread_[camindex] = NULL;
947 bool gmtLocked =
false;
948 bool noCamActive =
false;
949 if (grabMasterThread_ != NULL && Cameras_[camindex] != NULL) {
950 ServerMutex_[camindex]->Lock();
954 if(saveThreads_[camindex] != NULL){
955 saveThreads_[camindex]->Delete();
956 delete saveThreads_[camindex];
957 saveThreads_[camindex] = NULL;
960 if(BufferAccess_[camindex] != NULL){
961 delete BufferAccess_[camindex];
962 BufferAccess_[camindex] = NULL;
965 WriteIndex_[camindex] = 0;
966 ReadIndex_[camindex] = BUFFER_SIZE - 1;
968 CameraActive_[camindex] =
false;
969 CameraInitialized_[camindex] =
false;
971 if(CamImg_[camindex]!= NULL){
972 delete CamImg_[camindex];
973 CamImg_[camindex] = NULL;
975 if(CamImgPMDDepth_[camindex]!= NULL){
976 delete CamImgPMDDepth_[camindex];
977 CamImgPMDDepth_[camindex] = NULL;
979 if(CamImgPMDAmp_[camindex]!= NULL){
980 delete CamImgPMDAmp_[camindex];
981 CamImgPMDAmp_[camindex] = NULL;
983 if(CamImgPMDInt_[camindex]!= NULL){
984 delete CamImgPMDInt_[camindex];
985 CamImgPMDInt_[camindex] = NULL;
987 if(CamImgMiddle_[camindex]!= NULL){
988 delete CamImgMiddle_[camindex];
989 CamImgMiddle_[camindex] = NULL;
991 if(CamImgRight_[camindex]!= NULL){
992 delete CamImgRight_[camindex];
993 CamImgRight_[camindex] = NULL;
995 if(XB3AllInOne_[camindex]!= NULL){
996 delete XB3AllInOne_[camindex];
997 XB3AllInOne_[camindex] = NULL;
1004 menuShow->Enable(
ID_Show1 + camindex,
false);
1007 if (Cameras_[camindex] != NULL) {
1008 Cameras_[camindex]->PostGrab();
1009 Cameras_[camindex]->CloseDevice();
1010 delete Cameras_[camindex];
1011 Cameras_[camindex] = NULL;
1013 noCamActive = (ActiveCameras_ == 0);
1017 ServerCondition_[camindex]->Signal();
1018 ServerMutex_[camindex]->Unlock();
1024 TimerActive_ =
false;
1025 if(grabMasterThread_ != NULL){
1026 grabMasterThread_->Delete();
1028 grabMasterThread_=NULL;
1030 if(ServerCondition_[camindex] !=NULL){
1031 delete ServerCondition_[camindex];
1032 ServerCondition_[camindex]=NULL;
1034 if(ServerMutex_[camindex] !=NULL){
1035 delete ServerMutex_[camindex];
1036 ServerMutex_[camindex]=NULL;
1038 if(ClientsCondition_[camindex] !=NULL){
1039 delete ClientsCondition_[camindex];
1040 ClientsCondition_[camindex]=NULL;
1042 if(ClientsMutex_[camindex] !=NULL){
1043 delete ClientsMutex_[camindex];
1044 ClientsMutex_[camindex]=NULL;
1054 if (!InitCameras_) {
1055 BIASERR(
"Initialize cameras first");
1059 for (
int i = 0; i < NUMBER_CAMERAS; i++) {
1067 #ifdef BIAS_HAVE_DCAM
1068 int menuindex = (camindex + 1) * 10000;
1070 dc1394video_mode_t mode = DC1394_VIDEO_MODE_640x480_MONO8;
1071 bool foundItem =
false;
1078 wxMenuItem* menuItem = CameraMenu_->FindItem(menuindex);
1079 if(menuItem!= NULL && menuItem->IsChecked()){
1085 int modeindex = (menuindex % 10000 - 1);
1087 for(
unsigned int k=0; k< IEEECameraInfo_.size();k++){
1088 if(IEEECameraInfo_[k].camid == atoi((*ParamDevice_[camindex]).c_str())){
1090 mode = IEEECameraInfo_[k].videoModes[modeindex];
1093 cout <<
"Found mode: " << mode << endl;
1105 wxMenu *menuFile =
new wxMenu;
1106 menuFile->Append(
ID_Grab, wxT(
"Grab &single image") );
1107 menuFile->AppendCheckItem(
ID_GrabContinuous, wxT(
"Grab &continuously (Start/Stop)") );
1108 menuFile->AppendCheckItem(
ID_GrabToStream, wxT(
"Grab to stream (Start/Stop)") );
1109 menuFile->AppendSeparator();
1110 menuFile->Append(wxID_EXIT, wxT(
"E&xit") );
1112 menuShow =
new wxMenu;
1114 menuShow->Append(
ID_Show1, wxT(
"Camera &1") );
1115 menuShow->Append(
ID_Show2, wxT(
"Camera &2") );
1116 menuShow->Append(
ID_Show3, wxT(
"Camera &3") );
1117 menuShow->Append(
ID_Show4, wxT(
"Camera &4") );
1118 menuShow->Append(
ID_Show5, wxT(
"Camera &5") );
1119 menuShow->Append(
ID_Show6, wxT(
"Camera &6") );
1120 menuShow->Append(
ID_Show7, wxT(
"Camera &7") );
1121 menuShow->Append(
ID_Show8, wxT(
"Camera &8") );
1122 menuShow->Append(
ID_Show9, wxT(
"Camera &9") );
1123 menuShow->AppendSeparator();
1127 if(CameraMenu_ == NULL)
1128 CameraMenu_ =
new wxMenu;
1131 wxMenu *menuSearchCameras =
new wxMenu;
1132 menuSearchCameras->Append(
ID_FindIEEE1394, wxT(
"Scan for IEEE1394 Camera") );
1133 menuSearchCameras->Append(
ID_FindUEYE, wxT(
"Scan for UEYE Camera") );
1134 #ifdef BIAS_HAVE_V4L
1135 menuSearchCameras->Append(
ID_FindWebcams, wxT(
"Scan for Video4Linux cameras") );
1137 #ifdef BIAS_HAVE_SHOW
1138 menuSearchCameras->Append(
ID_FindWebcams, wxT(
"Scan for DShow cameras") );
1141 menuSearchCameras->Append(
ID_FindZess, wxT(
"Scan for Zess ToF") );
1142 menuSearchCameras->Append(
ID_FindPMDTec, wxT(
"Scan for PMDTec ToF") );
1143 menuSearchCameras->Append(
ID_FindKinect, wxT(
"Scan for Kinect") );
1144 menuSearchCameras->Append(
ID_FindOpenNI, wxT(
"Scan for OpenNI") );
1145 menuSearchCameras->Append(
ID_FindKinect2, wxT(
"Scan for Kinect2 (freenect2)") );
1149 wxMenu *menuParameters =
new wxMenu;
1153 wxMenu *menuHelp =
new wxMenu;
1154 menuHelp->Append(wxID_ABOUT);
1156 wxMenu *menuSpecial=
new wxMenu;
1158 #ifdef BIAS_HAVE_PANTILT
1162 #ifdef BIAS_HAVE_PANTILT_DP
1167 wxMenuBar *menuBar =
new wxMenuBar;
1168 menuBar->Append(menuFile, wxT(
"&File"));
1169 menuBar->Append(CameraMenu_, wxT(
"&Cameras"));
1170 menuBar->Append(menuSearchCameras, wxT(
"Camera &Scan"));
1171 menuBar->Append(menuParameters, wxT(
"&Parameters"));
1172 menuBar->Append(menuSpecial, wxT(
"&Extras"));
1173 menuBar->Append(menuShow, wxT(
"&Show"));
1174 menuBar->Append(menuHelp, wxT(
"&Help"));
1176 SetMenuBar(menuBar);
1179 for (
int i = 0; i < NUMBER_CAMERAS; i++) {
1180 if (Cameras_[i] == NULL) {
1181 menuShow->Enable(
ID_Show1 + i,
false);
1192 CameraMenu_ =
new wxMenu;
1195 #ifdef BIAS_HAVE_PANTILT_DP
1199 void ShowCamWxFrame::
1202 double pan=0.0, tilt=0.0;
1204 panTiltControl_->GetCurrentPositionRadians(pan, tilt);
1206 std::cout<<
"Current Position: "<<pan*180.0/M_PI<<
", "<<tilt*180.0/M_PI<<
" degree"<<std::endl;
1232 double *translation_rotated4_ptr = translation_rotated4.
GetData();
1233 for (
int i=0;i<3;i++)
1234 translation_rotated3.
GetData()[i] = translation_rotated4_ptr[i];
1241 tilt_matrix.GetQuaternion(tiltq);
1243 p.
SetC(translation_rotated3);
1247 cout<<
"Projection:"<<projHeader<<endl;
1257 bWriteBuffered_=
false;
1259 for (
int i = 0; i < NUMBER_CAMERAS; i++){
1260 if(saveThreads_[i]!=NULL && Cameras_[i] != NULL){
1262 saveThreads_[i]->Delete();
1263 saveThreads_[i] = NULL;
1272 cout <<
"leave StopSavingThreads" << endl;
1286 currentSaveDir_ = dir.str().c_str();
1288 ret = _mkdir(dir.str().c_str());
1290 ret = mkdir(dir.str().c_str(), 0755);
1296 bWriteBuffered_ =
true;
1301 #ifdef BIAS_HAVE_PANTILT_DP
1302 if(*bUsePanTiltUnit_){
1303 GetProjectionFromPanTilt_(projHeader);
1305 #endif //BIAS_HAVE_PANTILT_DP
1307 for (
int i = 0; i < NUMBER_CAMERAS; i++){
1309 if(Cameras_[i] != NULL){
1311 #ifdef BIAS_HAVE_PANTILT_DP
1312 if(*bUsePanTiltUnit_){
1313 (*CamImg_[i]).SetProj(projHeader);
1314 (*CamImg_[i]).UpdateMetaData();
1316 #endif //BIAS_HAVE_PANTILT_DP
1318 if(saveThreads_[i] == NULL){
1320 CreateImageSaveThreadForCamera_(i);
1321 saveThreads_[i]->SetSaveDirectory(currentSaveDir_);
1325 saveThreads_[i]->SetSaveDirectory(currentSaveDir_);
1326 saveThreads_[i]->ResetCounter();
1327 saveThreads_[i]->Resume();
1339 for (
int i = 0; i < NUMBER_CAMERAS; i++) {
1340 switch(*ParamColorModel_[i]) {
1376 unsigned int w = CamImg_[NumCamSel_]->GetWidth()*2;
1377 unsigned int h = CamImg_[NumCamSel_]->GetHeight();
1378 if (!CamImgCombined_.IsEmpty()) {
1380 || CamImgCombined_.GetWidth() != w || CamImgCombined_.GetHeight() != h)
1382 CamImgCombined_.Release();
1385 if (CamImgCombined_.IsEmpty()) {
1386 CamImgCombined_.Init(w,h,3);
1392 CamImgCombined_.SetROICorners(0, 0,
1393 CamImg_[NumCamSel_]->GetWidth(),
1394 CamImg_[NumCamSel_]->GetHeight());
1396 CamImgCombined_.Paste2ROI(tmpRgb);
1397 CamImgCombined_.SetROICorners(CamImg_[NumCamSel_]->GetWidth(),
1399 CamImg_[NumCamSel_]->GetWidth() * 2,
1400 CamImg_[NumCamSel_]->GetHeight());
1401 if(CamImgPMDDepth_[NumCamSel_] != NULL){
1404 tmpImg = *CamImgPMDDepth_[NumCamSel_];
1411 CamImgCombined_.Paste2ROI(tmpRgb);
1416 unsigned int w = 1920;
1417 unsigned int h = 1080 + 424;
1418 if (!CamImgCombined_.IsEmpty()) {
1420 || CamImgCombined_.GetWidth() != w || CamImgCombined_.GetHeight() != h)
1422 CamImgCombined_.Release();
1425 if (CamImgCombined_.IsEmpty()) {
1426 CamImgCombined_.Init(w,h,3);
1429 CamImgCombined_.SetROICorners(0, 0, 1920, 1080);
1431 CamImgCombined_.Paste2ROI(*CamImg_[NumCamSel_]);
1438 if(CamImgPMDDepth_[NumCamSel_] != NULL){
1439 tmpImg = *CamImgPMDDepth_[NumCamSel_];
1445 CamImgCombined_.Paste2ROI(tmpRgb);
1447 CamImgCombined_.SetROICorners(512, 1080, 512+512, 1080 + 424);
1448 if(CamImgPMDInt_[NumCamSel_] != NULL){
1449 tmpImg = *CamImgPMDInt_[NumCamSel_];
1455 CamImgCombined_.Paste2ROI(tmpRgb);
1460 unsigned wImg,wAmp,wDepth,hImg,hAmp,hDepth;
1461 ClientsMutex_[NumCamSel_]->Lock();
1465 ClientsMutex_[NumCamSel_]->Unlock();
1473 if(!CamImgCombined_.IsEmpty()) {
1474 CamImgCombined_.Release();
1477 CamImgCombined_.Init(wImg + wAmp + wDepth, hImg);
1479 if(wImg > 0 && hImg> 0)
1481 CamImgCombined_.SetROICorners(0, 0, wImg,hImg);
1482 CamImgCombined_.Paste2ROI(img);
1487 if(!imgAmp.
IsEmpty() && wAmp > 0 && hAmp > 0)
1494 CamImgCombined_.Paste2ROI(tmpImgUC);
1497 if(!imgDepth.
IsEmpty() && wDepth > 0 && hDepth > 0)
1499 CamImgCombined_.SetROICorners(wImg + wAmp, 0,
1500 wImg + wAmp + wDepth, hDepth);
1508 CamImgCombined_.Paste2ROI(tmpImgUC);
1519 wxFileDialog dialog(
this,wxT(
"Save Parameters"),wxT(
""),wxT(
""),
1520 wxT(
"MIP Parameter files (*.param)|*.param"),
1521 wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
1522 int ret = dialog.ShowModal();
1524 fileName = dialog.GetPath();
1525 WriteParameter(WxToAscii(fileName));
1548 for (
unsigned int i = 0; i < VideoControllers_.size(); i++) {
1549 if (VideoControllers_[i] != NULL) {
1550 if (VideoControllers_[i]->IsShown()) {
1551 VideoControllers_[i]->Close();
1552 delete VideoControllers_[i];
1559 for (
int i = 0; i < NUMBER_CAMERAS; i++) {
1563 for (
unsigned int i = 0; i < ServerMutex_.size();i++) {
1564 if(ServerMutex_[i] != NULL)
1565 delete ServerMutex_[i];
1566 ServerMutex_[i]=NULL;
1567 if(ServerCondition_[i] != NULL)
1568 delete ServerCondition_[i];
1569 ServerCondition_[i] = NULL;
1570 if(ClientsMutex_[i] != NULL)
1571 delete ClientsMutex_[i];
1572 ClientsMutex_[i]=NULL;
1573 if(ClientsCondition_[i] != NULL)
1574 delete ClientsCondition_[i];
1575 ClientsCondition_[i] = NULL;
1578 #ifdef BIAS_HAVE_PANTILT_DP
1579 if(*bUsePanTiltUnit_){
1580 if(panTiltControlDialog_->IsShown())
1581 panTiltControlDialog_->Hide();
1582 delete panTiltControlDialog_;
1584 if(panTiltControl_ != NULL){
1585 panTiltControl_->SetPosition(0,0);
1586 panTiltControl_->ClosePanTiltUnit();
1587 delete panTiltControl_;
1590 #endif //BIAS_HAVE_PANTILT_DP
1595 cout <<
"Cleaned up successfully" << endl;
1602 if (pCheckBoxKeepScrollPosition != NULL)
1605 IC_->KeepScrollPosition(pCheckBoxKeepScrollPosition->IsChecked());
1614 if (pCheckBoxKeepScrollPosition != NULL)
1617 IC_->KeepScrollPosition(pCheckBoxKeepScrollPosition->IsChecked());
1637 if(!bSingleSaveDirCreated_){
1643 currentSingleSaveDir_ = dir.str().c_str();
1646 ret = _mkdir(dir.str().c_str());
1648 ret = mkdir(dir.str().c_str(), 0755);
1653 bSingleSaveDirCreated_ =
true;
1656 for (
int i = 0; i < NUMBER_CAMERAS; i++){
1657 if(Cameras_[i] != NULL){
1658 SaveImageUnthreaded_(i);
1671 bSaveImages_ = !bSaveImages_;
1672 bSaveToStream_ =
false;
1674 StartSavingImagesToDisk();
1675 pButtonContinuous->SetLabel(_T(
"Stop"));
1678 StopSavingImagesToDisk();
1679 pButtonContinuous->SetLabel(_T(
"Grab Cont."));
1689 bSaveImages_ = !bSaveImages_;
1690 bSaveToStream_ =
true;
1692 StartSavingImagesToDisk();
1693 pButtonStream->SetLabel(_T(
"Stop"));
1696 StopSavingImagesToDisk();
1697 pButtonStream->SetLabel(_T(
"Grab to Stream"));
1704 int sel =
event.GetSelection();
1705 if(sel < NumOfCams_)
1711 splitterWindow_->Unsplit(cameraListPanel_);
1717 splitterWindow_->SplitVertically(IC_,cameraListPanel_,-1);
1725 NumCamSel_ =
event.GetId() -
ID_Show1;
1735 if (Cameras_[NumCamSel_] != NULL) {
1736 if (VideoControllers_[NumCamSel_] == NULL) {
1737 VideoControllers_[NumCamSel_] =
1739 if (VideoControllers_[NumCamSel_] == NULL) {
1740 BIASERR(
"Controller could not be created");
1742 VideoControllers_[NumCamSel_]->Show(
true);
1745 VideoControllers_[NumCamSel_]->Show(
true);
1750 wxMessageDialog errorDialog(
this,
1751 wxT(
"No correct camera was selected"),
1752 wxT(
"ShowCamWx - Error"),
1754 errorDialog.ShowModal();
1764 if(!OpenedDevices_){
1767 if(grabMasterThread_ != NULL){
1768 double fps = grabMasterThread_->fps_;
1769 FrameCounter_ = grabMasterThread_->FrameCounter_;
1771 text.Printf(wxT(
"%05d %2.1f fps "),FrameCounter_, fps);
1772 SetStatusText(text, 2);
1773 SelectAndShowCameraImage_();
1775 Timer_.Start(Delay_);
1782 if(tauControllerFrame_ == NULL){
1784 tauControllerFrame_->Show();
1787 tauControllerFrame_->Show();
1795 #ifdef BIAS_HAVE_PANTILT
1796 if(viscaControllerFrame_ == NULL){
1798 viscaControllerFrame_->Show();
1801 viscaControllerFrame_->Show();
1810 #ifdef BIAS_HAVE_DCAM
1813 if (NumIEEECams_ > 0) {
1815 text <<
"Found " << NumIEEECams_ <<
" IEEE1394 Cameras: " << endl << endl;
1817 for (
int i = 0; i < NumIEEECams_; i++) {
1818 text <<
"Camid: " << IEEECameraInfo_[i].camid <<
" "
1819 << IEEECameraInfo_[i].vendor <<
" " << IEEECameraInfo_[i].model
1822 text<<
"\nTrigger them?"<<endl;
1823 wxMessageDialog messageDialog(
this,
AsciiToWx(text.str().c_str()), wxT(
"Trigger- IEEE Cameras?"),
1824 wxYES_NO | wxNO_DEFAULT| wxICON_QUESTION);
1825 bool trigger =
false;
1826 if(messageDialog.ShowModal() == wxID_YES){
1830 for (
int i = 0; i < NumIEEECams_; i++) {
1833 for(
int j = 0; j < NUMBER_CAMERAS; j++){
1834 if(IEEECameraInfo_[i].camid == atoi((*ParamDevice_[j]).c_str())){
1838 SetTrigger_[NumOfCams_] = trigger;
1841 AddIEEECameraToMenu(NumOfCams_,i,
false);
1845 wxMessageDialog messageDialog(
this, wxT(
"Sorry, no IEEE Cameras found!!"), wxT(
"ShowCamWx - IEEE Camera Scan"), wxICON_ERROR | wxOK);
1846 messageDialog.ShowModal();
1849 wxMessageDialog messageDialog(
this, wxT(
"Sorry, DCAM support not activated in BIAS"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
1850 messageDialog.ShowModal();
1858 #ifdef BIAS_HAVE_V4L
1865 vector<string> devices;
1868 if (devices.size()==0) {
1870 wxMessageDialog messageDialog(
this, wxT(
"Sorry, no V4L devices found!!"), wxT(
"V4L Scan Error"), wxICON_ERROR | wxOK);
1871 messageDialog.ShowModal();
1875 else if(devices.size()>1)
1877 device = devices[0];
1879 wxArrayString array;
1880 stringstream helptext;
1881 helptext <<
"Select Device: ";
1882 for (
unsigned int k = 0; k< devices.size(); k++) {
1883 array.Add(
AsciiToWx(devices[k].c_str()));
1887 wxSingleChoiceDialog choiceDialog(
this, wxT(
"Please choose device"),
1888 #
if wxCHECK_VERSION(2, 9, 0)
1889 wxT(
"Choose Device"), array, (
void**)NULL, wxDEFAULT_DIALOG_STYLE
1891 wxT(
"Choose Device"), array, NULL, wxDEFAULT_DIALOG_STYLE
1893 | wxRESIZE_BORDER | wxOK | wxCANCEL| wxCENTRE);
1894 choiceDialog.SetSelection(0);
1895 ret = choiceDialog.ShowModal();
1896 if(ret == wxID_OK) {
1897 device = WxToAscii(array.Item(choiceDialog.GetSelection()));
1905 cout <<
"Using: "<<device<<endl;
1912 if(DeviceChannelNames_[NumOfCams_].size()>0){
1913 wxArrayString array;
1914 stringstream helptext;
1915 helptext <<
"Select Input Channel: ";
1916 for (
unsigned int k = 0; k< DeviceChannelNames_[NumOfCams_].size(); k++) {
1917 array.Add(
AsciiToWx(DeviceChannelNames_[NumOfCams_][k].c_str()));
1920 wxSingleChoiceDialog choiceDialog(
this, wxT(
"Please choose channel"),
1921 #
if wxCHECK_VERSION(2, 9, 0)
1922 wxT(
"Choose Channel"), array, (
void**)NULL, wxDEFAULT_DIALOG_STYLE
1924 wxT(
"Choose Channel"), array, NULL, wxDEFAULT_DIALOG_STYLE
1926 | wxRESIZE_BORDER | wxOK | wxCANCEL| wxCENTRE);
1927 choiceDialog.SetSelection(0);
1928 ret = choiceDialog.ShowModal();
1930 channel = choiceDialog.GetSelection();
1938 vector<VideoSourceCapabilities::ResolutionEntry> re;
1940 for (
unsigned int i=0;i<re.size();i++){
1941 cout <<
" Best for "<<re[i].width<<
"x"<<re[i].height<<
" is "
1942 <<re[i].colormodel<<
" at fps: "<<re[i].fps<<endl;
1947 wxMessageDialog messageDialog(
this, wxT(
"V4L device could not be queried!!"),
1948 wxT(
"V4L Scan Error"), wxICON_ERROR | wxOK);
1949 messageDialog.ShowModal();
1954 DeviceChannel_[NumOfCams_] = channel;
1960 wxMessageDialog messageDialog(
this, wxT(
"Sorry, v4l camera could not be opened!!"),
1961 wxT(
"V4L Camera Scan"), wxICON_ERROR | wxOK);
1962 messageDialog.ShowModal();
1969 text <<
"Found "<<devices.size()<<
" V4L Cameras.\n"<<
1970 "Opening first camera by default.\n\n";
1972 for (
unsigned i = 0; i < devices.size(); i++)
1973 text <<
"Id: " << devices[i] << endl;
1974 text<<
"\nTrigger them?"<<endl;
1976 wxMessageDialog messageDialog(
this,
AsciiToWx(text.str().c_str()), wxT(
"Trigger- IEEE Cameras?"),
1977 wxYES_NO | wxNO_DEFAULT| wxICON_QUESTION);
1978 bool trigger =
false;
1979 if(messageDialog.ShowModal() == wxID_YES){
1981 SetTrigger_[NumOfCams_] = trigger;
1987 AddWebcamToMenu(device,NumOfCams_,
false);
1991 #ifdef BIAS_HAVE_DSHOW
1995 vector<string> devices;
1999 if (devices.size() > 0) {
2000 text <<
"Found " << devices.size() <<
"DirectShow Cameras: " << endl << endl;
2001 for (
unsigned int i = 0; i < devices.size(); i++) {
2002 text <<
"Identifier: " << devices[i]<<endl;
2006 text <<
"Sorry no DirectShow Cameras found."<<endl;
2008 wxArrayString devStrings;
2009 for(
unsigned i=0;i<devices.size();i++){
2010 cout<<
"Found device:"<<devices[i]<<endl;
2016 wxSingleChoiceDialog wcbDlg(
this, wxT(
"Select camera."),
2017 wxT(
"DShow Cameras"), devStrings);
2018 wcbDlg.SetSelection(0);
2019 ret = wcbDlg.ShowModal();
2021 camera = WxToAscii(devStrings.Item(wcbDlg.GetSelection()));
2031 vector<VideoSourceCapabilities::ResolutionEntry> re;
2033 wxArrayString resStrings;
2034 for (
unsigned int i=0;i<re.size();i++){
2036 txt<<re[i].width<<
"x"<<re[i].height<<
" with "<<re[i].colormodel;
2042 wxSingleChoiceDialog resDlg(
this, wxT(
"Select resolution."),
2043 wxT(
"Available Configurations"),resStrings);
2044 resDlg.SetSelection(0);
2045 ret = resDlg.ShowModal();
2047 index = resDlg.GetSelection();
2054 *ParamWidth_[NumOfCams_] = re[index].width;
2055 *ParamHeight_[NumOfCams_] = re[index].height;
2056 *ParamColorModel_[NumOfCams_] = re[index].colormodel;
2058 vs->
SetSize(re[index].width,re[index].height);
2063 wxMessageDialog messageDialog(
this, wxT(
"Sorry, DSHOW camera could not be opened!!"),
2064 wxT(
"DShow Camera Scan"), wxICON_ERROR | wxOK);
2065 messageDialog.ShowModal();
2071 for(
unsigned i=0;i<devices.size();i++){
2072 *ParamDevice_[NumOfCams_]=devices[i];
2073 AddWebcamToMenu(devices[i], NumOfCams_,
false);
2082 #ifdef BIAS_HAVE_UEYE
2085 std::vector<std::string> ret = ueye.
GetDevices();
2087 if (ret.size() == 0) {
2089 wxMessageDialog messageDialog(
this, wxT(
"Sorry, UEYE not found!!"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2090 messageDialog.ShowModal();
2092 for (
unsigned int i=0;i<ret.size();i++) {
2094 AddUEyeCameraToMenu(NumOfCams_, ret[i],
false);
2098 wxMessageDialog messageDialog(
this, wxT(
"Sorry, UEYE support not activated in BIAS"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2099 messageDialog.ShowModal();
2107 #ifdef BIAS_HAVE_PMD_PMDTec
2109 *ParamCameras_[NumOfCams_] = 2;
2114 int ret = dlg->ShowModal();
2116 sourcePlugin_ = WxToAscii(dlg->
GetString1());
2120 sourcePlugin_ =BIAS_PMD_PMDTec_SOURCEPLUGIN;
2121 procPlugin_= BIAS_PMD_PMDTec_PROCPLUGIN;
2125 ret = OpenDevice(NumOfCams_);
2128 wxMessageDialog messageDialog(
this, wxT(
"Sorry, PMDTec Camera not found!!"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2129 messageDialog.ShowModal();
2130 delete Cameras_[NumOfCams_];
2133 AddPMDTecCameraToMenu(NumOfCams_,
true);
2136 wxMessageDialog messageDialog(
this, wxT(
"Sorry, PMDTec support not activated in BIAS"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2137 messageDialog.ShowModal();
2146 #ifdef BIAS_HAVE_PMD_PMDZess
2150 wxTextEntryDialog dialog (
this,wxT(
"Please insert path to bitfile,\n else ShowCamWx will try to open default file"),wxT(
"Searching for PMD Zess"),wxT(
""));
2153 wxString wxStr = dialog.GetValue();
2155 wxStr =
"C:\\ExternLibs\\PMDZess\\Bitfiles\\default.rbt";
2162 wxMessageDialog messageDialog(
this, wxT(
"Sorry, PMD Zess not found!!"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2163 messageDialog.ShowModal();
2170 AddZessCameraToMenu(NumOfCams_,
false,wxStr.c_str());
2173 wxMessageDialog messageDialog(
this, wxT(
"Sorry, PMD Zess support not activated in BIAS"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2174 messageDialog.ShowModal();
2175 #endif //BIAS_HAVE_PMD_PMDZess
2182 #ifdef BIAS_HAVE_SWISSRANGER
2184 *ParamCameras_[NumOfCams_] = 9;
2185 stringstream message;
2186 message<<
"Trigger Swissranger?";
2187 wxMessageDialog dlg (
this, wxT(
"Trigger Swissranger?"),
2189 wxYES_NO | wxNO_DEFAULT| wxICON_QUESTION);
2190 if(dlg.ShowModal() == wxID_YES){
2191 SetTrigger_[NumOfCams_] =
true;
2194 SetTrigger_[NumOfCams_] =
false;
2198 int ret = OpenDevice(NumOfCams_);
2202 wxMessageDialog messageDialog(
this, wxT(
"Sorry, SwissRanger not found!!"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2203 messageDialog.ShowModal();
2204 delete Cameras_[NumOfCams_];
2207 AddSwissRangerCameraToMenu(NumOfCams_,
true);
2210 wxMessageDialog messageDialog(
this, wxT(
"Sorry, SwissRanger support not activated in BIAS"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2211 messageDialog.ShowModal();
2220 #ifdef BIAS_HAVE_KINECT
2222 *ParamCameras_[NumOfCams_] = 12;
2223 SetTrigger_[NumOfCams_] =
false;
2225 int ret = OpenDevice(NumOfCams_);
2229 wxMessageDialog messageDialog(
this, wxT(
"Sorry, Kinect not found!!"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2230 messageDialog.ShowModal();
2231 delete Cameras_[NumOfCams_];
2234 AddKinectCameraToMenu(NumOfCams_,
true);
2237 wxMessageDialog messageDialog(
this, wxT(
"Sorry, Kinect support not activated in BIAS"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2238 messageDialog.ShowModal();
2245 #ifdef BIAS_HAVE_OPENNI
2252 *ParamDevice_[NumOfCams_+i] = ss.str();
2254 SetTrigger_[NumOfCams_+i] =
false;
2258 int ret = OpenDevice(NumOfCams_);
2262 wxMessageDialog messageDialog(
this, wxT(
"Sorry, OpenNI not found!!"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2263 messageDialog.ShowModal();
2264 delete Cameras_[NumOfCams_];
2267 AddOpenNICameraToMenu(NumOfCams_,
true);
2271 wxMessageDialog messageDialog(
this, wxT(
"Sorry, OpenNI support not activated in BIAS"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2272 messageDialog.ShowModal();
2278 #ifdef BIAS_HAVE_KINECT2
2285 *ParamDevice_[NumOfCams_+i] = ss.str();
2287 SetTrigger_[NumOfCams_+i] =
false;
2291 int ret = OpenDevice(NumOfCams_);
2295 wxMessageDialog messageDialog(
this, wxT(
"Sorry, OpenNI not found!!"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2296 messageDialog.ShowModal();
2297 delete Cameras_[NumOfCams_];
2300 AddKinect2CameraToMenu(NumOfCams_,
true);
2304 wxMessageDialog messageDialog(
this, wxT(
"Sorry, OpenNI support not activated in BIAS"), wxT(
"ShowCamWx - Camera Scan"), wxICON_ERROR | wxOK);
2305 messageDialog.ShowModal();
2313 #ifdef BIAS_HAVE_SWISSRANGER
2314 void ShowCamWxFrame::AddSwissRangerCameraToMenu(
int camindex,
bool fromFile){
2315 wxMenu* menuItem =
new wxMenu;
2317 int id = (camindex + 1) * 10000;
2322 menuItem->AppendCheckItem(
id,wxT(
"Activate Camera"));
2324 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2327 menuItem->Check(
id,
true);
2330 menuItem->AppendCheckItem(
id,wxT(
"Trigger Camera"));
2331 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2333 menuItem->Check(
id, SetTrigger_[camindex]);
2335 CameraMenu_->Append(LastCameraID_,wxT(
"SwissRanger"),menuItem);
2337 *ParamCameras_[camindex] = 9;
2347 #ifdef BIAS_HAVE_KINECT
2348 void ShowCamWxFrame::AddKinectCameraToMenu(
int camindex,
bool fromFile){
2349 wxMenu* menuItem =
new wxMenu;
2351 int id = (camindex + 1) * 10000;
2356 menuItem->AppendCheckItem(
id,wxT(
"Activate Camera"));
2358 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2361 menuItem->Check(
id,
true);
2363 CameraMenu_->Append(LastCameraID_,wxT(
"Kinect"),menuItem);
2365 *ParamCameras_[camindex] = 12;
2374 #ifdef BIAS_HAVE_OPENNI
2375 void ShowCamWxFrame::AddOpenNICameraToMenu(
int camindex,
bool fromFile){
2376 wxMenu* menuItem =
new wxMenu;
2378 int id = (camindex + 1) * 10000;
2383 menuItem->AppendCheckItem(
id,wxT(
"Activate Camera"));
2385 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2388 menuItem->Check(
id,
true);
2390 CameraMenu_->Append(LastCameraID_,wxT(
"OpenNI"),menuItem);
2392 *ParamCameras_[camindex] = 13;
2400 #ifdef BIAS_HAVE_KINECT2
2401 void ShowCamWxFrame::AddKinect2CameraToMenu(
int camindex,
bool fromFile){
2402 wxMenu* menuItem =
new wxMenu;
2404 int id = (camindex + 1) * 10000;
2409 menuItem->AppendCheckItem(
id,wxT(
"Activate Camera"));
2411 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2414 menuItem->Check(
id,
true);
2416 CameraMenu_->Append(LastCameraID_,wxT(
"Kinect2"),menuItem);
2427 #ifdef BIAS_HAVE_PMD_PMDTec
2428 void ShowCamWxFrame::AddPMDTecCameraToMenu(
int camindex,
bool fromFile){
2429 wxMenu* menuItem =
new wxMenu;
2431 int id = (camindex + 1) * 10000;
2436 menuItem->AppendCheckItem(
id,wxT(
"Activate Camera"));
2440 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2443 menuItem->Check(
id,
true);
2446 menuItem->AppendCheckItem(
id,wxT(
"Trigger Camera"));
2447 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2449 menuItem->Check(
id, SetTrigger_[camindex]);
2451 CameraMenu_->Append(LastCameraID_,wxT(
"PMDTec Camera"),menuItem);
2453 *ParamCameras_[camindex] = 2;
2463 #ifdef BIAS_HAVE_PMD_PMDZess
2464 void ShowCamWxFrame::AddZessCameraToMenu(
int camindex,
bool fromFile, std::string paramFile){
2465 wxMenu* menuItem =
new wxMenu;
2467 int id = (camindex + 1) * 10000;
2472 menuItem->AppendCheckItem(
id,wxT(
"Activate Camera"));
2476 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2479 menuItem->Check(
id,
true);
2482 menuItem->AppendCheckItem(
id,wxT(
"Trigger Camera"));
2483 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2485 menuItem->Check(
id, SetTrigger_[camindex]);
2487 CameraMenu_->Append(LastCameraID_,wxT(
"PMD Zess"),menuItem);
2489 *ParamCameras_[camindex] = 3;
2490 *ParamBitFile_[camindex] = paramFile;
2491 OpenDevice(camindex);
2496 #endif //BIAS_HAVE_PMD_PMDZess
2502 wxMenu* menuItem =
new wxMenu;
2504 int id = (camindex + 1) * 10000;
2509 for (
int i = 0; i < 6; i++) {
2542 menuItem->AppendRadioItem(
id,
AsciiToWx(ss.str().c_str()));
2544 Connect(
id, wxEVT_COMMAND_MENU_SELECTED,
2548 menuItem->Check(
id,
true);
2551 menuItem->AppendSeparator();
2552 menuItem->AppendCheckItem(
id,wxT(
"Activate Camera"));
2556 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2559 menuItem->Check(
id,
true);
2562 menuItem->AppendCheckItem(
id,wxT(
"Trigger Camera"));
2563 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2565 menuItem->Check(
id,
false);
2567 CameraMenu_->Append(LastCameraID_,wxT(
"UEYE"),menuItem);
2569 *ParamCameras_[camindex] = 5;
2570 *ParamDevice_[camindex] = camId;
2571 OpenDevice(camindex);
2580 wxMenu* menuItem =
new wxMenu;
2582 int id = (camindex + 1) * 10000;
2585 for(
int i=0;i<(int)DeviceChannelNames_[camindex].size();i++){
2588 if(DeviceChannel_[camindex] == i) ckid = id;
2590 string s= DeviceChannelNames_[camindex][i];
2592 stringstream helptext; helptext<<s;
2593 menuItem->AppendRadioItem(
id,
AsciiToWx(s.c_str()),
AsciiToWx(helptext.str().c_str()));
2598 menuItem->Check(ckid,
true);
2599 menuItem->AppendSeparator();
2603 menuItem->AppendCheckItem(
id,wxT(
"Activate Camera"));
2605 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2607 menuItem->Check(
id,
false);
2611 menuItem->AppendCheckItem(
id,wxT(
"Trigger Camera"));
2612 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2614 menuItem->Check(
id, SetTrigger_[camindex]);
2617 CameraMenu_->Append(LastCameraID_,
AsciiToWx(name),menuItem);
2621 *ParamCameras_[camindex] = 8;
2630 #ifdef BIAS_HAVE_DCAM
2632 stringstream camtext;
2633 camtext << IEEECameraInfo_[IEEEIndex].vendor <<
" " << IEEECameraInfo_[IEEEIndex].model;
2635 wxMenu* menuItem =
new wxMenu;
2636 int id = (camindex + 1) * 10000;
2641 for (
unsigned int j = 0; j < IEEECameraInfo_[IEEEIndex].videoModes.size(); j++) {
2645 dc1394video_mode_t mode = IEEECameraInfo_[IEEEIndex].videoModes[j];
2650 if (IEEECameraInfo_[IEEEIndex].bestMode == mode) {
2655 stringstream helptext;
2656 if(mode < DC1394_VIDEO_MODE_EXIF){
2657 helptext <<
"Supported Fps: ";
2658 for(
unsigned int k = 0; k < IEEECameraInfo_[IEEEIndex].framerates[j].size(); k++){
2659 helptext << IEEECameraInfo_[IEEEIndex].framerates[j][k] <<
", ";
2662 helptext <<
"Format 7";
2665 menuItem->AppendRadioItem(
id,
AsciiToWx(s.c_str()),
AsciiToWx(helptext.str().c_str()));
2668 Connect(
id, wxEVT_COMMAND_MENU_SELECTED,
2672 menuItem->Check(ckid,
true);
2673 menuItem->AppendSeparator();
2674 if (IEEECameraInfo_[IEEEIndex].b_capable) {
2677 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2680 menuItem->AppendCheckItem(
id,wxT(
"Activate Firewire B"));
2681 menuItem->Check(
id,
true);
2682 SetFirewireB_[camindex] =
true;
2687 menuItem->AppendCheckItem(
id,wxT(
"Activate Camera"));
2690 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2694 menuItem->Check(
id,
true);
2698 menuItem->AppendCheckItem(
id,wxT(
"Trigger Camera"));
2699 Connect(
id,wxEVT_COMMAND_MENU_SELECTED,
2701 menuItem->Check(
id, SetTrigger_[camindex]);
2703 CameraMenu_->Append(LastCameraID_,
AsciiToWx(camtext.str().c_str()), menuItem);
2705 *ParamCameras_[camindex] = 1;
2706 cout << IEEECameraInfo_[IEEEIndex].model << endl;
2707 if (IEEECameraInfo_[IEEEIndex].model.find(
"XB3") != string::npos || IEEECameraInfo_[IEEEIndex].model.find(
"BumbleBee") != string::npos)
2708 *ParamCameras_[camindex] = 10;
2709 std::ostringstream buffer;
2710 buffer << IEEECameraInfo_[IEEEIndex].camid;
2711 *ParamDevice_[camindex] = buffer.str();
2714 SelectedFps_[camindex] = IEEECameraInfo_[IEEEIndex].bestFramerate;
2723 #ifdef BIAS_HAVE_DCAM
2729 cout<<
"Camindex:"<<camindex<<endl;
2734 wxT(
"Select Format"),wxDefaultPosition,wxSize(550,400));
2738 unsigned int IEEEIndex = 0;
2740 for (
unsigned int j = 0; j < IEEECameraInfo_.size(); j++) {
2741 if (IEEECameraInfo_[j].camid == atoi((*ParamDevice_[camindex]).c_str())) {
2746 unsigned int modeindex = 0;
2747 for(
unsigned int j = 0; j < IEEECameraInfo_[IEEEIndex].f7_modes.size();j++){
2748 if(IEEECameraInfo_[IEEEIndex].f7_modes[j] == mode)
2753 format7Frame_->SetXSize(IEEECameraInfo_[IEEEIndex].f7_unitWidth[modeindex],
2754 IEEECameraInfo_[IEEEIndex].f7_maxWidth[modeindex]);
2755 format7Frame_->SetXOffset(0,IEEECameraInfo_[IEEEIndex].f7_maxWidth[modeindex]);
2756 format7Frame_->SetYSize(IEEECameraInfo_[IEEEIndex].f7_unitHeight[modeindex],
2757 IEEECameraInfo_[IEEEIndex].f7_maxHeight[modeindex]);
2758 format7Frame_->SetYOffset(0,IEEECameraInfo_[IEEEIndex].f7_maxHeight[modeindex]);
2759 format7Frame_->SetBpP(IEEECameraInfo_[IEEEIndex].f7_MinBpP[modeindex],
2760 IEEECameraInfo_[IEEEIndex].f7_MaxBpP[modeindex],
2761 IEEECameraInfo_[IEEEIndex].f7_bestBpP[modeindex]);
2763 format7Frame_->SetCameraIDandMode(IEEECameraInfo_[IEEEIndex].camid, mode);
2766 int ret = format7Frame_->ShowModal();
2767 if (ret == wxID_CANCEL){
2771 Format7LeftTop_[camindex] =
Vector2<int>(format7Frame_->xOffset,format7Frame_->yOffset);
2772 Format7WidthHeight_[camindex] =
Vector2<int>(format7Frame_->xSize,format7Frame_->ySize);
2773 Format7BpP_[camindex] = format7Frame_->bpp;
2774 Format7ColorMode_[camindex] = format7Frame_->colorMode;
2775 ViewColorMode_[camindex] = format7Frame_->colorModeView;
2776 cout<<
"Selection:"<<Format7LeftTop_[camindex]<<
" , Colormode: " << ViewColorMode_[camindex] <<
" " << (int)ViewColorMode_[camindex] << endl;
2790 int camindex =
event.GetId() / 10000 - 1;
2792 int deviceChannelID = (
event.GetId() % 10000) - 1;
2794 switch (*ParamCameras_[camindex]) {
2796 int index = deviceChannelID;
2798 if (CameraActive_[camindex])
2800 CloseDevice(camindex);
2802 DeviceChannel_[camindex] = index;
2803 OpenDevice(camindex);
2806 DeviceChannel_[camindex] = index;
2822 int camindex =
event.GetId() / 10000 - 1;
2823 int modeindex = (
event.GetId() % 10000) - 1;
2824 SetUserMode_[camindex] =
true;
2826 switch (*ParamCameras_[camindex]) {
2828 #ifdef BIAS_HAVE_DCAM
2829 unsigned int IEEEIndex = 0;
2831 for (
unsigned int j = 0; j < IEEECameraInfo_.size(); j++) {
2832 if (IEEECameraInfo_[j].camid == atoi((*ParamDevice_[camindex]).c_str())) {
2837 if(IEEECameraInfo_[IEEEIndex].videoModes[modeindex] < DC1394_VIDEO_MODE_EXIF){
2840 wxArrayString array;
2841 stringstream helptext;
2842 helptext <<
"Supported Fps: ";
2843 for (
unsigned int k = 0; k
2844 < IEEECameraInfo_[IEEEIndex].framerates[modeindex].size(); k++) {
2846 fpss << IEEECameraInfo_[IEEEIndex].framerates[modeindex][k];
2847 array.Add(
AsciiToWx(fpss.str().c_str()));
2850 wxSingleChoiceDialog choiceDialog((
wxWindow*)
this, wxT(
"Please choose framerate"),
2851 wxT(
"Choose Framerate"), array, (
char**)NULL,
2852 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL| wxCENTRE);
2855 choiceDialog.ShowModal();
2856 int selectedFps = choiceDialog.GetSelection();
2857 SelectedFps_[camindex]
2858 = IEEECameraInfo_[IEEEIndex].framerates[modeindex][selectedFps];
2864 int ret = ShowFormat7Selector(camindex,IEEECameraInfo_[IEEEIndex].videoModes[modeindex]);
2870 if (CameraActive_[camindex]) {
2871 CloseDevice(camindex);
2874 OpenDevice(camindex);
2876 OnChangeActivate(event);
2877 int id = IEEECameraInfo_[IEEEIndex].videoModes.size();
2878 id += (camindex + 1) * 10000 + 1;
2879 if (IEEECameraInfo_[IEEEIndex].b_capable)
2882 item = CameraMenu_->FindItem(
id);
2885 CloseDevice(camindex);
2887 OpenDevice(camindex);
2897 switch (modeindex) {
2919 *ParamFPS_[camindex] = fps;
2922 if (CameraActive_[camindex]) {
2923 CloseDevice(camindex);
2926 OpenDevice(camindex);
2938 int camindex =
event.GetId()/10000 -1;
2939 if(CameraActive_[camindex])
2940 CloseDevice(camindex);
2944 OpenDevice(camindex);
2952 int camindex =
event.GetId() / 10000 - 1;
2954 if (SetFirewireB_[camindex]) {
2955 cout<<
"Setting 1394b false."<<endl;
2956 SetFirewireB_[camindex] =
false;
2958 cout<<
"Setting 1394b true."<<endl;
2959 SetFirewireB_[camindex] =
true;
2963 if (CameraActive_[camindex]) {
2964 CloseDevice(camindex);
2967 OpenDevice(camindex);
2974 int camindex =
event.GetId() / 10000 - 1;
2976 if (SetTrigger_[camindex]) {
2977 cout<<
"Setting Trigger false."<<endl;
2978 SetTrigger_[camindex] =
false;
2980 cout<<
"Setting Trigger true."<<endl;
2981 SetTrigger_[camindex] =
true;
2985 if (CameraActive_[camindex]) {
2986 CloseDevice(camindex);
2989 OpenDevice(camindex);
2998 if (Cameras_[NumCamSel_] != NULL && CamImg_[NumCamSel_] != NULL)
3001 unsigned int height;
3002 switch (*ParamCameras_[NumCamSel_]) {
3008 InitCombinedImage();
3009 ShowImage_ = CamImgCombined_;
3012 if (VideoControllers_[NumCamSel_]!=NULL) {
3013 ShowXB3_ = VideoControllers_[NumCamSel_]->GetSelectedImage();
3016 case 1: ShowImage_ = *CamImg_[NumCamSel_];
break;
3017 case 2: ShowImage_ = *CamImgMiddle_[NumCamSel_];
break;
3018 case 3: ShowImage_ = *CamImgRight_[NumCamSel_];
break;
3019 case 4: ShowImage_ = *XB3AllInOne_[NumCamSel_];
break;
3020 case 0: ShowImage_ = *XB3AllInOne_[NumCamSel_];
3027 ShowImage_ = *CamImg_[NumCamSel_];
3074 int downSample = *ParamDown_[NumCamSel_];
3075 if (downSample != 0) {
3078 rescale.
Downsample(ShowImage_, rescaledImage,
3079 (
int)(ShowImage_.GetWidth() / downSample),
3080 (
int)(ShowImage_.GetHeight() / downSample));
3081 ShowImage_ = rescaledImage;
3087 height = ShowImage_.GetHeight();
3088 int widthClient=0, heightClient=0;
3089 IC_->GetSize(&widthClient, &heightClient);
3093 if (pCheckBoxFit->IsChecked()) {
3096 float xscale = (float)widthClient / width;
3097 float yscale = (float)heightClient / height;
3098 float scale = xscale < yscale ? xscale : yscale;
3100 IC_->SetScaledImageSize(width * scale, height* scale);
3101 IC_->SetShowScaled(
true);
3104 IC_->SetShowScaled(
false);
3108 if (width != LastWidth_ || height != LastHeight_){
3110 LastHeight_ = height;
3116 IC_->Show(ShowImage_,
"Camera Image");
3119 text.Printf(wxT(
"size: %4dx%4d"),width,height);
3120 SetStatusText(text, 1);
3128 int code =
event.GetKeyCode();
3138 OnGrabContinuous(e);
3156 desc << wxT(
"This tool biasShowCamWX is part of the\n");
3157 desc << wxT(
"BIAS library (Basic ImageAlgorithmS)\n");
3158 desc << wxT(
"It is used to open cameras and grab images to disk.\n\n");
3161 text <<
"Built on " << __DATE__ <<
" " << __TIME__ <<
"\n"
3163 <<
"GUI using: " << WxToAscii(wxVERSION_STRING)<<
"\n";
3164 text<<
"Built with support for:\n";
3165 #ifdef BIAS_HAVE_DCAM
3166 text<<
"- Firewire/IEEE1394 (CMU).\n";
3168 #ifdef BIAS_HAVE_DSHOW
3169 text<<
"- DirectShow.\n";
3171 #ifdef BIAS_HAVE_V4L
3172 text<<
"- Video4Linux.\n";
3174 #ifdef BIAS_HAVE_SWISSRANGER
3175 text<<
"- Swissranger.\n";
3177 #ifdef BIAS_HAVE_KINECT
3178 text<<
"- Kinect (libfreenect).\n";
3180 #ifdef BIAS_HAVE_OPENNI
3181 text<<
"- Kinect (OpenNI).\n";
3183 #ifdef BIAS_HAVE_KINECT2
3184 text<<
"- Kinect2 (freenect2).\n";
3186 #ifdef BIAS_HAVE_FFMPEG
3187 text<<
"- FFMPEG.\n";
3189 #ifdef BIAS_HAVE_PMD_PMDTec
3190 text<<
"- PMDTec Camcube.\n";
3192 #ifdef BIAS_HAVE_UEYE
3193 text<<
"- IDS Ueye.\n";
3197 wxString lic = wxT(
"BIAS is free software; you can redistribute it and/or modify\n \
3198 it under the terms of the GNU Lesser General Public Licence as published by\n \
3199 the Free Software Foundation; either version 2.1 of the Licence, or\n \
3200 (at your option) any later version.\n \
3202 BIAS is distributed in the hope that it will be useful,\n \
3203 but WITHOUT ANY WARRANTY; without even the implied warranty of\n \
3204 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n \
3205 GNU Lesser General Public Licence for more details.\n \
3207 You should have received a copy of the GNU Lesser General Public Licence\n \
3208 along with BIAS; if not, write to the Free Software\n \
3209 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n");
3211 wxAboutDialogInfo aboutdlg;
3212 aboutdlg.SetDescription( desc );
3213 aboutdlg.SetLicence( lic );
3214 aboutdlg.SetCopyright( wxT(
"Copyright (C) 2003-20011\n \
3215 Multimediale Systeme der Informationsverarbeitung\n \
3216 Institut fuer Informatik\n \
3217 Christian-Albrechts-Universitaet Kiel") );
3218 aboutdlg.SetWebSite( wxT(
"http://www.mip.informatik.uni-kiel.de/") );
3220 wxAboutBox( aboutdlg );
3227 paramFrame_ = GetFrame(
this);
3228 paramFrame_->Show(
true);
3229 paramFrame_->Move( wxPoint(500,200));
3237 switch(*ParamCameras_[cameraIndex]) {
3239 text.Printf(wxT(
"SINGLE-CAM%02d-%05d-int.mip"), cameraIndex, GrabCounter_);
3240 CamImgPMDInt_[cameraIndex]->UpdateMetaData();
3241 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImgPMDInt_[cameraIndex]);
3244 CamImg_[cameraIndex]->UpdateMetaData();
3245 text.Printf(wxT(
"SINGLE-CAM%02d-%05d-grey.mip"), cameraIndex, GrabCounter_);
3246 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImg_[cameraIndex]);
3248 text.Printf(wxT(
"SINGLE-CAM%02d-%05d-depth.mip"), cameraIndex, GrabCounter_);
3249 CamImgPMDDepth_[cameraIndex]->UpdateMetaData();
3250 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImgPMDDepth_[cameraIndex]);
3252 text.Printf(wxT(
"SINGLE-CAM%02d-%05d-amp.mip"), cameraIndex, GrabCounter_);
3253 CamImgPMDAmp_[cameraIndex]->UpdateMetaData();
3254 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImgPMDAmp_[cameraIndex]);
3258 text.Printf(wxT(
"SINGLE-CAM%02d-left-%05d.mip"), cameraIndex, GrabCounter_);
3259 CamImg_[cameraIndex]->UpdateMetaData();
3260 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImg_[cameraIndex]);
3262 text.Printf(wxT(
"SINGLE-CAM%02d-center-%05d.mip"), cameraIndex, GrabCounter_);
3263 CamImgMiddle_[cameraIndex]->UpdateMetaData();
3264 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImgMiddle_[cameraIndex]);
3266 text.Printf(wxT(
"SINGLE-CAM%02d-right-%05d.mip"), cameraIndex, GrabCounter_);
3267 CamImgRight_[cameraIndex]->UpdateMetaData();
3268 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImgRight_[cameraIndex]);
3272 CamImg_[cameraIndex]->UpdateMetaData();
3273 text.Printf(wxT(
"SINGLE-CAM%02d-%05d-color.mip"), cameraIndex, GrabCounter_);
3274 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImg_[cameraIndex]);
3276 text.Printf(wxT(
"SINGLE-CAM%02d-%05d-depth.mip"), cameraIndex, GrabCounter_);
3277 CamImgPMDDepth_[cameraIndex]->UpdateMetaData();
3278 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImgPMDDepth_[cameraIndex]);
3281 CamImg_[cameraIndex]->UpdateMetaData();
3282 text.Printf(wxT(
"SINGLE-CAM%02d-%05d-color.mip"), cameraIndex, GrabCounter_);
3283 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImg_[cameraIndex]);
3284 text.Printf(wxT(
"SINGLE-CAM%02d-%05d-depth.mip"), cameraIndex, GrabCounter_);
3285 CamImgPMDDepth_[cameraIndex]->UpdateMetaData();
3286 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImgPMDDepth_[cameraIndex]);
3287 text.Printf(wxT(
"SINGLE-CAM%02d-%05d-IR.mip"), cameraIndex, GrabCounter_);
3288 CamImgPMDInt_[cameraIndex]->UpdateMetaData();
3289 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImgPMDInt_[cameraIndex]);
3292 CamImg_[cameraIndex]->UpdateMetaData();
3293 text.Printf(wxT(
"SINGLE-CAM%02d-%05d.mip"), cameraIndex, GrabCounter_);
3294 ImageIO::Save(currentSingleSaveDir_ + WxToAscii(text), *CamImg_[cameraIndex]);
3305 #ifdef BIAS_HAVE_SWISSRANGER
3306 if(Cameras_[i] != NULL && dynamic_cast<VideoSource_SwissRanger*>(Cameras_[i]) != NULL){
3307 Cameras_[i]->GrabSingle(*CamImg_[i]);
3309 (Cameras_[i])->GrabSingleDepth(*CamImgPMDDepth_[i]);
3311 (Cameras_[i])->GrabSingleModCoeff(*CamImgPMDAmp_[i]);
3314 #endif // BIAS_HAVE_SWISSRANGER
3315 #ifdef BIAS_HAVE_PMD_PMDTec
3316 if(Cameras_[i] != NULL && dynamic_cast<VideoSource_PMD*>(Cameras_[i]) != NULL){
3319 (Cameras_[i])->GrabSingleDepth(*CamImgPMDDepth_[i]);
3321 (Cameras_[i])->GrabSingleModCoeff(*CamImgPMDAmp_[i]);
3323 (Cameras_[i])->GrabSingleIntensity(*CamImgPMDInt_[i]);
3326 #endif // BIAS_HAVE_SWISSRANGER
3329 #ifdef BIAS_HAVE_DCAM
3330 if(dynamic_cast<VideoSource_DCAM_BumbleBee*>(Cameras_[i]) != NULL){
3333 GrabSingle(*XB3AllInOne_[i], *CamImg_[i],*CamImgMiddle_[i],*CamImgRight_[i]);
3338 Cameras_[i]->GrabSingle(*CamImg_[i]);
3347 ServerMutex_.resize(NUMBER_CAMERAS);
3348 ServerCondition_.resize(NUMBER_CAMERAS);
3349 ClientsMutex_.resize(NUMBER_CAMERAS);
3350 ClientsCondition_.resize(NUMBER_CAMERAS);
3351 for (
unsigned int i=0;i<NUMBER_CAMERAS;i++) {
3352 ServerMutex_[i]=
new wxMutex();
3353 ServerCondition_[i] =
new wxCondition(*(ServerMutex_[i]));
3354 ClientsMutex_[i]=
new wxMutex();
3355 ClientsCondition_[i] =
new wxCondition(*(ClientsMutex_[i]));
3363 grabMasterThread_->Create();
3364 grabMasterThread_->Run();
3381 bool gmtLock =
false;
3382 if (grabMasterThread_ == NULL) {
3383 CreateMasterThread_();
3386 ServerMutex_[cameraIndex]->Lock();
3387 ClientsMutex_[cameraIndex]->Lock();
3391 if(grabSingleThread_[cameraIndex] != NULL){
3392 delete grabSingleThread_[cameraIndex];
3393 grabSingleThread_[cameraIndex] = NULL;
3399 grabSingleThread_[cameraIndex] =
3401 ClientsCondition_[cameraIndex],
3402 ServerCondition_[cameraIndex],
3403 ClientsMutex_[cameraIndex],
3404 ServerMutex_[cameraIndex],
3406 BufferAccess_[cameraIndex],
3408 ReadIndex_[cameraIndex],
3409 WriteIndex_[cameraIndex],
3410 CamImg_[cameraIndex],
3411 CamImgMiddle_[cameraIndex],
3412 CamImgRight_[cameraIndex],
3413 CamImgPMDDepth_[cameraIndex],
3414 CamImgPMDAmp_[cameraIndex],
3415 CamImgPMDInt_[cameraIndex],
3416 XB3AllInOne_[cameraIndex],
3417 ImageBuffer_[cameraIndex],
3418 ImageBufferMiddle_[cameraIndex],
3419 ImageBufferRight_[cameraIndex],
3420 ImageBufferPMDDepth_[cameraIndex],
3421 ImageBufferPMDAmp_[cameraIndex],
3422 ImageBufferPMDInt_[cameraIndex]);
3427 if(grabSingleThread_[cameraIndex]!= NULL && !grabSingleThread_[cameraIndex]->IsAlive()){
3428 if(grabSingleThread_[cameraIndex]->Create()!=wxTHREAD_NO_ERROR) {
3429 BIASERR(
"Cannot create GrabSingleThread, saving unthreaded");
3432 grabSingleThread_[cameraIndex]->Run();
3433 ThreadInited_[cameraIndex] =
true;
3436 std::cout<<
"Created GrabSingleThread: "<<cameraIndex<<endl;
3437 cout <<
"Created Thread with ID: " << grabSingleThread_[cameraIndex]->GetId()
3438 <<
" for CAM: " << cameraIndex << endl;
3442 else if(grabSingleThread_[cameraIndex]== NULL){
3443 BIASERR(
"Thread:"<<cameraIndex<<
" is NULL!");
3445 else if(grabSingleThread_[cameraIndex]->IsAlive()){
3446 BIASERR(
"Thread:"<<cameraIndex<<
" is already Alive!");
3450 ServerMutex_[cameraIndex]->Unlock();
3451 ClientsMutex_[cameraIndex]->Unlock();
3491 ImageBufferMiddle_[i],
3492 ImageBufferRight_[i],
3493 ImageBufferPMDDepth_[i],
3494 ImageBufferPMDAmp_[i],
3495 ImageBufferPMDInt_[i],
3499 if(saveThreads_[i] != NULL && saveThreads_[i]->Create() != wxTHREAD_NO_ERROR){
3500 BIASERR(
"Cannot create ImageSaveThread, saving unthreaded");
3503 cout <<
"Run Thread" << endl;
3504 saveThreads_[i]->SetPriority(100);
3505 saveThreads_[i]->Run();
static VideoSource * CreatePMDZess(std::string bitfile)
EColorModel
These are the most often used color models.
The main Parameter Gui interface, derived from BIAS::Param and extends this class.
YUYV422, 2 channels, full luminance Y, subsampled half U,V.
virtual void SetSize(int w, int h, int bytesperpixel=1)
Set image size and number of bytes per pixel (e.g.
Bayer_GRBG, 1 channel RGB image Bayer tile.
void OnChangeVideoMode(wxCommandEvent &event)
hsl, similar to HSL but euclidean (h,s) for CNCC
int AboveThresholdToValue(StorageType Threshold, StorageType Value)
sets alls pixels with values above Threshold to Value
virtual ~ShowCamWxFrame()
Destructor.
void OnShowCamerasListBox(wxCommandEvent &event)
static VideoSource_Controller_Base * CreateController(CameraType type, VideoSource *cam, wxWindow *parent, const std::string &title="", const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxFrameNameStr)
const T * GetData() const
get the data pointer the member function itself is const (before {..}) because it doesn't change the ...
void StartSavingImagesToDisk()
Starts the saving from all images to disk from all activated cameras.
represents Zess PMD camera driver interface TODO: include support for normal images (2DImg_)...
void OnOpenViscaController(wxCommandEvent &event)
Defines a common interface to different devices.
void AddUEyeCameraToMenu(int camindex, std::string camId, bool fromFile)
Adds a ueye camera to the menu.
void OnShowController(wxCommandEvent &event)
void StopSavingImagesToDisk()
Stops the saving from all images to disk from all activated cameras.
void OnFindOpenNI(wxCommandEvent &event)
HSL, similar to HSV but space is a double tipped cone.
wxString AsciiToWx(const char *thestring)
Converts a C string to a wxString.
void CreateMenu()
Creates the menu of the main window.
void SetDeviceChannel(int channel)
Use channel to select one of many cameras on the same.
Use the Kinect2 class to grab images from the Microsoft Kinect2.
void AddWebcamToMenu(std::string name, int camindex, bool fromFile)
Adds a v4l or DShow camera to the menu.
Basic controller interface for Directed Perception Pan Tilt Unit.
void OnShowParameters(wxCommandEvent &event)
void InitCamera(int camindex)
try to initialze the device with index camindex
int BIASVideoSource_EXPORT ScanBus(std::stringstream &ofs)
support function to get the number of cameras and IDs of all cameras on one bus
bool IsEmpty() const
check if ImageData_ points to allocated image buffer or not
Use OpenNI just like the ToF Cameras.
void InitCombinedImage()
Initializes combined image for selected camera (usb pmd)
int BelowThresholdToValue(StorageType Threshold, StorageType Value)
sets alls pixels with values below Threshold to Value
void OnFindWebcams(wxCommandEvent &event)
DV, color model used for digital video cameras such as Mini-DV.
void SetC(const Vector3< POSE_TYPE > &C, const Matrix3x3< POSE_TYPE > &cov)
Set translation (resp.
void OnShowImage(wxCommandEvent &event)
int ScaleShiftBetween(double Min, double Max)
scales and shifts image so afterwards every pixel has a value between Min and Max ...
void OnChangeTrigger(wxCommandEvent &event)
Implementing wxViscaControlFrameInterface.
YUV411, 2 channles, full luminance, 1 U, 1 V.
int ShowFormat7Selector(int camindex, dc1394video_mode_t mode)
Shows the IEEE1394 Format7 selector frame.
void SetColorModel(EColorModel Model)
void OnFindPMDTec(wxCommandEvent &event)
Support for SwissRanger usb cam.
Bayer_RGGB, 1 channel RGB image Bayer tile.
display image in wx application, provides zoom and investigation functionality
static VideoSource * CreateDCAM(bool firewireB, bool user_mode, int dcam_mode=-1, float fps=-1, int Format7BpP=-1, int Format7ColorMode_=-1, Vector2< int > Format7LeftTop_=Vector2< int >(-1,-1), Vector2< int > Format7WidthHeight=Vector2< int >(-1,-1))
void OnFindPMDZess(wxCommandEvent &event)
Vector< T > GetCol(const int &col) const
return a copy of column "col", zero based counting
void InitParams(int &argc, char *argv[])
Initializes all paramaters for param file.
int CreateMasterThread_()
Creates the master thread for handling cameras.
void SetQ(const Quaternion< POSE_TYPE > &Q, const Matrix4x4< POSE_TYPE > &cov)
Set rotation (resp.
int CreateImageSaveThreadForCamera_(int cameraIndex)
Creates the thread for saving images for a camera.
int Downsample(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
generic downsample function.
unsigned int GetWidth() const
YUV420P, 2 channels, full luminance Y, 1 U, 1 V. Y, U and V are grouped together for better compressi...
void InitCameras()
Initialize cameras with param file.
void ShowParamGUI()
Shows the parameter GUI.
int SelectedModeFromMenu(int camindex)
Selects a mode from the menu of multiple modes are offered for a camera, used e.g.
virtual int CloseDevice()
int GetQuaternion(Quaternion< ROTATION_MATRIX_TYPE > &quat) const
Calculates quaternion representation for this rotation matrix.
std::vector< std::string > GetDevices()
void OpenDevices()
Tries to open all specified camera devices.
invalid not set image storage type
void OnTimer(wxTimerEvent &event)
color values, 3 channels, order: blue,green,red
static VideoSource * CreateV4L()
Bayer_BGGR, 1 channel RGB image Bayer tile.
virtual int SetColorModel(BIAS::ImageBase::EColorModel mode)
Select colormodel to use.
class Vector4 contains a Vector of dim.
void OnGrabToStream(wxCommandEvent &event)
int CreateGrabThreadForCamera_(int cameraIndex)
Creates the thread for grabbing images for a camera.
Bayer_GBRG, 1 channel RGB image Bayer tile.
Represents 3d pose transformations, parametrized as Euclidean translation and unit quaternion orienta...
This class extends VideoSource for the use of DirectShow devices you need Microsoft Windows SDK versi...
int GetAllDevices(std::vector< std::string > &devices)
This class hides the underlying projection model, like projection matrix, spherical camera...
void CleanUpAndExit()
called on end to close cams and exit
Support for CamCube usb cam.
virtual int OpenDevice()
selects the first available device to open (e.g.
CM_YUV444, 3 channels, all channels have full data.
void OnFindUEye(wxCommandEvent &event)
static int ConvertST(const BIAS::ImageBase &source, BIAS::ImageBase &dest, ImageBase::EStorageType targetST)
Function to convert the storage type of images e.g.
static int DeinterleaveHorizontal(const BIAS::ImageBase &raw, BIAS::ImageBase &out)
Take Pointgrey X3B packed interleaved raw and store there three contained images side by side keeping...
color values, 3 channels, order: red,green,blue
void OnKeepScrollPosition(wxCommandEvent &event)
void OnWindowClose(wxCloseEvent &event)
static VideoSource * CreateFromTypeIfSupported(CameraType type)
void OnAbout(wxCommandEvent &event)
static std::string LeadingZeroString(const int &n, const unsigned int &digits=DEFAULT_LEADING_ZEROS)
Create a string with leading zeroes from number.
void SelectAndShowCameraImage_()
Selects the current image and shows it in image canvas.
unsigned int GetHeight() const
void OnClickCamerasListBox(wxCommandEvent &event)
void OnGrab(wxCommandEvent &event)
void SaveImageUnthreaded_(int cameraIndex)
Save a image from camera with index cameraIndex.
void OnChangeFirewireB(wxCommandEvent &event)
static int OpenDevice(int type, VideoSource *cam, std::string deviceName, int param=-1)
UYVY422, 2 channels, full luminance Y, subsampled half U,V inverse order.
obsolete, HSI is unused and identical to HSL
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
void OnOpenFlirController(wxCommandEvent &event)
void OnGrabContinuous(wxCommandEvent &event)
static std::string VideoModeToString(dc1394video_mode_t mode)
returns a string from a IEEE1394 video mode
SymTensor2x2 The image contains a 2x2 symmetric tensor.
void AddIEEECameraToMenu(int camindex, int IEEEIndex, bool fromFile)
Adds a IEEE1394/Firewire camera to the menu.
void CreateCameraMenu()
Creates the menu for the available cameras.
RGBA, 4 channels, order: red,green,blue,alpha.
virtual int GetAllDevices(std::vector< std::string > &devices)
This class creates a thread which stores an image in a file if rescale is not zero then the stored im...
virtual int OpenDevice()
selects the first available device to open (e.g.
void OnFindSwissRanger(wxCommandEvent &event)
const T * GetData() const
get the data pointer the member function itself is const (before {..}) because it doesn't change the...
void OnFindIEEE1394(wxCommandEvent &event)
void ParseColorModels()
Parses the color models from param file to enum EColorModel.
RGBE color values, 4 channels, RADIANCE hdr format, four low dynamic channels meaning: 3x mantissa (r...
void OnFit(wxCommandEvent &event)
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
void SetBitFile(std::string file)
void OnFindKinect2(wxCommandEvent &event)
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
virtual int CloseDevice()
invalid (not set) image format
(8bit) unsigned char image storage type
Checks for VideoSource capabilities.
void OnSaveParameters(wxCommandEvent &event)
HSV, 3 channels, order: hue, sat , value.
Use Kinect with the libfreenect drivers just like the ToF Cameras.
This class extends VideoSource for the use of IDS uEye devices.
void OnHideCamerasListBox(wxCommandEvent &event)
static VideoSource * CreateBumbleBee()
virtual int GetNumDevices()
This class extends VideoSource for the use of Video4Linux supported devices like framegrabber, USB cameras.
void OnOpenDPController(wxCommandEvent &event)
void CreatePerspective(const BIAS::Pose &pose, const BIAS::KMatrix &K, int width, int height, BIAS_ProjParaPersp_DISTORTION_TYPE radDistType=DISTYPE_DEF, const std::vector< double > &UndistortionCoefficients=std::vector< double >(4, 0.0))
Create a perspective camera and add to projection.
static std::vector< std::string > CameraNames()
virtual int GrabSingle(Camera< unsigned char > &image)
Returns the 2D image, and reads depth and modulation coefficients.
void OnKey(wxKeyEvent &event)
int OpenDevice(int camindex)
try to open the device with index camindex
virtual void GetDeviceChannelNames(std::vector< std::string > &names)
If more than one channel is present, names can be returned here.
void OnQuit(wxCommandEvent &event)
void OnChangeActivate(wxCommandEvent &event)
int SetROICorners(unsigned int UpperLeftX, unsigned int UpperLeftY, unsigned int LowerRightX, unsigned int LowerRightY)
GreyA, 2 channels, grey plus Alpha.
void OnFindKinect(wxCommandEvent &event)
void GetBestForEachResolution(std::vector< ResolutionEntry > &res)
This is the base class for images in BIAS.
static int ToRGB(const Image< StorageType > &source, Image< StorageType > &dest)
Create a RGB converted copy of source image in this.
virtual int GetCapabilities(VideoSourceCapabilities &caps)
Use this method to learn something about the capabilities of the source (only useful for V4L sources...
void OnChangeDeviceChannel(wxCommandEvent &event)
static VideoSource * CreateUEye()
Implementing wxTauControlFrameInterface.
static int InitImages(int type, VideoSource *cam, ImageBase *im1, ImageBase *im2=NULL, ImageBase *im3=NULL, ImageBase *im4=NULL)
static VideoSource * CreatePMD(std::string sourcePlugin, std::string procPlugin)
BGRA color values, 4 channels, order: blue,green,red,alpha.
virtual int GetNumDevices()
Return the number of available Kinect 2 devices.
void GrabSingleImageUnthreadedFromCamera_(int cameraIndex)
Grabs an image frmo a camera without using threads.
int CloseDevice(int camindex)
try to close the device with index camindex