Created
August 10, 2018 01:50
-
-
Save lachlanagnew/264e1c3a31141efa374717c03bad5c25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newImage = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) | |
_ , contours, _ = cv2.findContours(res, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) | |
cv2.drawContours(newImage, contours, -1, (255, 255, 0), 1) | |
for cnt in contours: | |
M = cv2.moments(cnt) | |
(x,y),radius = cv2.minEnclosingCircle(cnt) | |
if(radius > 10): | |
center = (int(x),int(y)) | |
radius = int(radius) | |
cv2.circle(newImage,center,radius,(0,255,0),2) | |
objectFound() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment