18 #ifndef itkOpenCVVideoCapture_h
19 #define itkOpenCVVideoCapture_h
27 #if !defined( CV_VERSION_EPOCH )
28 #include "opencv2/videoio.hpp"
45 template <
typename TV
ideoStream>
55 typedef typename VideoStreamType::FrameType
FrameType;
57 static const unsigned int Dimensions = FrameType::ImageDimension;
77 virtual bool open(
const std::string &)
79 itkExceptionMacro(
"itk::OpenCVVideoCapture::open(filename) -> If you just want "
80 "to read from a file, use cv::VideoCapture since there is nothing to be "
81 "gained using itk's version.");
86 itkExceptionMacro(
"itk::OpenCVVideoCapture::open(device) -> If you just want "
87 "to read from a device, use cv::VideoCapture since there is nothing to be "
88 "gained using itk's version.");
111 virtual bool retrieve(cv::Mat & image,
int channel = 0);
118 virtual bool read(cv::Mat& image);
123 virtual bool set(
int propId,
double value);
126 virtual double get(
int propId);
141 #ifndef ITK_MANUAL_INSTANTIATION
142 #include "itkOpenCVVideoCapture.hxx"
FrameType::PixelType PixelType
virtual Self & operator>>(cv::Mat &image)
virtual ~OpenCVVideoCapture()
TVideoStream VideoStreamType
static const unsigned int Dimensions
virtual bool set(int propId, double value)
virtual bool isOpened() const
virtual bool retrieve(cv::Mat &image, int channel=0)
This class implements OpenCV's VideoCapture API and takes an itk VideoStream as input.
OpenCVVideoCapture< VideoStreamType > Self
virtual bool read(cv::Mat &image)
VideoStreamType * m_VideoStream
virtual bool open(const std::string &)
VideoStreamType::FrameType FrameType