Using File Cameras

<< Click to Display Table of Contents >>

Navigation:  HowTo's > Debugging and Simulation >

Using File Cameras

Starting from EnsensoSDK 2.1, NxView can simulate hardware cameras from saved images.

Saving image data

File cameras can read image sets from folders. A folder can contain any number of datasets saved from a hardware camera in NxView using:

NxView's Save Raw Images function

The recording dialog within NxView

Note: Instead of folders the data sets can also be contained in a single zip file.

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

Creating a File Camera

After you saved the necessary data sets into a folder you can open NxView and click the Create button:

NxView_CreateCamera

In the following dialog you can select the folder 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. If you saved the images to a zip file you can also drag the zip file onto the camera selection dialog to automatically open the file camera.

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

Using File Cameras in the NxLib

File cameras can be opened just like normal cameras in NxView and via the NxLib API. To create a file camera from existing data, you can use the CreateCamera command. Use DeleteCamera to remove it again.

There are a few specifics to note about their working principle:

Because the image acquisition is done by reading the raw image files you cannot choose any capture parameters. Most nodes under Parameters/Capture are not present or cannot be modified.

The nodes Parameters/ImageName, Parameters/ImageSet and Parameters/NumberOfImages give information about the file grabbed by the last Capture or Retrieve command.

The Capture and Trigger commands simply load the next image set from the folder instead of grabbing it from a hardware camera.

Trigger loads the image data from disk, whereas Retrieve delivers the loaded images into the internal camera objects and the NxLib tree.

The parameter ImageSet for the Capture and Trigger commands can be used to load a specific data set.

 

Saving Image Files

You can also create file cameras from your application. Save all files to a single folder. Each image set consists of (usually) three files with the same base name.

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

oThe image files end in _left.png and _right.png. 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.

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.