18 : m_NewCropRegionSet(false)
26 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
27 <<
"Cropping cannot be done without setting a non-empty crop region first.";
31 cv::Size imageSize = image.size();
35 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
36 <<
"Cannot crop if top left corner of the roi is outside the image boundaries.";
49 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
50 <<
"Changed too large roi in x direction to fit the image size.";
55 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
56 <<
"Changed too large roi in y direction to fit the image size.";
72 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
73 <<
"Changed negative x value in roi to 0.";
79 MITK_WARN(
"AbstractOpenCVImageFilter")(
"CropOpenCVImageFilter")
80 <<
"Changed negative y value in roi to 0.";
84 if ( cropRegion.height < 0 || cropRegion.width < 0 )
86 mitkThrow() <<
"Invalid boundaries supplied to USImageVideoSource::SetRegionOfInterest()";
94 this->
SetCropRegion( cv::Rect(topLeftX, topLeftY, bottomRightX - topLeftX, bottomRightY - topLeftY) );
void SetCropRegion(cv::Rect cropRegion)
Set region of interest for cropping.
bool GetIsCropRegionEmpty()
cv::Rect m_CropRegion
Defines the region which will be cropped from the image.
cv::Rect GetCropRegion()
Returns region, which was set by mitk::CropOpenCVImageFilter::SetCropRegion().
bool m_NewCropRegionSet
True if no image was filtered since last set of a crop region.
bool OnFilterImage(cv::Mat &image) override
Crops image to rectangle given by mitk::CropOpenCVImageFilter::SetCropRegion.