Blender Cam



Blender CAM is an open source solution for artistic CAM - Computer aided machining needs. Blender CAM is an extension for the free open-source Blender 3d package. It has already been used for some milling projects, and is actively developed. If you are a developer who would like to help, don't hesistate to contact me. Blender cnc cam Python GPL-2.0 65 3 0 0 Updated Apr 8, 2021. VTKBlender Forked from cwant/VTKBlender A script to allow Blender and VTK to work together more easily Python Apache-2.0 15 0 0 0 Updated Nov 23, 2019. Opencamlib Forked from aewallin/opencamlib open source computer aided manufacturing algorithms library.

In case you want to employ Blender for Computer Vision like e.g. for generating synthetic data, you will need to map the parameters of a calibrated camera to Blender as well as mapping the blender camera parameters to the ones of a calibrated camera.

Camera

Calibrated cameras typically base around the pinhole camera model which at its core is the camera matrix and the image size in pixels:

K = begin{bmatrix}f_x & 0 & c_x 0 & f_y& c_y 0 & 0 & 1 end{bmatrix}, (w, h)

But if we look at the Blender Camera, we find lots non-standard and duplicate parameters with random or without any units, like

  • unitless shift_x
  • duplicate angle, angle_x, angle_y, lens
Blender CamBlender camera clipping

Doing someresearch on their meaning and fixing various bugs in the proposed conversion formula, I could however come up with the following python code to do the conversion from blender to OpenCV

Blender camera clippingCam

Blender Camp

So to summarize the above code

Blender Camera App

  • Note that f_x/ f_y encodes the pixel aspect ratio and not the image aspect ratio w/ h.
  • Blender enforces identical sensor and image aspect ratio. Therefore we do not have to consider it explicitly. Non square pixels are instead handled via pixel_aspect_x/ pixel_aspect_y.
  • We left out the skew factor s (non rectangular pixels) because neither OpenCV nor Blender support it.
  • Blender allows us to scale the output, resulting in a different resolution, but this can be easily handled post-projection. So we explicitly do not handle that.
  • Blender has the peculiarity of converting the focal length to either horizontal or vertical field of view (sensor_fit). Going the vertical branch is left as an exercise to the reader.

Blender Camera Clipping

The reverse transform can now be derived trivially as