17 #ifndef _mitk_OpenCVVideo_Source_h_
18 #define _mitk_OpenCVVideo_Source_h_
29 #include "itkRGBPixel.h"
31 #include "itkImageRegionIterator.h"
55 itkFactorylessNewMacro(Self)
62 virtual
void SetVideoFileInput(const
char *
filename,
bool repeatVideo,
bool useCVCAMLib = false);
67 virtual
void SetVideoCameraInput(
int cameraindex,
bool useCVCAMLib = false);
81 virtual
double GetVideoCaptureProperty(
int property_id);
86 virtual
int SetVideoCaptureProperty(
int property_id,
double value);
88 virtual
void GetCurrentFrameAsOpenCVImage(IplImage * image);
92 virtual
cv::Mat GetImage() override;
93 virtual const IplImage * GetCurrentFrame();
96 virtual
void GetCurrentFrameAsItkHSVPixelImage(HSVPixelImageType::
Pointer &
Image);
99 virtual
void FetchFrame() override;
102 virtual
unsigned char * GetVideoTexture() override;
105 virtual
void StartCapturing() override;
108 virtual
void StopCapturing() override;
111 virtual IplImage* FlipImage(IplImage* input);
119 virtual
void DisableOnlineImageUndistortion();
123 virtual
bool OnlineImageUndistortionEnabled() const;
125 virtual
void PauseCapturing() override;
129 itkGetConstMacro( VideoFileName,
std::
string );
131 virtual
void SetEnableXAxisFlip(
bool enable);
132 virtual
void SetEnableYAxisFlip(
bool enable);
137 itkGetConstMacro( GrabbingDeviceNumber,
short );
139 itkGetMacro( RepeatVideo,
bool );
140 itkSetMacro( RepeatVideo,
bool );
145 virtual ~OpenCVVideoSource();
155 void UpdateVideoTexture();
158 void sleep(
unsigned int ms);
159 void RGBtoHSV(
float r,
float g,
float b,
float &h,
float &s,
float &v);
162 CvCapture * m_VideoCapture;
165 IplImage * m_CurrentImage;
166 unsigned char* m_CurrentVideoTexture;
168 IplImage * m_PauseImage;
172 std::
string m_VideoFileName;
176 short m_GrabbingDeviceNumber;
185 bool m_UndistortImage;
191 bool m_FlipXAxisEnabled;
196 bool m_FlipYAxisEnabled;
itk::ImageRegionIterator< HSVPixelImageType > HSVConstIteratorType
itk::Image< HSVPixelType, 2 > HSVPixelImageType
DataCollection - Class to facilitate loading/accessing structured data.
itk::RGBPixel< unsigned char > CharPixelType
static const std::string filename
#define mitkClassMacro(className, SuperClassName)
Image class for storing images.
itk::ImageRegionIterator< RGBPixelImageType > RGBConstIteratorType
itk::Image< CharPixelType, 2 > RGBPixelImageType
itk::FixedArray< float, 3 > HSVPixelType