16 #include <opencv2/opencv.hpp> 21 int main(
int argc,
char *argv[]) {
23 Mat image = imread(
"dog.png", 1);
25 cvtColor(image, lab_image, COLOR_BGR2Lab);
28 int w = image.cols,
h = image.rows;
29 int nr_superpixels = 400;
32 double step =
sqrt((w *
h) / (
double) nr_superpixels);
41 imshow(
"result", image);
void create_connectivity(const cv::Mat &image)
CvImagePtr cvtColor(const CvImageConstPtr &source, const std::string &encoding)
void generate_superpixels(const cv::Mat &image, int step, int nc)
void display_contours(cv::Mat &image, cv::Vec3b colour)
int main(int argc, char *argv[])