From 1fdf3b47e08dde4fbc157c3c6195842c7aee202c Mon Sep 17 00:00:00 2001 From: avana Date: Wed, 22 Feb 2017 22:20:27 +0100 Subject: [PATCH] magie di python per trovare i bordi --- edge_finder.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 edge_finder.py diff --git a/edge_finder.py b/edge_finder.py new file mode 100755 index 0000000..cc45d99 --- /dev/null +++ b/edge_finder.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python2 + +import numpy as np +import sys +import cv2 +def show(img): +#cv2.namedWindow("immagine",cv2.WINDOW_AUTOSIZE) + cv2.imshow("immagine",img) + cv2.waitKey(0) + +def contourIndex(lista): +# ritorna l'indice del contorno con perimetro maggiore + val=-1 + index=0 + for num, cont in enumerate(lista): + value=cv2.arcLength(cont,True) + if val