active live face tracking box coordinates

1 次查看(过去 30 天)
so, i'm trying to modify the FaceTrackingWebcamExample file to create a face tracker that runs on a gimbal and when i move my face from the center of the frame, the gimbal tries to compensate and change where the camera is looking. i'm using an EV3 as my gimbal. i'm fairly new to matlab so i don't really know too much about all this. i just want to get the tracker to follow my face as i walk around the room. i have 2 cameras set up so i can monitor through both cameras at the same time to let the computer determine distance but that comes later. any ideas on what i can do to find the coordinates of the box and adjust the gimbal to recenter?

回答(1 个)

NISARGA G K
NISARGA G K 2018-6-14
I understand that you would like to find the coordinates of the box around the face detected and adjust the gimbal to recenter.
As discussed in FaceTrackingWebcamExample, in detection mode position the gimbal using 'bboxPoints' as initial reference coordinates and during tracking mode 'bboxPoints' (after tranformation to bounding box) can be used to recenter the gimbal. Here bboxpoints refers to coordinates of the box around the face detected and is of the form M-by-2 matrix of [x,y] i.e [x1,y1;x2,y2;x3,y3;x4,y4]
midX = (x1 + x3) / 2;
midY = (y1 + y3) / 2;
Gives the center of the box which can used to rotate the gimbal.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by