13 #ifndef mitkOpenCVVideoSource_h
14 #define mitkOpenCVVideoSource_h
22 #include <opencv2/highgui.hpp>
25 #include "itkRGBPixel.h"
27 #include "itkImageRegionIterator.h"
51 itkFactorylessNewMacro(Self);
58 virtual void SetVideoFileInput(
const char * filename,
bool repeatVideo,
bool useCVCAMLib =
false);
63 virtual void SetVideoCameraInput(
int cameraindex,
bool useCVCAMLib =
false);
76 virtual double GetVideoCaptureProperty(
int property_id);
80 virtual int SetVideoCaptureProperty(
int property_id,
double value);
82 virtual void GetCurrentFrameAsOpenCVImage(IplImage * image);
86 cv::Mat GetImage()
override;
87 virtual const IplImage * GetCurrentFrame();
90 virtual void GetCurrentFrameAsItkHSVPixelImage(HSVPixelImageType::Pointer &
Image);
93 void FetchFrame()
override;
96 unsigned char * GetVideoTexture()
override;
99 void StartCapturing()
override;
102 void StopCapturing()
override;
105 virtual IplImage* FlipImage(IplImage* input);
113 virtual void DisableOnlineImageUndistortion();
117 virtual bool OnlineImageUndistortionEnabled()
const;
119 void PauseCapturing()
override;
123 itkGetConstMacro( VideoFileName, std::string );
125 virtual void SetEnableXAxisFlip(
bool enable);
126 virtual void SetEnableYAxisFlip(
bool enable);
131 itkGetConstMacro( GrabbingDeviceNumber,
short );
133 itkGetMacro( RepeatVideo,
bool );
134 itkSetMacro( RepeatVideo,
bool );
149 void UpdateVideoTexture();
152 void sleep(
unsigned int ms);
153 void RGBtoHSV(
float r,
float g,
float b,
float &h,
float &s,
float &v);