Search code examples
imagematlabcamera-calibrationcalibration

How to import images using command line in 'cameraCalibrator' app?


I would like to import images (from a directory or a MATLAB variable) into 'cameraCalibrator' app using command-line.

I found the below syntax:

cameraCalibrator(imageFolder,squareSize) 

Here is how I tried to use it:

cameraCalibrator(desktop,3*mm);

But it is yielding some error. How to apply this syntax?


Solution

  • The two input arguments must be given as follows:

    1. I suggest creating a separate dedicated directory for your image files. e.g; if your image files are in a directory named images on Desktop then give its complete path like this:

      imageFolder = 'C:/Users/<yourusername>/Desktop/images';        %For WinOS
      

      You can just write name of the directory as well if Desktop is your current working directory i.e.

      imageFolder = 'images';  
      
    2. squareSize is, by design, to be given in mm. So mm must not be explicitly specified. For your case, it will be:

      squareSize = 3;
      

      Now run it with:

      cameraCalibrator(imageFolder, squareSize) 
      

    Note that you can also just enter cameraCalibrator which lets you choose the images and square size in GUI.

    select_images

    After selecting images, the following window appears which also lets you to choose the square size in different units:

    square size