/* #include #include #include #include "glut.h" #include "imvideocapture.h" #include "filters.h" #include "image.h" #include "hide_background.h" */ #include "find_edges.h" #include "vectorization.h" unsigned char img_aux[4][1000000]; void findPattern(int xs[8], int ys[8], unsigned char* img, int width, int height) { objectSet objects_; blackAndWhite(img, img_aux[0], width, height); gaussiano2(img_aux[0], img_aux[1], width, height); canny(img_aux[1], img_aux[2], img_aux[3], width, height); dilatation(img_aux[2], img_aux[3], width, height); erosion(img_aux[3], img_aux[2], width, height); vectorizeMask2(img_aux[2], img_aux[3], objects_, width, height); getCriticalPoints(objects_, img, width, height); drawObjects(objects_, img, width, height); if(objects_.size() >= 2) { for(int i=0; i<4; i++) { xs[i] = objects_[0].points[i].x; ys[i] = objects_[0].points[i].y; xs[i+4] = objects_[1].points[i].x; ys[i+4] = objects_[1].points[i].y; } } else { for(int i=0; i<8; i++) { xs[i] = 0; ys[i] = 0; } } }