3
votes

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?

enter image description here

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?

2
i don't think Opencv has support for 3d line drawing. - Sebastian Schmitz
@SebastianSchmitz Opencv has released docs.opencv.org/modules/viz/doc/viz3d.html a 3D visualization tool. I think drawing lines are possible, but I dont know how to do with the inputs I have. - 2vision2
intersting, thank you! have you seen the tutorial? docs.opencv.org/trunk/doc/tutorials/viz/table_of_content_viz/… also here is some code: sysmagazine.com/posts/217021 - Sebastian Schmitz

2 Answers

4
votes

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.