You can match the perspective with Blam add-on
-----------

I don't think you can get them both (sensor size and focal lenght) at one time.

This [add-on][1] you can freely download is able to match the camera look starting from a bunch of grease pencil layers. If your photo has 3 vanishing points as the one below, you should provide 3 different layers.

[![enter image description here][2]][2]

After that you can start the camera calibration with the button on the left and you'll get the focal lenght value automatically applied to the active camera.

[![enter image description here][3]][3]

You can see from this quick modeling that the geometry is following the correct perspective deformation.

[![enter image description here][4]][4]

And even the lenght of the edges result more or less the same as you expect from a cube.

[![enter image description here][5]][5]

Now it cames the hardest part, as there is [no uniform relation][6] between the focal length of a lens and the angle of view, since the size of the camera sensor also determines angle of view.

So in order to get the right value showed in the exif data of the camera's focal lenght you must at least know the size of it's sensor.

Here's the scene after feeding the fields with the [camera's real sensor][7] size and focal lenght: the camera has to be slightely moved away from the subject to match the prevous result.

[![enter image description here][8]][8]


*Sorry, the properties panel is in my own language, anyway it's saying:*

 - Camera Model NIKON D32000
 - Focal lenght = 38mm
 - Focal lenght 35mm = 57mm
 - ....

*Image credits to [Miguel Á. Padriñán][9], you can downlod it [here][10].*


  [1]: https://github.com/stuffmatic/blam
  [2]: https://i.sstatic.net/XxUl6.jpg
  [3]: https://i.sstatic.net/rhpZe.png
  [4]: https://i.sstatic.net/UXqi4.gif
  [5]: https://i.sstatic.net/ZATGT.png
  [6]: https://en.wikipedia.org/wiki/35_mm_equivalent_focal_length
  [7]: https://www.google.it/search?q=nikon%20d3200&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=JSAvV6jMLsGH8QfzhIfIDQ#q=nikon%20d3200%20sensor%20size
  [8]: https://i.sstatic.net/yepXL.png
  [9]: https://www.pexels.com/u/padrinan/
  [10]: https://www.pexels.com/photo/mathematics-colorful-game-color-19677/