Dies ist eine alte Version des Dokuments!
Fortsetzung des Codes vom letzten Mal
im = cv2.imread('hund_mittel_kl.jpg') imgray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY) ret,thresh = cv2.threshold(imgray,median,255,0) # 0=flag, 255=weißester Wert 127= Schwellenwert contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) for cont in contours: print cont. shape cv2.imshow("Thresh",thresh)