26 lines
784 B
C++
26 lines
784 B
C++
#pragma once
|
|
#include <opencv2/core/core.hpp>
|
|
#include <opencv2/highgui/highgui.hpp>
|
|
#include <opencv2\imgproc\imgproc.hpp>
|
|
#include <opencv/cv.h>
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <stack>
|
|
|
|
using namespace cv;
|
|
using namespace std;
|
|
|
|
class FloodFill
|
|
{
|
|
public:
|
|
FloodFill();
|
|
~FloodFill();
|
|
static int enclosedPixels(const vector<Point> & contourVec, vector<Point> & regionPixels);
|
|
static bool contains(vector<Point> vec, Point p);
|
|
static Point findStartPoint(vector<Point> vec);
|
|
static int floodfill(const vector<Point> & contourVec, vector<Point> & regionPixels, Point &p);
|
|
static int split(const vector<vector<Point>> & contours, const Mat &image, string filename);
|
|
static int largest(const vector<vector<Point>> & contours, const Mat &image, string filename);
|
|
};
|
|
|