Using File Cameras

Starting from EnsensoSDK 2.1, NxView and the NxLib API support file cameras. A file camera simulates a hardware camera from saved images and a corresponding calibration file and can be opened just like a hardware camera.

Note

Only signed images can be used in a file camera without requiring an additional license. Unsigned images cannot be displayed in NxView. Images are signed if they are from a hardware camera and got saved as explained below.

Note

Make sure to choose a unique serial number for your file camera which does not collide with any attached hardware camera.

Note

File cameras currently only work with png and tiff image formats.

Using File Cameras in NxView

Saving Image Data

There are two ways to save the data for a file camera from NxView:

  1. Via save dialog

    • Create a zip file via FileSave...Raw Images / Raw Images As... containing a single image set.

    • Capture and save again to add another image set to the same zip file.

  2. Via record dialog

    • Save a sequence of image sets via CaptureRecord or the recording button to a folder.

    • Record again and further image sequences are saved to the same folder.

    • Check the Subfolder checkbox in the Sequence Setup box to create a new subfolder for each sequence.

    • Check the Subfolder checkbox in the camera tabs to create a subfolder for each camera in the sequence subfolder.

    • Note that images with the Buffer in RAM option enabled will not be signed.

Creating a File Camera

../_images/nxview_create_file_camera.png

After you saved the necessary data sets into a folder or zip file you can open NxView and click Create...File Camera.

In the following dialog you can select either the folder or zip file with your data sets and enter a serial number for the file camera. After clicking OK the camera will be created and is now available in your camera list.

You can also drag and drop the folder or zip file direcly onto the camera list to automatically open it as a file camera.

Note

A file camera that has been opened via drag and drop is not permanently added to the camera list.

Using File Cameras With the API

You can also create and use file cameras in your application.

Saving Image Data

To save the data for a file camera via the API create a folder and save one or more image sets to it. Each image set must consist of the following files:

  • The camera calibration file: must end in _calib.json and contains a copy of the whole camera node as JSON.

  • The image files: end in _left.png and _right.png for the left and right images respectively. Flex View images additionally contain a two-digit index before this ending (e.g. _00_left.png and _15_right.png). Use the SaveImage command to save the camera’s raw images to these files.

Use the SaveImage command to save camera images from your application, otherwise the images will not be signed.

The image sets within a folder will be sorted alphabetically by their file names. You can include the image timestamp in the filename to sort them by their capture time.

Creating a File Camera

To create a file camera from existing data, you can use the CreateCamera command. Use DeleteCamera to remove it again.

There are a few things to note when working with file cameras: