25 #ifndef __ShowCamWxFrame_hh__
26 #define __ShowCamWxFrame_hh__
28 #include <Base/Common/BIASpragmaStart.hh>
29 #include <bias_config.h>
32 #include "Base/Common/W32Compat.hh"
36 #include <wx/toolbar.h>
37 #include <wx/listbox.h>
38 #include <wx/splitter.h>
40 #include <Gui/StringConv.hh>
41 #include <Gui/ImageCanvas.hh>
42 #include <Gui/ParamGUI.hh>
43 #include <Gui/VideoSource_Controller_Base.hh>
44 #include <Gui/wxTauControlFrame.h>
46 #include <Image/Camera.hh>
47 #include <Base/Image/ImageIO.hh>
48 #include <Base/Debug/TimeMeasure.hh>
49 #include <Filter/Rescale.hh>
50 #include <Utils/Param.hh>
52 #include <VideoSource/VideoSource_Base.hh>
53 #include <VideoSource/VideoSource_Net.hh>
54 #include <VideoSource/VideoSource_Shm.hh>
55 #include "ShowCamWxThreads.hh"
57 #ifdef BIAS_HAVE_PANTILT_DP
58 #include <PanTilt/DPPanTiltControl.hh>
59 #include <PanTilt/DPPanTiltControlDialog.hh>
62 #ifdef BIAS_HAVE_PANTILT
63 #include <Gui/wxViscaControlFrame.h>
68 #include <VideoSource/VideoSource_ShmPMD.hh>
73 # include <VideoSource/VideoSource_V4L.hh>
74 #endif // BIAS_HAVE_V4L
77 # include <VideoSource/VideoSource_uEye.hh>
78 #endif // BIAS_HAVE_UEYE
81 # include "ShowCamWxFormat7Frame.hh"
82 # include <VideoSource/VideoSource_DCAM.hh>
83 # include <VideoSource/VideoSource_DCAM_BumbleBee.hh>
84 #endif // BIAS_HAVE_DCAM
86 #ifdef BIAS_HAVE_PMD_PMDTec
87 # include <Image/PMDImageProc.hh>
88 # include <VideoSource/VideoSource_PMD.hh>
89 #endif // BIAS_HAVE_PMD_PMDTec
91 #ifdef BIAS_HAVE_PMD_PMDZess
92 # include <VideoSource/VideoSource_PMDZess.hh>
93 #endif // BIAS_HAVE_PMD_PMDZess
95 #ifdef BIAS_HAVE_SWISSRANGER
96 # include <VideoSource/VideoSource_SwissRanger.hh>
99 #ifdef BIAS_HAVE_KINECT
100 # include <VideoSource/VideoSource_Kinect.hh>
103 #ifdef BIAS_HAVE_OPENNI
104 # include <VideoSource/VideoSource_OpenNI.hh>
107 #ifdef BIAS_HAVE_KINECT2
108 # include <VideoSource/VideoSource_Kinect2.hh>
111 #ifdef BIAS_HAVE_DSHOW
112 # include <VideoSource/VideoSource_DSHOW.hh>
121 #define NUMBER_CAMERAS 9
172 ShowCamWxFrame(
const wxString& title,
const wxPoint& pos,
const wxSize& size);
181 #ifdef BIAS_HAVE_PANTILT_DP
183 bool InitPanTiltUnit();
204 #ifdef BIAS_HAVE_DCAM
219 #ifdef BIAS_HAVE_PANTILT_DP
250 #ifdef BIAS_HAVE_DCAM
254 #ifdef BIAS_HAVE_PMD_PMDZess
255 void AddZessCameraToMenu(
int camindex,
bool fromFile, std::string paramFile);
256 #endif // BIAS_HAVE_PMD_PMDZess
257 #ifdef BIAS_HAVE_PMD_PMDTec
258 void AddPMDTecCameraToMenu(
int camindex,
bool fromFile);
259 #endif // BIAS_HAVE_PMD_PMDTec
260 #ifdef BIAS_HAVE_SWISSRANGER
261 void AddSwissRangerCameraToMenu(
int camindex,
bool fromFile);
262 #endif // BIAS_HAVE_SWISSRANGER
263 #ifdef BIAS_HAVE_KINECT
264 void AddKinectCameraToMenu(
int camindex,
bool fromFile);
265 #endif // BIAS_HAVE_SWISSRANGER
266 #ifdef BIAS_HAVE_OPENNI
267 void AddOpenNICameraToMenu(
int camindex,
bool fromFile);
268 #endif // BIAS_HAVE_SWISSRANGER
270 #ifdef BIAS_HAVE_KINECT2
271 void AddKinect2CameraToMenu(
int camindex,
bool fromFile);
272 #endif // BIAS_HAVE_SWISSRANGER
276 void OnQuit(wxCommandEvent& event);
277 void OnAbout(wxCommandEvent &event);
278 void OnGrab(wxCommandEvent& event);
302 void OnTimer(wxTimerEvent& event);
303 void OnKey(wxKeyEvent& event);
304 void OnFit(wxCommandEvent& event);
322 #ifdef BIAS_HAVE_PANTILT_DP
324 bool *bUsePanTiltUnit_;
329 #ifdef BIAS_HAVE_PANTILT
370 std::vector<BIAS::Camera<unsigned char>* >
CamImg_;
440 #ifdef BIAS_HAVE_DCAM
447 DECLARE_EVENT_TABLE()
452 #include <Base/Common/BIASpragmaEnd.hh>
454 #endif // __ShowCamWxFrame_hh__
std::string * ParamIP_[NUMBER_CAMERAS]
The main Parameter Gui interface, derived from BIAS::Param and extends this class.
std::string * ParamBitFile_[NUMBER_CAMERAS]
std::vector< std::vector< Camera< float > * > * > ImageBufferPMDAmp_
void OnChangeVideoMode(wxCommandEvent &event)
virtual ~ShowCamWxFrame()
Destructor.
void OnShowCamerasListBox(wxCommandEvent &event)
void StartSavingImagesToDisk()
Starts the saving from all images to disk from all activated cameras.
std::vector< bool > ThreadInited_
void OnOpenViscaController(wxCommandEvent &event)
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.
std::vector< int > Format7ColorMode_
void OnFindOpenNI(wxCommandEvent &event)
std::vector< bool > SetFirewireB_
void CreateMenu()
Creates the menu of the main window.
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
BIAS::GrabMasterThread * grabMasterThread_
wxButton * pButtonWebCams
std::vector< BIAS::Camera< float > * > CamImgPMDInt_
void InitCombinedImage()
Initializes combined image for selected camera (usb pmd)
void OnFindWebcams(wxCommandEvent &event)
std::vector< CameraInfo > IEEECameraInfo_
void OnShowImage(wxCommandEvent &event)
void OnChangeTrigger(wxCommandEvent &event)
Implementing wxViscaControlFrameInterface.
int ShowFormat7Selector(int camindex, dc1394video_mode_t mode)
Shows the IEEE1394 Format7 selector frame.
std::string * ParamDevice_[NUMBER_CAMERAS]
void OnFindPMDTec(wxCommandEvent &event)
std::vector< BIAS::ImageBase::EColorModel > ColorModels_
std::vector< BIAS::Camera< unsigned char > * > CamImgMiddle_
std::vector< int > Format7BpP_
BIAS::Camera< unsigned char > CamImgCombined_
display image in wx application, provides zoom and investigation functionality
std::vector< BIAS::VideoSource_Controller_Base * > VideoControllers_
bool bSingleSaveDirCreated_
std::vector< BIAS::Camera< unsigned char > * > CamImgRight_
void OnFindPMDZess(wxCommandEvent &event)
std::vector< unsigned int > WriteIndex_
wxSplitterWindow * splitterWindow_
void InitParams(int &argc, char *argv[])
Initializes all paramaters for param file.
std::vector< unsigned int > ReadIndex_
std::vector< BIAS::Camera< float > * > CamImgPMDDepth_
unsigned int Win32DCAMNumber_
int CreateMasterThread_()
Creates the master thread for handling cameras.
int CreateImageSaveThreadForCamera_(int cameraIndex)
Creates the thread for saving images for a camera.
int * ParamWidth_[NUMBER_CAMERAS]
unsigned int FrameCounter_
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.
std::vector< BIAS::Camera< unsigned char > * > CamImg_
void OpenDevices()
Tries to open all specified camera devices.
void OnTimer(wxTimerEvent &event)
wxListBox * cameraListBox_
std::vector< wxMutex * > BufferAccess_
std::string currentSaveDir_
std::vector< wxCondition * > ClientsCondition_
std::vector< std::vector< Camera< unsigned char > * > * > ImageBufferMiddle_
int * ParamColorModel_[NUMBER_CAMERAS]
std::vector< BIAS::Vector2< int > > Format7WidthHeight_
void OnGrabToStream(wxCommandEvent &event)
int CreateGrabThreadForCamera_(int cameraIndex)
Creates the thread for grabbing images for a camera.
std::vector< wxMutex * > ClientsMutex_
std::string currentSingleSaveDir_
wxNotebook * paramNotebook_
wxCheckBox * pCheckBoxKeepScrollPosition
This class hides the underlying projection model, like projection matrix, spherical camera...
void CleanUpAndExit()
called on end to close cams and exit
wxButton * pButtonController
void OnFindUEye(wxCommandEvent &event)
ShowCamWxFormat7Frame * format7Frame_
void OnKeepScrollPosition(wxCommandEvent &event)
void OnWindowClose(wxCloseEvent &event)
void OnAbout(wxCommandEvent &event)
std::vector< std::vector< Camera< unsigned char > * > * > ImageBufferRight_
void SelectAndShowCameraImage_()
Selects the current image and shows it in image canvas.
std::string sourcePlugin_
int * ParamHeight_[NUMBER_CAMERAS]
void OnClickCamerasListBox(wxCommandEvent &event)
void OnGrab(wxCommandEvent &event)
unsigned int dSingleDirIndex_
BIAS::Camera< unsigned char > ShowImage_
void SaveImageUnthreaded_(int cameraIndex)
Save a image from camera with index cameraIndex.
void OnChangeFirewireB(wxCommandEvent &event)
std::vector< std::vector< Camera< unsigned char > * > * > ImageBuffer_
std::vector< ImageBase::EColorModel > ViewColorMode_
void OnOpenFlirController(wxCommandEvent &event)
std::vector< BIAS::VideoSource * > Cameras_
void OnGrabContinuous(wxCommandEvent &event)
double * ParamFPS_[NUMBER_CAMERAS]
wxButton * pButtonIEEE1394
std::vector< wxCondition * > ServerCondition_
int * ParamCameras_[NUMBER_CAMERAS]
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.
wxPanel * cameraListPanel_
void OnFindSwissRanger(wxCommandEvent &event)
wxTauControlFrame * tauControllerFrame_
void OnFindIEEE1394(wxCommandEvent &event)
std::vector< std::vector< Camera< float > * > * > ImageBufferPMDInt_
void ParseColorModels()
Parses the color models from param file to enum EColorModel.
void OnFit(wxCommandEvent &event)
std::vector< float > SelectedFps_
std::vector< std::string > cameraNames_
wxButton * pButtonContinuous
std::vector< bool > CameraActive_
void OnFindKinect2(wxCommandEvent &event)
std::vector< BIAS::Camera< unsigned char > * > XB3AllInOne_
std::vector< bool > CameraInitialized_
ShowCamWxFrame(const wxString &title, const wxPoint &pos, const wxSize &size)
Constructor.
std::vector< bool > SetUserMode_
std::vector< std::vector< std::string > > DeviceChannelNames_
std::vector< BIAS::Vector2< int > > Format7LeftTop_
void OnSaveParameters(wxCommandEvent &event)
void OnHideCamerasListBox(wxCommandEvent &event)
unsigned int GrabCounter_
void OnOpenDPController(wxCommandEvent &event)
void OnKey(wxKeyEvent &event)
int OpenDevice(int camindex)
try to open the device with index camindex
wxCheckBox * pCheckBoxFit
std::vector< wxMutex * > ServerMutex_
void OnQuit(wxCommandEvent &event)
void OnChangeActivate(wxCommandEvent &event)
void OnFindKinect(wxCommandEvent &event)
std::vector< std::vector< Camera< float > * > * > ImageBufferPMDDepth_
std::vector< BIAS::ImageSaveThread * > saveThreads_
std::vector< bool > SetTrigger_
int * ParamPort_[NUMBER_CAMERAS]
std::vector< int > DeviceChannel_
void OnChangeDeviceChannel(wxCommandEvent &event)
class TimeMeasure contains functions for timing real time and cpu time.
Implementing wxTauControlFrameInterface.
std::vector< BIAS::GrabSingleThread * > grabSingleThread_
void GrabSingleImageUnthreadedFromCamera_(int cameraIndex)
Grabs an image frmo a camera without using threads.
std::vector< BIAS::Camera< float > * > CamImgPMDAmp_
int * ParamDown_[NUMBER_CAMERAS]
int CloseDevice(int camindex)
try to close the device with index camindex