23 : m_NewCropRegionSet(false)
31 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
32 <<
"Cropping cannot be done without setting a non-empty crop region first.";
36 cv::Size imageSize = image.size();
40 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
41 <<
"Cannot crop if top left corner of the roi is outside the image boundaries.";
54 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
55 <<
"Changed too large roi in x direction to fit the image size.";
60 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
61 <<
"Changed too large roi in y direction to fit the image size.";
77 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
78 <<
"Changed negative x value in roi to 0.";
84 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
85 <<
"Changed negative y value in roi to 0.";
89 if ( cropRegion.height < 0 || cropRegion.width < 0 )
91 mitkThrow() <<
"Invalid boundaries supplied to USImageVideoSource::SetRegionOfInterest()";
99 this->
SetCropRegion( cv::Rect(topLeftX, topLeftY, bottomRightX - topLeftX, bottomRightY - topLeftY) );
cv::Rect m_CropRegion
Defines the region which will be cropped from the image.
DataCollection - Class to facilitate loading/accessing structured data.
cv::Rect GetCropRegion()
Returns region, which was set by mitk::CropOpenCVImageFilter::SetCropRegion().
bool GetIsCropRegionEmpty()
bool OnFilterImage(cv::Mat &image) override
Crops image to rectangle given by mitk::CropOpenCVImageFilter::SetCropRegion.
void SetCropRegion(cv::Rect cropRegion)
Set region of interest for cropping.
bool m_NewCropRegionSet
True if no image was filtered since last set of a crop region.