MITK-IGT
IGT Extension of MITK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mitk::OpenCVVideoSource Class Reference

#include <mitkOpenCVVideoSource.h>

Inheritance diagram for mitk::OpenCVVideoSource:
mitk::OpenCVImageSource mitk::VideoInputSource

Public Types

typedef itk::RGBPixel< unsigned char > CharPixelType
 
typedef itk::FixedArray< float, 3 > HSVPixelType
 
typedef itk::Image< CharPixelType, 2 > RGBPixelImageType
 
typedef itk::Image< HSVPixelType, 2 > HSVPixelImageType
 
typedef itk::ImageRegionIterator< RGBPixelImageTypeRGBConstIteratorType
 
typedef itk::ImageRegionIterator< HSVPixelImageTypeHSVConstIteratorType
 

Public Member Functions

 mitkClassMacro (OpenCVVideoSource, VideoSource)
 
 itkFactorylessNewMacro (Self)
 
 itkCloneMacro (Self)
 
virtual void SetVideoFileInput (const char *filename, bool repeatVideo, bool useCVCAMLib=false)
 
virtual void SetVideoCameraInput (int cameraindex, bool useCVCAMLib=false)
 
virtual double GetVideoCaptureProperty (int property_id)
 
virtual int SetVideoCaptureProperty (int property_id, double value)
 
virtual void GetCurrentFrameAsOpenCVImage (IplImage *image)
 
cv::Mat GetImage () override
 
virtual const IplImage * GetCurrentFrame ()
 
virtual void GetCurrentFrameAsItkHSVPixelImage (HSVPixelImageType::Pointer &Image)
 
void FetchFrame () override
 
unsigned char * GetVideoTexture () override
 
void StartCapturing () override
 
void StopCapturing () override
 
virtual IplImage * FlipImage (IplImage *input)
 
virtual void EnableOnlineImageUndistortion (mitk::Point3D focal, mitk::Point3D principal, mitk::Point4D distortion)
 
virtual void DisableOnlineImageUndistortion ()
 
virtual bool OnlineImageUndistortionEnabled () const
 
void PauseCapturing () override
 
 itkGetConstMacro (VideoFileName, std::string)
 
virtual void SetEnableXAxisFlip (bool enable)
 
virtual void SetEnableYAxisFlip (bool enable)
 
 itkGetConstMacro (GrabbingDeviceNumber, short)
 
 itkGetMacro (RepeatVideo, bool)
 
 itkSetMacro (RepeatVideo, bool)
 
- Public Member Functions inherited from mitk::OpenCVImageSource
 mitkClassMacroItkParent (OpenCVImageSource, itk::Object)
 

Protected Member Functions

 OpenCVVideoSource ()
 
 ~OpenCVVideoSource () override
 
void Reset ()
 
void UpdateVideoTexture ()
 
void sleep (unsigned int ms)
 
void RGBtoHSV (float r, float g, float b, float &h, float &s, float &v)
 

Protected Attributes

CvCapture * m_VideoCapture
 
IplImage * m_CurrentImage
 
unsigned char * m_CurrentVideoTexture
 
IplImage * m_PauseImage
 
std::string m_VideoFileName
 saves the video file name (is empty if a grabbing device is used or if this is not initialized)
 
short m_GrabbingDeviceNumber
 saves the grabbing device number (is -1 if a videofilename is used or if this is not initialized)
 
bool m_RepeatVideo
 
bool m_UseCVCAMLib
 
bool m_UndistortImage
 
mitk::UndistortCameraImage::Pointer m_UndistortCameraImage
 
bool m_FlipXAxisEnabled
 
bool m_FlipYAxisEnabled
 

Detailed Description

Interface for acquiring video data using Intel's OPENCV library. Video data may either be provided from a file or a grabbing device. At the moment, OPENCV includes two separated modules for this grabbing, but only HighGui is used here. Initialize via SetVideoFileInput() or SetVideoCameraInput(), start processing with StartCapturing();

Definition at line 39 of file mitkOpenCVVideoSource.h.

Member Typedef Documentation

◆ CharPixelType

itk::RGBPixel< unsigned char > mitk::OpenCVVideoSource::CharPixelType

Definition at line 43 of file mitkOpenCVVideoSource.h.

◆ HSVConstIteratorType

Definition at line 48 of file mitkOpenCVVideoSource.h.

◆ HSVPixelImageType

◆ HSVPixelType

itk::FixedArray<float,3> mitk::OpenCVVideoSource::HSVPixelType

Definition at line 44 of file mitkOpenCVVideoSource.h.

◆ RGBConstIteratorType

Definition at line 47 of file mitkOpenCVVideoSource.h.

◆ RGBPixelImageType

Constructor & Destructor Documentation

◆ OpenCVVideoSource()

mitk::OpenCVVideoSource::OpenCVVideoSource ( )
protected

Definition at line 19 of file mitkOpenCVVideoSource.cpp.

◆ ~OpenCVVideoSource()

mitk::OpenCVVideoSource::~OpenCVVideoSource ( )
overrideprotected

Definition at line 33 of file mitkOpenCVVideoSource.cpp.

Member Function Documentation

◆ DisableOnlineImageUndistortion()

void mitk::OpenCVVideoSource::DisableOnlineImageUndistortion ( )
virtual

Definition at line 265 of file mitkOpenCVVideoSource.cpp.

◆ EnableOnlineImageUndistortion()

void mitk::OpenCVVideoSource::EnableOnlineImageUndistortion ( mitk::Point3D focal,
mitk::Point3D principal,
mitk::Point4D distortion )
virtual

Definition at line 251 of file mitkOpenCVVideoSource.cpp.

◆ FetchFrame()

void mitk::OpenCVVideoSource::FetchFrame ( )
override

Definition at line 119 of file mitkOpenCVVideoSource.cpp.

◆ FlipImage()

IplImage * mitk::OpenCVVideoSource::FlipImage ( IplImage * input)
virtual

Definition at line 365 of file mitkOpenCVVideoSource.cpp.

◆ GetCurrentFrame()

const IplImage * mitk::OpenCVVideoSource::GetCurrentFrame ( )
virtual

Definition at line 102 of file mitkOpenCVVideoSource.cpp.

◆ GetCurrentFrameAsItkHSVPixelImage()

void mitk::OpenCVVideoSource::GetCurrentFrameAsItkHSVPixelImage ( HSVPixelImageType::Pointer & Image)
virtual

Definition at line 271 of file mitkOpenCVVideoSource.cpp.

◆ GetCurrentFrameAsOpenCVImage()

void mitk::OpenCVVideoSource::GetCurrentFrameAsOpenCVImage ( IplImage * image)
virtual

Definition at line 107 of file mitkOpenCVVideoSource.cpp.

◆ GetImage()

cv::Mat mitk::OpenCVVideoSource::GetImage ( )
overridevirtual
Returns
a copy of the image as opencv 2 Mat

Implements mitk::OpenCVImageSource.

Definition at line 92 of file mitkOpenCVVideoSource.cpp.

◆ GetVideoCaptureProperty()

double mitk::OpenCVVideoSource::GetVideoCaptureProperty ( int property_id)
virtual

Definition at line 64 of file mitkOpenCVVideoSource.cpp.

◆ GetVideoTexture()

unsigned char * mitk::OpenCVVideoSource::GetVideoTexture ( )
override

Definition at line 75 of file mitkOpenCVVideoSource.cpp.

◆ itkCloneMacro()

mitk::OpenCVVideoSource::itkCloneMacro ( Self )

◆ itkFactorylessNewMacro()

mitk::OpenCVVideoSource::itkFactorylessNewMacro ( Self )

◆ itkGetConstMacro() [1/2]

mitk::OpenCVVideoSource::itkGetConstMacro ( GrabbingDeviceNumber ,
short  )

Returns the GrabbingDeviceNumber (maybe -1 if a video file is used)

◆ itkGetConstMacro() [2/2]

mitk::OpenCVVideoSource::itkGetConstMacro ( VideoFileName ,
std::string  )

Returns the video file name (maybe empty if a grabbing device is used)

◆ itkGetMacro()

mitk::OpenCVVideoSource::itkGetMacro ( RepeatVideo ,
bool  )

◆ itkSetMacro()

mitk::OpenCVVideoSource::itkSetMacro ( RepeatVideo ,
bool  )

◆ mitkClassMacro()

mitk::OpenCVVideoSource::mitkClassMacro ( OpenCVVideoSource ,
VideoSource  )

◆ OnlineImageUndistortionEnabled()

bool mitk::OpenCVVideoSource::OnlineImageUndistortionEnabled ( ) const
virtual
Returns
true if image undistorsion is enabled

Definition at line 225 of file mitkOpenCVVideoSource.cpp.

◆ PauseCapturing()

void mitk::OpenCVVideoSource::PauseCapturing ( )
override

Definition at line 230 of file mitkOpenCVVideoSource.cpp.

◆ Reset()

void mitk::OpenCVVideoSource::Reset ( )
protected

Resets the whole class for capturing from a new device

Definition at line 389 of file mitkOpenCVVideoSource.cpp.

◆ RGBtoHSV()

void mitk::OpenCVVideoSource::RGBtoHSV ( float r,
float g,
float b,
float & h,
float & s,
float & v )
protected

Definition at line 314 of file mitkOpenCVVideoSource.cpp.

◆ SetEnableXAxisFlip()

void mitk::OpenCVVideoSource::SetEnableXAxisFlip ( bool enable)
virtual

Definition at line 415 of file mitkOpenCVVideoSource.cpp.

◆ SetEnableYAxisFlip()

void mitk::OpenCVVideoSource::SetEnableYAxisFlip ( bool enable)
virtual

Definition at line 421 of file mitkOpenCVVideoSource.cpp.

◆ SetVideoCameraInput()

void mitk::OpenCVVideoSource::SetVideoCameraInput ( int cameraindex,
bool useCVCAMLib = false )
virtual

Reimplemented in mitk::VideoInputSource.

Definition at line 52 of file mitkOpenCVVideoSource.cpp.

◆ SetVideoCaptureProperty()

int mitk::OpenCVVideoSource::SetVideoCaptureProperty ( int property_id,
double value )
virtual

Definition at line 69 of file mitkOpenCVVideoSource.cpp.

◆ SetVideoFileInput()

void mitk::OpenCVVideoSource::SetVideoFileInput ( const char * filename,
bool repeatVideo,
bool useCVCAMLib = false )
virtual

Reimplemented in mitk::VideoInputSource.

Definition at line 38 of file mitkOpenCVVideoSource.cpp.

◆ sleep()

void mitk::OpenCVVideoSource::sleep ( unsigned int ms)
protected

◆ StartCapturing()

void mitk::OpenCVVideoSource::StartCapturing ( )
override

Definition at line 211 of file mitkOpenCVVideoSource.cpp.

◆ StopCapturing()

void mitk::OpenCVVideoSource::StopCapturing ( )
override

Definition at line 219 of file mitkOpenCVVideoSource.cpp.

◆ UpdateVideoTexture()

void mitk::OpenCVVideoSource::UpdateVideoTexture ( )
protected

Definition at line 170 of file mitkOpenCVVideoSource.cpp.

Member Data Documentation

◆ m_CurrentImage

IplImage* mitk::OpenCVVideoSource::m_CurrentImage
protected

Definition at line 159 of file mitkOpenCVVideoSource.h.

◆ m_CurrentVideoTexture

unsigned char* mitk::OpenCVVideoSource::m_CurrentVideoTexture
protected

Definition at line 160 of file mitkOpenCVVideoSource.h.

◆ m_FlipXAxisEnabled

bool mitk::OpenCVVideoSource::m_FlipXAxisEnabled
protected

Flag to enable or disable video flipping by X Axis.

Definition at line 185 of file mitkOpenCVVideoSource.h.

◆ m_FlipYAxisEnabled

bool mitk::OpenCVVideoSource::m_FlipYAxisEnabled
protected

Flag to enable or disable video flipping by Y Axis.

Definition at line 190 of file mitkOpenCVVideoSource.h.

◆ m_GrabbingDeviceNumber

short mitk::OpenCVVideoSource::m_GrabbingDeviceNumber
protected

saves the grabbing device number (is -1 if a videofilename is used or if this is not initialized)

Definition at line 170 of file mitkOpenCVVideoSource.h.

◆ m_PauseImage

IplImage* mitk::OpenCVVideoSource::m_PauseImage
protected

Definition at line 162 of file mitkOpenCVVideoSource.h.

◆ m_RepeatVideo

bool mitk::OpenCVVideoSource::m_RepeatVideo
protected

Definition at line 173 of file mitkOpenCVVideoSource.h.

◆ m_UndistortCameraImage

mitk::UndistortCameraImage::Pointer mitk::OpenCVVideoSource::m_UndistortCameraImage
protected

Definition at line 180 of file mitkOpenCVVideoSource.h.

◆ m_UndistortImage

bool mitk::OpenCVVideoSource::m_UndistortImage
protected

Definition at line 179 of file mitkOpenCVVideoSource.h.

◆ m_UseCVCAMLib

bool mitk::OpenCVVideoSource::m_UseCVCAMLib
protected

Definition at line 176 of file mitkOpenCVVideoSource.h.

◆ m_VideoCapture

CvCapture* mitk::OpenCVVideoSource::m_VideoCapture
protected

Definition at line 156 of file mitkOpenCVVideoSource.h.

◆ m_VideoFileName

std::string mitk::OpenCVVideoSource::m_VideoFileName
protected

saves the video file name (is empty if a grabbing device is used or if this is not initialized)

Definition at line 166 of file mitkOpenCVVideoSource.h.


The documentation for this class was generated from the following files: