Reprezentowanie krawędzi

Boundary Chain Codes

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;
int main(){
	cout << ":" << endl;
	Mat img = imread("./house.png", 1);
	Mat img_contours = img.clone();
	cvtColor(img, img, CV_BGR2GRAY);

	Mat binary_edges;
	Canny(img, binary_edges, 100, 200);


	imshow("Image", img);
	imshow("Canny", binary_edges);

	
	vector> contours;
	vector hierarchy;
	findContours(binary_edges, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_NONE);
	for (int contour_number = 0; (contour_number