title: Calculate the normal equation for a checkerboard found through pose estimation
body: <p>I am working on a laserscanning project. For this, I am following this <a href="https://ieeexplore.ieee.org/document/6402621" rel="nofollow noreferrer">paper</a> for calibration purposes. I am currently stuck, where the authors calculate the plane parameters of the checkerboard used to calibrate the camera (and in the following the laser plane).</p>
  <p>To generate test data, I used Blender, providing the camera data (focal length, pixel size, etc.) based on the <a href="https://www.raspberrypi.com/products/camera-module-v2/" rel="nofollow noreferrer">raspberry pi V2</a>. <a href="https://i.stack.imgur.com/4cGjs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4cGjs.jpg" alt="image of a checkerboard" /></a>
  After calculating/finding the <a href="https://en.wikipedia.org/wiki/Camera_matrix" rel="nofollow noreferrer">intrinsic camera matrix</a> with OpenCv (Python 3)</p>
  <pre><code>cv.findChessboardCorners()
  
  cv.cornerSubPix()
  </code></pre>
  <p>following this <a href="https://docs.opencv.org/3.4/d4/d94/tutorial_camera_calibration.html" rel="nofollow noreferrer">tutorial</a> by opencv.org, I am using the</p>
  <pre><code>cv.solvePnP()
  </code></pre>
  <p>function to get the rotational and translational vector of the planes. With the following code, I am calculating now the normal and the signed distance from the camera center following the authors formula:</p>
  <pre><code>normalvector = rotationmatrix * [[0][0][1]]
  distance = (normalvector * -1)T * translational vector
  </code></pre>
  <p>(T = vector got transposed)</p>
  <pre><code>import numpy as np
  import cv2 as cv
  
  with np.load(&quot;vectorsRT.npz&quot;, &quot;r&quot;) as file:
      rvecs, tvecs = [file[i] for i in (&quot;rotationVectors&quot;, &quot;translationVectors&quot;)]
  
  rot_matrix = cv.Rodrigues(rvecs)[0]
  mult_matrix = np.array([[0],[0],[1]])
  
  normal_vector = np.matmul(rot_matrix, mult_matrix)
  normal_vector_neg = normal_vector * -1
  normal_vector_neg_transposed = np.transpose(normal_vector_neg)
  
  signed_distance = np.matmul(normal_vector_neg_transposed, tvecs)
  
  print(&quot;normal_vector:&quot;, normal_vector)    
  print(&quot;signed_distance:&quot;, signed_distance)
  </code></pre>
  <p>With this, I am getting now a normal vector and a distance from the camera center, eg.:
  normal_vector:</p>
  <pre><code>[[-0.0604253 ]
   [ 0.16923283]
   [ 0.98372203]]
  </code></pre>
  <p>signed_distance:</p>
  <pre><code>[[[-51.67514398]]]
  </code></pre>
  <p>from blender I am getting the following normal</p>
  <pre><code>[[-0.00117647]
   [-0.00333335]
   [-0.01939508]]
  </code></pre>
  <p>The normals are more or less equivalent, however, how is the signed distance now converted to a support vector of plane in the world coordinate system, so I can get the full plane equation?</p>