MITK-IGT
IGT Extension of MITK
|
This class can be pointed to a video file or a videodevice and delivers USImages. More...
#include <mitkUSImageVideoSource.h>
Classes | |
struct | USImageCropping |
Defines a region of interest by distances to the four image borders. More... | |
struct | USImageRoi |
Defines a region of interest by top left and bottom right corner. More... | |
Public Member Functions | |
mitkClassMacroItkParent (USImageVideoSource, itk::ProcessObject) | |
itkFactorylessNewMacro (Self) | |
itkCloneMacro (Self) | |
void | SetVideoFileInput (std::string path) |
Opens a video file for streaming. If nothing goes wrong, the VideoSource is ready to deliver images after calling this function. | |
void | SetCameraInput (int deviceID) |
Opens a video device for streaming. Takes the Device id. Try -1 for "grab the first you can get" which works quite well if only one device is available. If nothing goes wrong, the VideoSource is ready to deliver images after calling this function. | |
void | ReleaseInput () |
void | SetColorOutput (bool isColor) |
Sets the output image to rgb or grayscale. Output is color by default and can be set to color by passing true, or to grayscale again by passing false. | |
void | SetRegionOfInterest (int topLeftX, int topLeftY, int bottomRightX, int bottomRightY) |
Defines the cropping area. The rectangle will be justified to the image borders if the given rectangle is larger than the video source. If a correct rectangle is given, the dimensions of the output image will be equal to those of the rectangle. | |
void | SetRegionOfInterest (USImageRoi regionOfInterest) |
Defines the cropping area. The rectangle will be justified to the image borders if the given rectangle is larger than the video source. If a correct rectangle is given, the dimensions of the output image will be equal to those of the rectangle. | |
void | SetCropping (USImageCropping cropping) |
Defines the cropping area. The rectangle will be justified to the image borders if the given rectangle is larger than the video source. If a correct rectangle is given, the dimensions of the output image will be equal to those of the rectangle. | |
void | RemoveRegionOfInterest () |
void | OverrideResolution (int width, int height) |
This is a workaround for a problem that happens with some video device drivers. | |
itkGetMacro (IsVideoReady, bool) | |
itkGetMacro (ResolutionOverride, bool) | |
itkSetMacro (ResolutionOverride, bool) | |
itkGetMacro (IsGreyscale, bool) | |
itkGetMacro (ResolutionOverrideWidth, int) | |
itkGetMacro (ResolutionOverrideHeight, int) | |
int | GetImageHeight () |
int | GetImageWidth () |
USImageCropping | GetCropping () |
USImageRoi | GetRegionOfInterest () |
bool | GetIsReady () |
Returns true if images can be delivered. | |
![]() | |
mitkClassMacroItkParent (USImageSource, itk::Object) | |
itkGetMacro (ImageFilter, mitk::BasicCombinationOpenCVImageFilter::Pointer) | |
void | PushFilter (AbstractOpenCVImageFilter::Pointer filter) |
bool | RemoveFilter (AbstractOpenCVImageFilter::Pointer filter) |
bool | GetIsFilterInThePipeline (AbstractOpenCVImageFilter::Pointer filter) |
std::vector< mitk::Image::Pointer > | GetNextImage () |
Retrieves the next frame. This will typically be the next frame in a file or the last cached file in a device. The image is filtered if a filter was set by mitk::USImageSource::SetImageFilter(). | |
Protected Member Functions | |
USImageVideoSource () | |
~USImageVideoSource () override | |
void | GetNextRawImage (std::vector< cv::Mat > &image) override |
Next image is gathered from the image source. | |
void | GetNextRawImage (std::vector< mitk::Image::Pointer > &image) override |
Next image is gathered from the image source. | |
![]() | |
USImageSource () | |
~USImageSource () override | |
Protected Attributes | |
cv::VideoCapture * | m_VideoCapture |
The source of the video, managed internally. | |
bool | m_IsVideoReady |
If true, a frame can be grabbed anytime. | |
bool | m_IsGreyscale |
If true, image output will be greyscale. | |
bool | m_IsCropped |
If true, image will be cropped according to settings of crop filter. | |
int | m_ResolutionOverrideWidth |
int | m_ResolutionOverrideHeight |
bool | m_ResolutionOverride |
ConvertGrayscaleOpenCVImageFilter::Pointer | m_GrayscaleFilter |
CropOpenCVImageFilter::Pointer | m_CropFilter |
![]() | |
mitk::OpenCVToMitkImageFilter::Pointer | m_OpenCVToMitkFilter |
Used to convert from OpenCV Images to MITK Images. | |
mitk::ImageToOpenCVImageFilter::Pointer | m_MitkToOpenCVFilter |
Used to convert from MITK Images to OpenCV Images. | |
Additional Inherited Members | |
![]() | |
static const char * | IMAGE_PROPERTY_IDENTIFIER = "id_nummer" |
This class can be pointed to a video file or a videodevice and delivers USImages.
Images are in color by default, but can be set to greyscale via SetColorOutput(false), which significantly improves performance.
Images can also be cropped to a region of interest, further increasing performance.
Definition at line 39 of file mitkUSImageVideoSource.h.
|
protected |
Definition at line 21 of file mitkUSImageVideoSource.cpp.
|
overrideprotected |
Definition at line 34 of file mitkUSImageVideoSource.cpp.
mitk::USImageVideoSource::USImageCropping mitk::USImageVideoSource::GetCropping | ( | ) |
Definition at line 135 of file mitkUSImageVideoSource.cpp.
int mitk::USImageVideoSource::GetImageHeight | ( | ) |
Definition at line 92 of file mitkUSImageVideoSource.cpp.
int mitk::USImageVideoSource::GetImageWidth | ( | ) |
Definition at line 98 of file mitkUSImageVideoSource.cpp.
bool mitk::USImageVideoSource::GetIsReady | ( | ) |
Returns true if images can be delivered.
Only if true is returned one can retrieve images via mitk::USImageVideoSource::GetNextImage(). If false is returned, behaviour is undefined.
Definition at line 104 of file mitkUSImageVideoSource.cpp.
|
overrideprotectedvirtual |
Next image is gathered from the image source.
[out] | image | an OpenCV-Matrix containing this image |
Reimplemented from mitk::USImageSource.
Definition at line 177 of file mitkUSImageVideoSource.cpp.
|
overrideprotectedvirtual |
Next image is gathered from the image source.
[out] | image | an mitk::Image containing this image |
Implements mitk::USImageSource.
Definition at line 194 of file mitkUSImageVideoSource.cpp.
mitk::USImageVideoSource::USImageRoi mitk::USImageVideoSource::GetRegionOfInterest | ( | ) |
Definition at line 164 of file mitkUSImageVideoSource.cpp.
mitk::USImageVideoSource::itkCloneMacro | ( | Self | ) |
mitk::USImageVideoSource::itkFactorylessNewMacro | ( | Self | ) |
mitk::USImageVideoSource::itkGetMacro | ( | IsGreyscale | , |
bool | ) |
mitk::USImageVideoSource::itkGetMacro | ( | IsVideoReady | , |
bool | ) |
mitk::USImageVideoSource::itkGetMacro | ( | ResolutionOverride | , |
bool | ) |
mitk::USImageVideoSource::itkGetMacro | ( | ResolutionOverrideHeight | , |
int | ) |
mitk::USImageVideoSource::itkGetMacro | ( | ResolutionOverrideWidth | , |
int | ) |
mitk::USImageVideoSource::itkSetMacro | ( | ResolutionOverride | , |
bool | ) |
mitk::USImageVideoSource::mitkClassMacroItkParent | ( | USImageVideoSource | , |
itk::ProcessObject | ) |
void mitk::USImageVideoSource::OverrideResolution | ( | int | width, |
int | height ) |
This is a workaround for a problem that happens with some video device drivers.
If you encounter OpenCV Warnings that buffer sizes do not match while calling getNextFrame, then do the following: Using the drivers control panel to force a certain resolution, then call this method with the same Dimensions after opening the device. Before retrieving images one should call mitk::USImageVideoSource::isReady().
Definition at line 216 of file mitkUSImageVideoSource.cpp.
void mitk::USImageVideoSource::ReleaseInput | ( | ) |
Definition at line 72 of file mitkUSImageVideoSource.cpp.
void mitk::USImageVideoSource::RemoveRegionOfInterest | ( | ) |
/brief Removes the region of interest. Produced images will be uncropped after call of this method.
Definition at line 171 of file mitkUSImageVideoSource.cpp.
void mitk::USImageVideoSource::SetCameraInput | ( | int | deviceID | ) |
Opens a video device for streaming. Takes the Device id. Try -1 for "grab the first you can get" which works quite well if only one device is available. If nothing goes wrong, the VideoSource is ready to deliver images after calling this function.
Definition at line 56 of file mitkUSImageVideoSource.cpp.
void mitk::USImageVideoSource::SetColorOutput | ( | bool | isColor | ) |
Sets the output image to rgb or grayscale. Output is color by default and can be set to color by passing true, or to grayscale again by passing false.
Definition at line 79 of file mitkUSImageVideoSource.cpp.
void mitk::USImageVideoSource::SetCropping | ( | USImageCropping | cropping | ) |
Defines the cropping area. The rectangle will be justified to the image borders if the given rectangle is larger than the video source. If a correct rectangle is given, the dimensions of the output image will be equal to those of the rectangle.
cropping | struct defining distances to the four image borders |
Definition at line 127 of file mitkUSImageVideoSource.cpp.
void mitk::USImageVideoSource::SetRegionOfInterest | ( | int | topLeftX, |
int | topLeftY, | ||
int | bottomRightX, | ||
int | bottomRightY ) |
Defines the cropping area. The rectangle will be justified to the image borders if the given rectangle is larger than the video source. If a correct rectangle is given, the dimensions of the output image will be equal to those of the rectangle.
Definition at line 111 of file mitkUSImageVideoSource.cpp.
void mitk::USImageVideoSource::SetRegionOfInterest | ( | USImageRoi | regionOfInterest | ) |
Defines the cropping area. The rectangle will be justified to the image borders if the given rectangle is larger than the video source. If a correct rectangle is given, the dimensions of the output image will be equal to those of the rectangle.
regionOfInterest | struct defining x and y coordinates of top left and bottom right corner |
Definition at line 122 of file mitkUSImageVideoSource.cpp.
void mitk::USImageVideoSource::SetVideoFileInput | ( | std::string | path | ) |
Opens a video file for streaming. If nothing goes wrong, the VideoSource is ready to deliver images after calling this function.
Definition at line 40 of file mitkUSImageVideoSource.cpp.
|
protected |
Definition at line 214 of file mitkUSImageVideoSource.h.
|
protected |
Definition at line 213 of file mitkUSImageVideoSource.h.
|
protected |
If true, image will be cropped according to settings of crop filter.
Definition at line 204 of file mitkUSImageVideoSource.h.
|
protected |
If true, image output will be greyscale.
Definition at line 199 of file mitkUSImageVideoSource.h.
|
protected |
If true, a frame can be grabbed anytime.
Definition at line 194 of file mitkUSImageVideoSource.h.
|
protected |
Definition at line 211 of file mitkUSImageVideoSource.h.
|
protected |
Definition at line 210 of file mitkUSImageVideoSource.h.
|
protected |
These Variables determined whether Resolution Override is on, what dimensions to use.
Definition at line 209 of file mitkUSImageVideoSource.h.
|
protected |
The source of the video, managed internally.
Definition at line 189 of file mitkUSImageVideoSource.h.