I have a code for head pose which returns Yaw, Pitch and Roll in terms of angle. I need to test this code whether it works fine or not.
1) With these three angles as input how can I draw a 3D line using opencv as below. IF so can some one provide a code snippet to draw a 3D line like this in my camera window?

2) Also I need to test the accuracy of my pose code. Is there any datasets available to test the pose code, if so can some one provide the links? Or is there any other ways to test the head poses' accuracy?
Check out PRIMA head pose estimation database. It is freely available. PRIMA Head Pose Estimation Database consists of 2790 face images of 15 people with variation of yaw and pitch from -90 to +90 degrees. People in the dataset wear glasses or not and have various skin color. Background is neutral and face has a visible contrast from the background. Although the resolution of images is quite small - 384 x 288.
In case of PRIMA, each image is labeled with yaw and pitch angles, but no roll. You can read those two values by parsing image file name, e.g. personne01157+15-30.jpg has a face oriented in such way that pitch = +15 degress, yaw = -30 degrees. Here you have an example how to parse database file names (although is old OpenCV API, you can use just the part which extracts and parses file names).
I have used this database for research purposes in my master thesis, you only have to cite their paper in your work if you would like to do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With