#include "opencv2/core/core.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include #include #include #define EXPORT_API __declspec(dllexport) using namespace cv; using namespace std; class BhBlocks { private: int colCount, rowCount; float colSize, rowSize; CvRect rct; void compute(); public: vector> rects; void setColsRowsCount(int colCount, int rowCount); void setColRowSize(float colSize, float rowSize); void setRect(IplImage* srcImage); void setRect(const CvRect& srcRect); int getColCount(); int getRowCount(); float getColSize(); float getRowSize(); BhBlocks(const IplImage* srcImage, float colSize = -1, float rowSize = -1, int colCount = -1, int rowCount = -1); BhBlocks(const Mat& srcMat, float colSize = -1, float rowSize = -1, int colCount = -1, int rowCount = -1); BhBlocks(const CvRect& srcImage, float colSize = -1, float rowSize = -1, int colCount = -1, int rowCount = -1); void drawBlocks(Mat srcImage, Scalar color, int thickness); void displayBlocks(char* title, IplImage* srcImage, CvScalar color, int thickness); vector getRects(); };