22 : m_VideoCapture(new
cv::VideoCapture()),
23 m_IsVideoReady(false),
26 m_ResolutionOverrideWidth(0),
27 m_ResolutionOverrideHeight(0),
28 m_ResolutionOverride(false),
113 m_CropFilter->SetCropRegion(topLeftX, topLeftY, bottomRightX, bottomRightY);
140 cropping.
left = cropRect.x;
141 cropping.
top = cropRect.y;
143 if ( cropRect.height == 0 )
152 if ( cropRect.width == 0 )
168 return USImageRoi(cropRect.x, cropRect.y, cropRect.x + cropRect.width, cropRect.y + cropRect.height);
187 if (image.size() != 1)
196 if (image.size() != 1)
199 std::vector<cv::Mat> cv_img;
204 IplImage ipl_img = cv_img[0];
Defines a region of interest by distances to the four image borders.
ConvertGrayscaleOpenCVImageFilter::Pointer m_GrayscaleFilter
USImageRoi GetRegionOfInterest()
mitk::OpenCVToMitkImageFilter::Pointer m_OpenCVToMitkFilter
Used to convert from OpenCV Images to MITK Images.
cv::VideoCapture * m_VideoCapture
The source of the video, managed internally.
void RemoveRegionOfInterest()
USImageCropping GetCropping()
DataCollection - Class to facilitate loading/accessing structured data.
CropOpenCVImageFilter::Pointer m_CropFilter
int m_ResolutionOverrideHeight
Defines a region of interest by top left and bottom right corner.
void GetNextRawImage(std::vector< cv::Mat > &image) override
Next image is gathered from the image source.
bool RemoveFilter(AbstractOpenCVImageFilter::Pointer filter)
bool GetIsReady()
Returns true if images can be delivered.
int m_ResolutionOverrideWidth
void SetVideoFileInput(std::string path)
Opens a video file for streaming. If nothing goes wrong, the VideoSource is ready to deliver images a...
void OverrideResolution(int width, int height)
This is a workaround for a problem that happens with some video device drivers.
mitk::Image::Pointer image
void SetCameraInput(int deviceID)
Opens a video device for streaming. Takes the Device id. Try -1 for "grab the first you can get" whic...
bool m_IsVideoReady
If true, a frame can be grabbed anytime.
bool m_ResolutionOverride
void PushFilter(AbstractOpenCVImageFilter::Pointer filter)
void SetColorOutput(bool isColor)
Sets the output image to rgb or grayscale. Output is color by default and can be set to color by pass...
void SetCropping(USImageCropping cropping)
Defines the cropping area. The rectangle will be justified to the image borders if the given rectangl...
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 rectangl...
bool m_IsGreyscale
If true, image output will be greyscale.
~USImageVideoSource() override
bool m_IsCropped
If true, image will be cropped according to settings of crop filter.