Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Object Tracking with SimpleCV (White Ball) - Minimized Version
from SimpleCV import *
cam = Camera()
while True:
img = cam.getImage().flipHorizontal()
dist = img.colorDistance(Color.BLACK).dilate(2)
segmented = dist.stretch(200,255)
blobs = segmented.findBlobs()
if blobs:
circles = blobs.filter([b.isCircle(0.2) for b in blobs])
if circles:
img.drawCircle((circles[-1].x, circles[-1].y), circles[-1].radius(),Color.BLUE,3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.