1

Having an image pixels and a straight line selected on it (from pixel [x_1, y_1] to pixel [x_2, y_2]), how to get Focal length in OpenCV (Python or C++; 2.4 or 3.x)?

DuckQueen
  • 772
  • 10
  • 62
  • 134
  • You can get the focal length (in pixel) from camera calibration. Maybe you read [here](http://stackoverflow.com/questions/16329867/why-does-the-focal-length-in-the-camera-intrinsics-matrix-have-two-dimensions) for further explanation – PSchn Oct 01 '16 at 14:08

1 Answers1

0

If you are need the

focal length   

of camera,I think you should make calibration and you will get a the

camera matrix 

which contains the focal length.

here is a good documentation to camera calibration

http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html