18 #ifndef itkOpenCVVideoCapture_h
19 #define itkOpenCVVideoCapture_h
24 #include "opencv2/core/version.hpp"
25 #if !defined( CV_VERSION_EPOCH )
27 #include "opencv2/videoio.hpp"
49 template <
typename TV
ideoStream>
59 using FrameType =
typename VideoStreamType::FrameType;
61 static constexpr
unsigned int Dimensions = FrameType::ImageDimension;
81 virtual bool open(
const std::string &)
83 itkExceptionMacro(
"itk::OpenCVVideoCapture::open(filename) -> If you just want "
84 "to read from a file, use cv::VideoCapture since there is nothing to be "
85 "gained using itk's version.");
90 itkExceptionMacro(
"itk::OpenCVVideoCapture::open(device) -> If you just want "
91 "to read from a device, use cv::VideoCapture since there is nothing to be "
92 "gained using itk's version.");
97 virtual bool open(VideoStreamType* videoStream);
102 return m_VideoStream == 0;
107 virtual void release();
115 virtual bool retrieve(cv::Mat & image,
int channel = 0);
122 virtual bool read(cv::Mat& image);
127 virtual bool set(
int propId,
double value);
130 virtual double get(
int propId);
145 #ifndef ITK_MANUAL_INSTANTIATION
146 #include "itkOpenCVVideoCapture.hxx"
typename FrameType::PixelType PixelType
virtual ~OpenCVVideoCapture()
std::istream & operator>>(std::istream &is, Point< T, NPointDimension > &v)
TVideoStream VideoStreamType
virtual bool isOpened() const
This class implements OpenCV's VideoCapture API and takes an itk VideoStream as input.
VideoStreamType * m_VideoStream
typename VideoStreamType::FrameType FrameType
virtual bool open(const std::string &)