Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
#include <mitkOpenCVVideoSource.h>
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< RGBPixelImageType > | RGBConstIteratorType |
typedef itk::ImageRegionIterator< HSVPixelImageType > | HSVConstIteratorType |
Public Member Functions | |
mitkClassMacro (OpenCVVideoSource, VideoSource) | |
Pointer | Clone () const |
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 |
virtual std::string | GetVideoFileName () const |
virtual void | SetEnableXAxisFlip (bool enable) |
virtual void | SetEnableYAxisFlip (bool enable) |
virtual short | GetGrabbingDeviceNumber () const |
virtual bool | GetRepeatVideo () |
virtual void | SetRepeatVideo (bool _arg) |
![]() | |
mitkClassMacroItkParent (VideoSource, itk::Object) | |
virtual bool | IsCapturingEnabled () const |
virtual int | GetImageWidth () |
virtual int | GetImageHeight () |
virtual unsigned long | GetFrameCount () const |
virtual bool | GetCapturePaused () const |
![]() | |
mitkClassMacroItkParent (OpenCVImageSource, itk::Object) | |
Static Public Member Functions | |
static Pointer | New () |
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) |
![]() | |
VideoSource () | |
~VideoSource () override | |
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) More... | |
short | m_GrabbingDeviceNumber |
saves the grabbing device number (is -1 if a videofilename is used or if this is not initialized) More... | |
bool | m_RepeatVideo |
bool | m_UseCVCAMLib |
bool | m_UndistortImage |
mitk::UndistortCameraImage::Pointer | m_UndistortCameraImage |
bool | m_FlipXAxisEnabled |
bool | m_FlipYAxisEnabled |
![]() | |
unsigned char * | m_CurrentVideoTexture |
int | m_CaptureWidth |
int | m_CaptureHeight |
bool | m_CapturingInProcess |
unsigned long | m_FrameCount |
bool | m_CapturePaused |
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.
typedef itk::RGBPixel< unsigned char > mitk::OpenCVVideoSource::CharPixelType |
Definition at line 43 of file mitkOpenCVVideoSource.h.
typedef itk::ImageRegionIterator< HSVPixelImageType > mitk::OpenCVVideoSource::HSVConstIteratorType |
Definition at line 48 of file mitkOpenCVVideoSource.h.
Definition at line 46 of file mitkOpenCVVideoSource.h.
typedef itk::FixedArray<float,3> mitk::OpenCVVideoSource::HSVPixelType |
Definition at line 44 of file mitkOpenCVVideoSource.h.
typedef itk::ImageRegionIterator< RGBPixelImageType > mitk::OpenCVVideoSource::RGBConstIteratorType |
Definition at line 47 of file mitkOpenCVVideoSource.h.
typedef itk::Image< CharPixelType , 2 > mitk::OpenCVVideoSource::RGBPixelImageType |
Definition at line 45 of file mitkOpenCVVideoSource.h.
|
protected |
Definition at line 17 of file mitkOpenCVVideoSource.cpp.
|
overrideprotected |
Definition at line 31 of file mitkOpenCVVideoSource.cpp.
References Reset().
Pointer mitk::OpenCVVideoSource::Clone | ( | ) | const |
|
virtual |
Definition at line 263 of file mitkOpenCVVideoSource.cpp.
References m_UndistortImage.
|
virtual |
Definition at line 249 of file mitkOpenCVVideoSource.cpp.
References FetchFrame(), mitk::VideoSource::m_CaptureHeight, mitk::VideoSource::m_CaptureWidth, m_UndistortCameraImage, m_UndistortImage, and mitk::UndistortCameraImage::New().
|
overridevirtual |
assigns the grabbing devices for acquiring the next frame. in this base implementation it does nothing except incrementing m_FrameCount
Reimplemented from mitk::VideoSource.
Reimplemented in mitk::VideoInputSource.
Definition at line 117 of file mitkOpenCVVideoSource.cpp.
References GetVideoCaptureProperty(), mitk::VideoSource::m_CaptureHeight, mitk::VideoSource::m_CapturePaused, mitk::VideoSource::m_CaptureWidth, mitk::VideoSource::m_CapturingInProcess, m_CurrentImage, mitk::VideoSource::m_FrameCount, m_RepeatVideo, m_UndistortCameraImage, m_UndistortImage, m_VideoCapture, m_VideoFileName, MITK_DEBUG, MITK_INFO, and SetVideoCaptureProperty().
Referenced by EnableOnlineImageUndistortion(), GetCurrentFrameAsItkHSVPixelImage(), and GetVideoTexture().
|
virtual |
Definition at line 363 of file mitkOpenCVVideoSource.cpp.
References m_FlipXAxisEnabled, and m_FlipYAxisEnabled.
Referenced by GetVideoTexture().
|
virtual |
Definition at line 100 of file mitkOpenCVVideoSource.cpp.
References m_CurrentImage.
Referenced by QmitkOpenCVVideoControls::NewFrameAvailable().
|
virtual |
Definition at line 269 of file mitkOpenCVVideoSource.cpp.
References FetchFrame(), mitk::VideoSource::m_CaptureHeight, mitk::VideoSource::m_CaptureWidth, m_CurrentImage, and RGBtoHSV().
|
virtual |
Definition at line 105 of file mitkOpenCVVideoSource.cpp.
References m_CurrentImage.
|
virtual |
Returns the GrabbingDeviceNumber (maybe -1 if a video file is used)
Referenced by QmitkOpenCVVideoControls::SetVideoBackground().
|
overridevirtual |
Implements mitk::OpenCVImageSource.
Definition at line 90 of file mitkOpenCVVideoSource.cpp.
References m_CurrentImage.
|
virtual |
|
virtual |
Definition at line 62 of file mitkOpenCVVideoSource.cpp.
References m_VideoCapture.
Referenced by FetchFrame(), QmitkOpenCVVideoControls::NewFrameAvailable(), and QmitkOpenCVVideoControls::on_VideoProgressSlider_sliderReleased().
|
virtual |
Returns the video file name (maybe empty if a grabbing device is used)
Referenced by QmitkOpenCVVideoControls::SetVideoBackground().
|
overridevirtual |
Implements mitk::VideoSource.
Definition at line 73 of file mitkOpenCVVideoSource.cpp.
References FetchFrame(), FlipImage(), m_CurrentImage, m_CurrentVideoTexture, m_FlipXAxisEnabled, m_FlipYAxisEnabled, and UpdateVideoTexture().
mitk::OpenCVVideoSource::mitkClassMacro | ( | OpenCVVideoSource | , |
VideoSource | |||
) |
|
static |
|
virtual |
Definition at line 223 of file mitkOpenCVVideoSource.cpp.
References m_UndistortCameraImage.
|
overridevirtual |
toggles m_CapturePaused In Subclasses this function can be overwritten to take measurs to provide a pause image, BUT DO NOT FORGET TO TOGGLE m_CapturePaused
Reimplemented from mitk::VideoSource.
Definition at line 228 of file mitkOpenCVVideoSource.cpp.
References mitk::VideoSource::m_CapturePaused, m_CurrentImage, m_PauseImage, m_UndistortCameraImage, and m_UndistortImage.
Referenced by QmitkOpenCVVideoControls::on_PlayButton_clicked(), QmitkOpenCVVideoControls::on_VideoProgressSlider_sliderPressed(), QmitkOpenCVVideoControls::on_VideoProgressSlider_sliderReleased(), and QmitkOpenCVVideoControls::Play().
|
protected |
Resets the whole class for capturing from a new device
Definition at line 387 of file mitkOpenCVVideoSource.cpp.
References mitk::VideoSource::m_CaptureHeight, mitk::VideoSource::m_CapturePaused, mitk::VideoSource::m_CaptureWidth, m_CurrentImage, m_CurrentVideoTexture, mitk::VideoSource::m_FrameCount, m_GrabbingDeviceNumber, m_PauseImage, m_UseCVCAMLib, m_VideoCapture, m_VideoFileName, and StopCapturing().
Referenced by SetVideoCameraInput(), SetVideoFileInput(), and ~OpenCVVideoSource().
|
protected |
Definition at line 312 of file mitkOpenCVVideoSource.cpp.
Referenced by GetCurrentFrameAsItkHSVPixelImage().
|
virtual |
Definition at line 413 of file mitkOpenCVVideoSource.cpp.
References m_FlipXAxisEnabled.
|
virtual |
Definition at line 419 of file mitkOpenCVVideoSource.cpp.
References m_FlipXAxisEnabled.
|
virtual |
|
virtual |
Reimplemented in mitk::VideoInputSource.
Definition at line 50 of file mitkOpenCVVideoSource.cpp.
References m_GrabbingDeviceNumber, m_VideoCapture, MITK_ERROR, and Reset().
Referenced by QmitkOpenCVVideoControls::Play().
|
virtual |
Definition at line 67 of file mitkOpenCVVideoSource.cpp.
References m_VideoCapture.
Referenced by FetchFrame(), and QmitkOpenCVVideoControls::on_VideoProgressSlider_sliderReleased().
|
virtual |
Reimplemented in mitk::VideoInputSource.
Definition at line 36 of file mitkOpenCVVideoSource.cpp.
References m_RepeatVideo, m_VideoCapture, m_VideoFileName, MITK_WARN, and Reset().
Referenced by QmitkOpenCVVideoControls::Play().
|
protected |
|
overridevirtual |
advices this class to start the video capturing. in this base implementation: toggles m_CapturingInProcess, resets m_FrameCount ATTENTION: this should be also done in subclasses overwriting this method
Reimplemented from mitk::VideoSource.
Reimplemented in mitk::VideoInputSource.
Definition at line 209 of file mitkOpenCVVideoSource.cpp.
References mitk::VideoSource::m_CapturingInProcess, and m_VideoCapture.
Referenced by QmitkOpenCVVideoControls::Play().
|
overridevirtual |
advices this class to stop the video capturing. in this base implementation: toggles m_CapturingInProcess, resets m_FrameCount ATTENTION: this should be also done in subclasses overwriting this method
Reimplemented from mitk::VideoSource.
Reimplemented in mitk::VideoInputSource.
Definition at line 217 of file mitkOpenCVVideoSource.cpp.
References mitk::VideoSource::m_CapturePaused, and mitk::VideoSource::m_CapturingInProcess.
Referenced by Reset(), and QmitkOpenCVVideoControls::Stop().
|
protected |
Definition at line 168 of file mitkOpenCVVideoSource.cpp.
References mitk::VideoSource::m_CaptureHeight, mitk::VideoSource::m_CaptureWidth, m_CurrentImage, and m_CurrentVideoTexture.
Referenced by GetVideoTexture().
|
protected |
Definition at line 161 of file mitkOpenCVVideoSource.h.
Referenced by mitk::VideoInputSource::FetchFrame(), FetchFrame(), GetCurrentFrame(), GetCurrentFrameAsItkHSVPixelImage(), GetCurrentFrameAsOpenCVImage(), GetImage(), GetVideoTexture(), PauseCapturing(), Reset(), UpdateVideoTexture(), and mitk::VideoInputSource::VideoInputSource().
|
protected |
Definition at line 162 of file mitkOpenCVVideoSource.h.
Referenced by GetVideoTexture(), Reset(), and UpdateVideoTexture().
|
protected |
Flag to enable or disable video flipping by X Axis.
Definition at line 187 of file mitkOpenCVVideoSource.h.
Referenced by FlipImage(), GetVideoTexture(), SetEnableXAxisFlip(), and SetEnableYAxisFlip().
|
protected |
Flag to enable or disable video flipping by Y Axis.
Definition at line 192 of file mitkOpenCVVideoSource.h.
Referenced by FlipImage(), and GetVideoTexture().
|
protected |
saves the grabbing device number (is -1 if a videofilename is used or if this is not initialized)
Definition at line 172 of file mitkOpenCVVideoSource.h.
Referenced by Reset(), and SetVideoCameraInput().
|
protected |
Definition at line 164 of file mitkOpenCVVideoSource.h.
Referenced by PauseCapturing(), and Reset().
|
protected |
Definition at line 175 of file mitkOpenCVVideoSource.h.
Referenced by FetchFrame(), and SetVideoFileInput().
|
protected |
Definition at line 182 of file mitkOpenCVVideoSource.h.
Referenced by EnableOnlineImageUndistortion(), mitk::VideoInputSource::FetchFrame(), FetchFrame(), OnlineImageUndistortionEnabled(), and PauseCapturing().
|
protected |
Definition at line 181 of file mitkOpenCVVideoSource.h.
Referenced by DisableOnlineImageUndistortion(), EnableOnlineImageUndistortion(), mitk::VideoInputSource::FetchFrame(), FetchFrame(), PauseCapturing(), and mitk::VideoInputSource::VideoInputSource().
|
protected |
Definition at line 178 of file mitkOpenCVVideoSource.h.
Referenced by Reset().
|
protected |
Definition at line 158 of file mitkOpenCVVideoSource.h.
Referenced by FetchFrame(), GetVideoCaptureProperty(), Reset(), SetVideoCameraInput(), SetVideoCaptureProperty(), SetVideoFileInput(), and StartCapturing().
|
protected |
saves the video file name (is empty if a grabbing device is used or if this is not initialized)
Definition at line 168 of file mitkOpenCVVideoSource.h.
Referenced by FetchFrame(), Reset(), and SetVideoFileInput().