13 #ifndef MITKGRABCUTOPENCVIMAGEFILTER_H 14 #define MITKGRABCUTOPENCVIMAGEFILTER_H 21 #include "itkObjectFactory.h" 22 #include "itkMutexLock.h" 25 #include <opencv2/core.hpp> 28 template<
unsigned int T>
class Index;
31 class ConditionVariable;
65 itkFactorylessNewMacro(Self);
81 bool OnFilterImage( cv::Mat& image )
override;
87 void SetModelPoints(ModelPointsList foregroundPoints);
94 void SetModelPoints(ModelPointsList foregroundPoints, ModelPointsList backgroundPoints);
99 void SetModelPoints(cv::Mat foregroundMask);
106 void SetModelPoints(cv::Mat foregroundMask, cv::Mat backgroundMask);
120 void SetModelPointsDilationSize(
int modelPointsDilationSize);
133 void SetUseOnlyRegionAroundModelPoints(
unsigned int additionalBorder);
141 void SetUseFullImage();
149 cv::Rect GetRegionAroundModelPoints();
162 int GetResultImageId();
172 cv::Mat GetResultMask();
188 std::vector<ModelPointsList> GetResultContours();
207 ModelPointsList GetResultContourWithPixel(
itk::Index<2> pixelIndex);
214 cv::Mat GetMaskFromPointSets();
221 cv::Rect GetBoundingRectFromMask(cv::Mat mask);
229 cv::Mat RunSegmentation(cv::Mat input, cv::Mat mask);
234 ModelPointsList ConvertMaskToModelPointsList(cv::Mat mask);
266 static ITK_THREAD_RETURN_TYPE SegmentationWorker(
void* pInfoStruct);
287 #endif // MITKGRABCUTOPENCVIMAGEFILTER_H std::vector< itk::Index< 2 > > ModelPointsList
List holding image indices of the model points.
unsigned int m_AdditionalWidth
int m_ResultImageId
id of the image which segmentation result is currently present in m_ResultMask
ModelPointsList m_ForegroundPoints
DataCollection - Class to facilitate loading/accessing structured data.
bool m_UseOnlyRegionAroundModelPoints
unsigned int m_CurrentProcessImageNum
#define MITKOPENCVVIDEOSUPPORT_EXPORT
ModelPointsList m_BackgroundPoints
Makes the OpenCV GrabCut filter available as OpenCVImageFilter.
#define mitkClassMacro(className, SuperClassName)
Interface for image filters on OpenCV images.
int m_InputImageId
id of the image currently set as m_InputImage
int m_ModelPointsDilationSize