Calibration for wide lens (prime lens 16mm for example)

 

Hi everyone,

Was wondering if anyone experienced the slight drift with wide lens after calibrating? I've calibrated my 16mm lens, and the focal length result after calibration is nearly the same as my physical lens (about 16.2 something), but I noticed some slight drifting. Some of my colleagues also experienced this issue, so I wonder if there is something wrong with my calibration method (I use OpenCV lens calibration), or is there something that should be noticed when calibrating wide lens?

Thanks.

   LumiGrade

 
Profile Image
Ahmed@Aximmetry
  -  

Hello,

If you want a calibration for a fixed zoom position you can use Vanishing Point's Calibrate X software.

It writes the result into a JSON file. We have a helper compound called Lens_Distort_Vanishing that can read it up.
Wire it as follows:

Specify the generated JSON file for this module.

Then put your INPUT in Manual Lens mode.

    

 
Profile Image
EricWest
  -  

Could those Lens Distortion Pins be made available for 'regular' virtual cams as well, please?
I don't see why we would only have them for tracked cams... ?

Cheers.

Eric.


 
Profile Image
Ahmed@Aximmetry
  -  

Hello Eric,

well Virtual Cameras are distortion-free. There is nothing to correct in a virtual world.

You can still use the lens distorter module though, in case you need it.


Best regards,

 
Profile Image
EricWest
  -  

Hi Ahmed.

Well...errr... yea-but-no-but-yeah....:-)
While the virtual 3D camera does not have any distortion,
the incoming video used for the Billboard certainly *can* have distortion (since it's generated by a real world camera & lens).

Having the same undistort option for those billboards as we have for the tracked cams would be quite convenient.

Cheers & all the best.

Eric.

 
Profile Image
Ahmed@Aximmetry
  -  

Hello,

You can do that by going inside the Virtual Cam compound and adding a Lens Distorter Module to the video outputs of your inputs.

Turn On Undistort and set your settings to the desired values:

Best regards,

 
Profile Image
EricWest
  -  

Hi Ahmed.

Thanks for the hint!
In fact that's almost exactly what I did.
I just piped the LensDistorter in *after* the ChromaKey compound, so that the image remains unaltered for best keying results,
rather than having sub-pixel rendering applied before the keying process... :-)

Cheers & all the best.

Eric.



 
Profile Image
S-Virtual
  -  

Hi Eric,

Is there any documents regarding the specs in the Lens Distorter module? If so, could you provide me some info on it?

Thanks

 
Profile Image
Eifert@Aximmetry
  -  

Hi S-Virtual,

Which specs are you interested in?
If you can also tell the intended use, we can probably provide a better explanation of the specs.

Warmest regards,

 
Profile Image
S-Virtual
  -  

I'm interested in all of the specs of the module, as I'm still new to this and might need a deeper explanation on these. I'm trying to figure how to adapt the module to the tracked cam as well as virtual cam, for my own experiment and testing. If possible, could you please send me a summary of all the specs in the module and what information they require to my email huynguyen@svirtual.com, I'd be really appreciated.

Thank you.

 
Profile Image
Ahmed@Aximmetry
  -  

Hello,


The Lens Distorter module can work in two ways: you can either connect the "Camera Tracking" pin, or the "Sensor Width", "Aspect", "Center Shift", and "Radial Distortion" pins.

In case Undistort is OFF (because we are turning an undistorted image into a distorted one):

if the "Camera Tracking" pin is connected, then the data from that one will be used, and the other four pins will be ignored.

Alternatively, the individual parameters can be specified using the "Sensor Width", "Aspect", "Center Shift", and "Radial Distortion" pins.

in that case:

- Aspect contains the aspect ratio of the image

- Sensor Width:  It usually can be found in the technical specification of the device (please specify it in millimeters) ,and note that the effective sensor width should be used ( if the camera transforms a cropped image, the width of the cropped sensor should be used).

- Radial Distortion contains the radial distortion coefficients: the first element is k1, specified in mm^(-2), and the second element is k2, specified in mm^(-4).

- Center Shift: move away from the center of the image circle. You can do so both on the X and Y axis.


- Filter: this contains the sampling method.

- Guard Band and Guarded size:

Increases the output size by adding an extra band to each side while maintaining the Zoom Factor of the original inner region.

Primarily used in conjunction with a Lens Distortion module to avoid clipping of the edges of the picture. Also can be used to remove artifacts of certain post-processing effects at the edges. and if you did that on the Camera module, you should set Guard Band on the Lens Distorter to ON, and Guarded Size to the actual size of the image (excluding the bands).

After the Lens Distortion or other post-processing module, you have to use a Cropper module with its Guard Band property switched ON to regain the original picture size.

An example of how you combine the mentioned modules:


In case Undistort is ON:

in theory, the module can also be used to turn a distorted image into an undistorted one. In that case, you would send the camera image straight into the Lens Distorter and set Undistort to ON. Since the camera doesn't do any "guard bands" itself, you'd have to manually crop out the middle of the resulting image yourself if you end up with any missing parts at the side of the image. Also, the undistort does worsen the image quality a little bit. So, we do not recommend using the module this way.

Best regards,