3/26/2023 0 Comments Arduino camera tracker![]() ![]() I have used the center coordinates of the face for reference and can be calculated using x+width/2 and y+height/2 and can be seen as a green dot. The coordinates describe the top-left pixel values(x and y) along with the height and width. By default, the video resolution is set to 640*480. OpenCV returns the face coordinates in terms of pixel values. In-order to have a precise facial recognition, a plain background would be recommended as I faced some false detection due to the curtains in the background. Increasing the 'minNeighbour' can improve facial detection but sacrifices in execution speeds which would lead to a delayed response from the servo. This returns the cartesian coordinates of the image along with the height and width. The function used for face detection is () with the 'scale factor' value as 1.1(default) and 'minNeighbour' value as 6. ![]() Upon downloading, the xml file can be loaded using cv2.CascadeClassifier('haarcascade_frontalface_default.xml') ![]() I have used ' haarcascade_frontalface_default.xml' which is a pre- trained model for detecting human faces and can be downloaded from Git-Hub( here ). When the co-ordinates of the face is away from the center, then the servo will align by 2 degrees(increment or decrement)to bring it towards the center of the screen. The servo's connected to the Arduino provides a pan/tilt mechanism where the camera is connected to one of the servo. These coordinates are passed to the Arduino UNO using the pyserial library when the face is detected. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |