Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Problem in Drawing Contour

$
0
0
Hi guys I have written a simple code which draws the contour. import numpy as np import cv2 img = cv2.imread('New Bitmap Image.bmp') gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret,thresh = cv2.threshold(gray,129,255,cv2.THRESH_BINARY) contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) print len(contours) cv2.drawContours(thresh,contours,-1,(0,255,0),3) cv2.imshow('thresh1',thresh) cv2.waitKey(0) cv2.destroyAllWindows() Instead of drwaing contour it gives a black screen . I dont know why this happens I am using python 2.7 with cv2 Input image is ![image description](/upfiles/14536103943426753.bmp)

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>