13#ifndef mitkOpenCVVideoSource_h
14#define mitkOpenCVVideoSource_h
16#include "mitkConfig.h"
18#include "mitkVideoSource.h"
22#include <opencv2/highgui.hpp>
25#include "itkRGBPixel.h"
27#include "itkImageRegionIterator.h"
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);
110 virtual void EnableOnlineImageUndistortion(mitk::Point3D focal, mitk::Point3D principal, mitk::Point4D distortion);
113 virtual void DisableOnlineImageUndistortion();
117 virtual bool OnlineImageUndistortionEnabled()
const;
119 void PauseCapturing()
override;
125 virtual void SetEnableXAxisFlip(
bool enable);
126 virtual void SetEnableYAxisFlip(
bool enable);
149 void UpdateVideoTexture();
153 void RGBtoHSV(
float r,
float g,
float b,
float &h,
float &s,
float &v);
unsigned char * m_CurrentVideoTexture
itkFactorylessNewMacro(Self)
itk::ImageRegionIterator< HSVPixelImageType > HSVConstIteratorType
itk::FixedArray< float, 3 > HSVPixelType
itk::Image< HSVPixelType, 2 > HSVPixelImageType
IplImage * m_CurrentImage
void sleep(unsigned int ms)
CvCapture * m_VideoCapture
itk::RGBPixel< unsigned char > CharPixelType
itk::Image< CharPixelType, 2 > RGBPixelImageType
short m_GrabbingDeviceNumber
saves the grabbing device number (is -1 if a videofilename is used or if this is not initialized)
itkGetMacro(RepeatVideo, bool)
itkGetConstMacro(VideoFileName, std::string)
mitk::UndistortCameraImage::Pointer m_UndistortCameraImage
itkSetMacro(RepeatVideo, bool)
mitkClassMacro(OpenCVVideoSource, VideoSource)
itkGetConstMacro(GrabbingDeviceNumber, short)
std::string m_VideoFileName
saves the video file name (is empty if a grabbing device is used or if this is not initialized)
itk::ImageRegionIterator< RGBPixelImageType > RGBConstIteratorType