# Disperancy in tvec outut for SolvePnP

**URL:** <https://forum.opencv.org/t/disperancy-in-tvec-outut-for-solvepnp/6733>\
**Category:** Uncategorized\
**Created:** [December 14, 2021, 1:59pm UTC](https://forum.opencv.org/t/disperancy-in-tvec-outut-for-solvepnp/6733 "2021-12-14T13:59:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kvnayak24](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/kvnayak24/32/3389_2.png) [@kvnayak24](https://forum.opencv.org/u/kvnayak24)\
**Post date:** [December 14, 2021, 1:59pm UTC](https://forum.opencv.org/t/disperancy-in-tvec-outut-for-solvepnp/6733/1 "2021-12-14T13:59:15Z")

</div>

Hello,  
I have see some disperancy of output for SolvePnP. I am trying to get the tvec for a person face and for the same I have following model points  
**model\_points\_ref** = np.array([  
[-0.085, -0.02827123, -0.0114384], #–left ear  
[0.085, -0.02827123, -0.0114384] , #–right ear  
[0. , 0. , 0.] , #–\> nose tip  
[0. , 0.08105961, -0.0325195] , #-- chin  
[-0.05 , -0.0452415 , -0.06] , #-- left eye  
[0.05 , -0.0452415 , -0.06] , #-- right eye  
[-0.02847002 , 0.03331642 ,-0.03667993] , # – left mouth  
[0.02847002 , 0.03331642, -0.03667993], # – right mouth  
[-0.06, 0.02708319, -0.08046731], # – left cheek 3  
[0.06, 0.02708319, -0.08046731], # – right cheek 13  
[-0.0383922, 0.06962711, -0.06106274], # – left jaw 6  
[0.0383922, 0.06962711, -0.06106274]] # – right jaw 10  
,dtype=np.float)

and when I give the following image points  
**image\_points1** = np.array([[2101.97265625 , 663.4720459],  
[2244.44726562 , 668.21960449],  
[2177.18896484 , 695.39916992],  
[2173.36547852 , 773.05883789],  
[2133.6315918 , 658.98901367],  
[2218.63525391 , 661.92834473],  
[2149.75976562 , 727.35113525],  
[2198.9987793 , 729.03833008],  
[2110.0456543 , 717.19976807],  
[2234.53735352 , 721.50158691],  
[2136.87255859 , 759.55621338],  
[2208.68237305 , 762.03759766]])  
I get the correct tvec outout tvec1 = [[0.32085125],[-0.29647159],[2.44181232]] which matches with real world

Whereas when I give following image points  
**image\_points2** = np.array([[2101.55297852 , 661.02923584],  
[2244.66992188 , 666.83764648],  
[2173.77758789 ,696.86071777],  
[2169.9387207 , 774.43066406],  
[2131.70605469 , 658.55169678],  
[2216.97680664 ,662.11236572],  
[2146.8059082 , 728.20385742],  
[2195.95996094 , 730.30529785],  
[2108.74438477 , 715.61627197],  
[2233.9753418 , 720.90594482],  
[2134.17773438 , 759.9309082],  
[2206.14355469 , 762.98590088]])  
I get the **incorrect tvec** outout tvec2 = [[-0.05087151], [0.04258687],[0.0451012]]

If you look at both the image points there is not much difference in pixel location but the output in both cases are different. I do not provide any initial values of rvec, tvec to solvepnp.

Kindly suggest what could be a possible issue.
