Independing of which programming language you are using you have to reference the Raytrix Light Field API in your project.
To start working with the Raytrix Light Field API, you have to include the Raytrix API header or reference the Raytrix API assembly.
The namespaces allow you to use all API related code without wriing the whole namespace each time. After the API header is included you must start with initializing the Raytrix Light Field API.
This function has to be called before any other API function, with the exception of
If you do not specify any paramters the CUDA device is initialzed implicitly. All the computational functions are implemented on the CUDA device.
If several CUDA devices are present, you have the possibility to select the CUDA device width the highest graphical processing power. In the most cases it is sufficient to use the function without any parameter settings, which will select the first device that has enough computational power.
The Raytrix Light Field SDK allows you to work with three different image sources (Programming with the Raytrix Light Field API). In this example we will demonstrate the usage of a ray image source.
The ray image that is bound is a raw Light Field image. Before this ray image can be used by the actual image processing algorithms, it has to be preprocessed.
The number of preprocessing tasks that are performed depends on the correspondin API parameters. You can activate or deativate:
Each preprocessing task can be adjusted by further API paramters:
After the preprocesing step is executed the image Rx::ApiLF::EImg::Processed_Normalized is created on the CUDA device and further image processing is possible.
The Raytrix Light Field API offers a lot of image processing algorithms that are implemented on the CUDA device. Each processing function creates an image on the device. The image that is created can depend on the parameter Rx::ApiLF::EPar::Proj_CurrentTargetView that can be set to one of the values in Rx::Projection::ESpace. The following image and the corresponding table illustrate the relation between the computational functions and the created images:
Function | Requirement | Rx::ApiLF::EImg |
---|---|---|
Rx::ApiLF::RxRefocusBasic | Rx::ApiLF::EImg::RefocusBasic_VirtualSpace | |
Rx::ApiLF::RxTotalFocus | Rx::Projection::ESpace::VirtualSpace | Rx::ApiLF::EImg::TotalFocus_VirtualSpace |
Rx::ApiLF::RxTotalFocus | Rx::Projection::ESpace::ViewCamera | Rx::ApiLF::EImg::TotalFocus_ViewCamera |
Rx::ApiLF::RxStereo | Rx::ApiLF::EImg::Stereo_ViewCamera | |
Rx::ApiLF::RxDepthRay | Rx::ApiLF::EImg::DepthRay | |
Rx::ApiLF::RxDepthMap | Rx::Projection::ESpace::VirtualSpace | Rx::ApiLF::DepthMap_VirtualSpace |
Rx::ApiLF::RxDepthMap | Rx::Projection::ESpace::ViewCamera | Rx::ApiLF::DepthMap_ViewCamera |
Rx::ApiLF::RxDepth3D | Rx::ApiLF::EImg::DepthMap_ViewCamera must exist | Rx::ApiLF::Depth3D |
Rx::ApiLF::RxDepthColorCode | Rx::Projection::ESpace::VirtualSpace | Rx::ApiLF::DepthMapColored_VirtualSpace |
Rx::ApiLF::RxDepthColorCode | Rx::Projection::ESpace::ViewCamera | Rx::ApiLF::DepthMapColored_ViewCamera |
Further computational functions are:
Every processing function can be adjusted with a wide range of parameters Light Field Parameter .
The following simple example demonstrates how you can refocus your image in the middle of the near and far plane.
The last section of this page will show you how to finalize the Raytrix Light Field API
After you have finished your work with the Raytrix Light Field API you want to make sure that all memory is freed on host and on CUDA device. Furthermore you want to close all cameras properly:
Independent of the programming language you are using you have to reference the Raytrix Light Field API in your project.
To start working with the Raytrix Light Field API, you have to include the Raytrix API header or reference the Raytrix API assembly.
The namespaces allow you to use all API related code without writing the whole namespace each time. After the API header is included you must start with initializing the Raytrix Light Field API.
This function has to be called before any other API function, with the exception of
If you do not specify any parameters the CUDA device is initialized implicitly. All the computational functions are implemented on the CUDA device.
If several CUDA devices are present, you have the possibility to select the CUDA device width the highest graphical processing power. In the most cases it is sufficient to use the function without any parameter settings, which will select the first device that has enough computational power.
The Raytrix Light Field SDK allows you to work with three different image sources (Programming with the Raytrix Light Field API). In this example we will demonstrate the usage of a ray image source.
The ray image that is bound is a raw Light Field image. Before this ray image can be used by the actual image processing algorithms, it has to be preprocessed.
The number of preprocessing tasks that are performed depends on the corresponding API parameters. You can activate or deactivate:
Each preprocessing task can be adjusted by further API paramters:
After the preprocessing step is executed the image Rx::ApiLF::EImg::Processed_Normalized is created on the CUDA device and further image processing is possible.
The Raytrix Light Field API offers a lot of image processing algorithms that are implemented on the CUDA device. Each processing function creates an image on the device. The image that is created can depend on the parameter Rx::ApiLF::EPar::Proj_CurrentTargetView that can be set to one of the values in Rx::Projection::ESpace. The following image and the corresponding table illustrate the relation between the computational functions and the created images:
Further computational functions are:
Every processing function can be adjusted with a wide range of parameters Light Field Parameter .
The following simple example demonstrates how you can refocus your image in the middle of the near and far plane.
The last section of this page will show you how to finalize the Raytrix Light Field API
After you have finished your work with the Raytrix Light Field API you want to make sure that all memory is freed on host and on CUDA device. Furthermore you want to close all cameras properly: