Tracking face with opencv

Hello im working for the first time with myrobotlab which seams to be a tool without limits.

as an beginner i have some problems to understnad the working of some code to modifie it right

im working with the code all works great.

my goal would be now to remove the camera and replaxce it with a spot light and still track the person and point on it. how can i get this done with the tracking runtime or a special code it seams that i need the coordinates form the opencsv frame and get it to the pid and servo but im a bit lost on this.


is there an example which does something like this?


thank you

GroG's picture

Hello Jay and welcome, The

Hello Jay and welcome,

The camera is the sensor for tracking, so you can not completely replace it with a spotlight.  If you did where would the sensor be?

Tracking is usually done on a pan / tilt setup - commonly wit h2 servos like this

You could add a laser pointer or spot light (just needs more hot-glue !) :)
but you can not get rid of the camera - if you want to track with opencv

Jay's picture

Sorry my bad writing  I don't

Sorry my bad writing 

I don't want to replace the camera my idea was to place the camera on the base of the setups I it's stationary the laser or light would be moved to a coordinate from the camera view 

at the moment it will try to get the tracked object in center on my setup it will position the servos on an specific value



thanks and regards 

Alessandruino's picture

So you want to put the camera

So you want to put the camera on a fixed flat surface (let's say under the spot light, on the base), the light should be motorized and should move according to the movment of the tracked object...correct?

The problem is :

- The camera will not follow the object movment so if the object is out of the camera field of vision you'll lose the object tracking point

Jay's picture

I'm aware of this problem if

I'm aware of this problem

if no tracking can be made I should go in the rest position 

can the position coordinates from the frame bed used to map them on servo coordinates ?

Alessandruino's picture

Of course... You want to do

Of course... You want to do face tracking or lktracking (point tracking) ?

Face tracking recognize only faces but it's able to recovery tracking after a face get lost... the downside is the face should be not too far

LkTracking : once the tracking point get lost , you need to click again on the object you want to track to set a new point