Skip to content
echanaron edited this page Jan 24, 2015 · 6 revisions

Aperture of the camera

First the camera aperture have to be computed. To do so, the top actuator (the head actuator) and the camera have to be mount. Then choose a point in the camera field of view. Display the camera image on your computer screen and then use the command line interface or graphical one provided in this project do the following step.

  • Move the head motor to put the chosen point at the right of the camera field of view.
  • Save the current value of the head motor.
  • Move the head motor to put the chosen point at the left of the camera field of view.
  • Save the current value of the head motor.
  • Compute the horizontal aperture of the camera by substracting the two value.
  • Repeat previous operation for vertical aperture.

With this method for the C525 Logitech, about 50 degrees have been obtained for the horizontal aperture and 30 degrees for the vertical aperture.

Centering the head

To put the head in the center of the camera field of view, the method is basic. The face detection returns a circle. From the circle center the horizontal and vertical distances to the center of the image can be computed. Then the angle between the center of the face and the center of the field of view have to be computed. To do so, a simple cross-multiplication is used. For instance to compute the horizontal angle knowing the distance between the face and the image center, we know that the width of the image corresponds to the horizontal aperture.

Horizontal Angle = Horizontal Aperture * Distance / Width

The same method can be used for the vertical angle. Then to center the face, the top and head actuators have to been moved from the two previous computed angles.

back to implementation

Clone this wiki locally