FACE TRACKING USING :OPENCV, FACE DETECT FILTER, AN ARDUINO WITH A PAN TILT KIT

Services: 

Hardware: 

Pan Tilt Kit

Face tracking using opencv + facedetect filter with my pan/tilt kit...

Facedetect filter is heavy, and webcam video flow delay from servos response...this leads to overshooting

GROG..i need a lighter facedetect filter.....video stream is  slow when i apply pirdown and face detect :(

Here is the video...

CHECK IT OUT !


#file : home/Alessandruino/Tracking.faceDetection.py edit raw
# a minimal tracking script - this will start all peer
# services and attach everything appropriately
# change parameters depending on your pan tilt, pins and
# Arduino details
# all commented code is not necessary but allows custom
# options

port = "COM15"
xServoPin = 13
yServoPin = 12

tracker = Runtime.createAndStart("tracker", "Tracking")

# set specifics on each Servo
servoX = tracker.getX()
servoX.setPin(xServoPin)
servoX.setMinMax(30, 150)

servoY = tracker.getY()
servoY.setPin(yServoPin)
servoY.setMinMax(30, 150)

# changing Pid values change the 
# speed and "jumpyness" of the Servos
xpid = tracker.getXPID()
ypid = tracker.getYPID()

# these are default setting
# adjust to make more smooth
# or faster
# xpid.setPID(5.0, 5.0, 0.1)
# ypid.setPID(5.0, 5.0, 0.1)

# optional filter settings
opencv = tracker.getOpenCV()

# setting camera index to 1 default is 0
opencv.setCameraIndex(1) 

# connect to the Arduino
tracker.connect(port)

# Gray & PyramidDown make face tracking
# faster - if you dont like these filters - you
# may remove them before you select a tracking type with
# the following command
# tracker.clearPreFilters()

# simple face detection and tracking
tracker.faceDetect()

# scans for faces - tracks if found
# tracker.findFace()

ambroise's picture

thank you for this tuto i

thank you for this tuto i just need one

very nice ales

 

DB_Inmoov's picture

Some help

Anyway to explain step by step how you apply this? I tried this but I don't know how to put the code, or make the servo interact with the faceDetect filter.