#ifndef IMAGE_APPLY_AUTO_CROP_H #define IMAGE_APPLY_AUTO_CROP_H #include "ImageApply.h" class CImageApplyAutoCrop : public CImageApply { public: CImageApplyAutoCrop(); CImageApplyAutoCrop(bool isCrop, bool isDesaskew, bool isFillBlank, const cv::Size& fixedSize, bool isConvex = true, double threshold = 40, int noise = 40, int indent = 5); virtual ~CImageApplyAutoCrop(); virtual void apply(cv::Mat& pDib, int side); virtual void apply(std::vector& mats, bool isTwoSide); bool isAutoCrop() { return m_isCrop; } bool isFillBlank() { return m_isFillBlank; } bool isDesaskew() { return m_isDesaskew; } bool isConvexHull() { return m_isConvexHull; } double threshold() { return m_threshold; } int noise() { return m_noise; } int indent() { return m_indent; } cv::Size fixedSize() { return m_fixedSize; } void setAutoCrop(bool enabled) { m_isCrop = enabled; } void setFillBlank(bool enabled) { m_isFillBlank = enabled; } void setDesaskew(bool enabled) { m_isDesaskew = enabled; } void setConvexHull(bool convex) { m_isConvexHull = convex; } void setThreshold(double value) { m_threshold = value; } void setNoise(int value) { m_noise = value; } void setIndent(int value) { m_indent = value; } void setFixedSize(cv::Size size) { m_fixedSize = size; } private: bool m_isCrop; bool m_isDesaskew; bool m_isFillBlank; bool m_isConvexHull; double m_threshold; int m_noise; int m_indent; cv::Size m_fixedSize; }; #endif // !IMAGE_APPLY_AUTO_CROP_H