Raytrix Light Field SDK  5.0
Rx::LFR::Net::CudaCompute Class Reference

Detailed Description

Provides methods for using a CUDA device as the computation unit of the LFR.

Inherits Rx::Net::NativeInterfaceWrapper< Rx::LFR::CCudaCompute, Rx::LFR::Net::Interfaces::ECudaCompute >.

Public Member Functions

 CudaCompute ()
 Default constructor. More...
 
 CudaCompute (Rx::LFR::CCudaCompute &xNative)
 Constructor that wraps the given native instance. Disposing does NOT destroy the native instance. More...
 
 ~CudaCompute ()
 Destructor. More...
 
void ApplyCalibration (Calibration^ xCalib, bool bUploadGrayImg)
 Applies the given calibration to the algorithms. This must be done every time the calibration changes. More...
 
void ApplyRayImage (Rx::LFR::Net::RayImage^ xRayImage)
 Applies the given ray image. More...
 
bool Compute_Depth3D (ESpace eSourceSpace, ESpace eTargetSpace)
 Calculates the depth 3D image. More...
 
bool Compute_DepthColorCode (ESpace eSpace)
 Calculates the colored depth map image. More...
 
bool Compute_DepthMap (ESpace eSpace)
 Calculates the depth map image. This image can be filled to produce a complete filled depth map. More...
 
bool Compute_DepthMapGlobal (ESpace eSourceSpace, ESpace eTargetSpace)
 Calculates the depth map image. This image can be filled to produce a complete filled depth map. More...
 
bool Compute_DepthRay ()
 Estimates the depth of the current raw image and creates the ray depth image. More...
 
bool Compute_DepthRayColored ()
 Calculates the colored depth ray image. More...
 
bool Compute_Grid ()
 Calculates the grid image. This is the raw or the gray image with an overlay that shows the current grid calibration. More...
 
bool Compute_GridDataImage ()
 Pre-Process a ray image with a minimal set of preprocessing parameters. More...
 
bool Compute_Histogram (EImage eImgID, RX_OUT array< unsigned >^ % xHistogram, RX_OUT unsigned % uChannels)
 Calculates the histogram of the image with the given image ID and stores the histogram data in the given array. This array must be large enough to hold 4 * 256 numbers. The number of calculated channels is returned in uChannels. More...
 
bool Compute_ImageMinMax (EImage eImgID, unsigned uChannel, RX_OUT float % fMin, RX_OUT float % fMax)
 Calculates the minimum and the maximum value in the given image. More...
 
bool Compute_MeshImage (ESpace eSpace)
 Calculates the point cloud image. More...
 
bool Compute_Multiview ()
 Calculates the multi view image. More...
 
bool Compute_PointCloudImage (ESpace eSpace)
 Calculates the point cloud image. More...
 
bool Compute_PreProcess ()
 Pre-Process a ray image. This can apply denoise, brightness and sharpness adjustments. More...
 
bool Compute_RefocusBasic ()
 Focus image to a plane perpendicular to the optical axis, i.e. parallel to the image plane. More...
 
bool Compute_TotalFocus (ESpace eSpace)
 Focus on a depth surface. More...
 
bool Compute_TotalFocusGlobal (ESpace eSourceSpace, ESpace eTargetSpace)
 Focus on a depth surface. More...
 
Rx::Net::ImageFormatCreateFocusImageFormat (Rx::Net::ImageFormat^ xRawFormat, bool bForceLandscape)
 Creates the image format of the refocus and the total focus image. This considers the Focus_ImageDivisor parameter. More...
 
void Download (EImage eImgID, Rx::Net::Image^ xImg)
 Downloads the image with the given image ID. More...
 
void DownloadPointCloud (ESpace eSpaceID, RX_OUT array< Rx::Net::ColorPoint3D >^ % axColorPoints)
 Downloads the point cloud. More...
 
void Free (EImage eImgID)
 Frees memory used by image defined by eImgID. This invalidates the image. More...
 
void FreeAll ()
 Frees the memory used by all images. This invalidates all images. More...
 
const void * GetCameraFormat ()
 Gets the pointer to the internal camera format. Only for internal purposes. More...
 
IParameters< Rx::LFR::Net::Params::ECudaCompute > ^ GetComputeParams ()
 Gets the parameters access interface. More...
 
CudaDeviceGetCudaDevice ()
 Gets the CUDA device that has been set by calling SetCudaDevice. Throws an exception if not set yet. More...
 
size_t GetDevicePointerPitch (EImage eImgID)
 Gets device pointer pitch, which is the width in bytes of the allocation. Given a row and column of an array element of type T, the address is computed as: More...
 
System::IntPtr GetImageDevicePointer (EImage eImgID)
 Gets the CUDA device pointer to the data of the image defined by the given ID. More...
 
Rx::Net::ImageFormatGetImageFormat (EImage eImgID)
 Gets the image format of the image defined by the given ID. More...
 
System::Object ^ GetInterface (Interfaces::ECudaCompute eInterface) override
 Gets the interface of the CUDA compute class determined by the Interfaces::CudaCompute enum. More...
 
virtual System::Object ^ GetInterface (Rx::LFR::Net::Interfaces::ECudaCompute eData)
 Gets the interface. More...
 
const void * GetProjectionSystem ()
 Gets the pointer to the internal projection system. Only for internal purposes. More...
 
void GetRawImagePointsFromVirtualMM_s (RX_OUT array< double >^ % adRawPoints, double dSrcX, double dSrcY, double dSrcZ, int iRadiusLU)
 Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses. More...
 
void GetRawImagePointsFromVirtualMM_s (RX_OUT array< double >^ % adRawPoints, double dSrcX, double dSrcY, double dSrcZ, int iRadiusLU, int iMinAllowedDistanceToLensBorderPX)
 Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses. More...
 
IParameters< Rx::LFR::Net::Params::EViewCudaCompute > ^ GetViewParams ()
 Gets the parameters access interface. More...
 
void GetVirtualMM_sFromRawImagePoint (RX_OUT double % dTrgX, RX_OUT double % dTrgY, RX_OUT double % dTrgZ, double dSrcX, double dSrcY, double dSrcZ)
 Projects from the given pixel position in the raw image with the given standard depth through the micro lenses into virtual space. More...
 
bool HasCudaDevice ()
 Queries if a CUDA device has been set. More...
 
bool IsDataValid (EImage eImage)
 Queries of the data for the given image is valid and up-to-date. More...
 
bool IsValid (EImage eImgID)
 Query if the image with the given image ID is valid. More...
 
void Project (RX_OUT array< double >^ % adTrgPoints, array< double >^ adSrcPoints, ESpace eTrgSpace, ESpace eSrcSpace)
 Projects an array of points from the given source space into the given target space. More...
 
void Project (RX_OUT array< double >^ % adTrgPoints, array< double >^ adSrcPoints, ESpace eTrgSpace, ESpace eSrcSpace, bool bTrgVD, bool bSrcVD)
 Projects an array of points from the given source space into the given target space. More...
 
void Project (RX_OUT array< double >^ % adTrgPoints, array< double >^ adSrcPoints, ESpace eTrgSpace, ESpace eSrcSpace, Rx::Net::ImageFormat^ xFormat)
 Projects an array of points from the given source space into the given target space. More...
 
void Project (RX_OUT array< double >^ % adTrgPoints, array< double >^ adSrcPoints, ESpace eTrgSpace, ESpace eSrcSpace, Rx::Net::ImageFormat^ xFormat, bool bTrgVD, bool bSrcVD)
 Projects an array of points from the given source space into the given target space. More...
 
bool ProjectInto3DSpace (ESpace eSpace)
 Project into 3D space. More...
 
void ReinitializeDepthDB ()
 Reinitializes the depth database. More...
 
void RemoveComputationFilterMask ()
 Removes the computation filter mask set by SetComputationFilterMask. More...
 
void ResetReferencePlane ()
 Resets the reference plane. More...
 
void ResizeImage (Rx::Net::Image^ xTrgImg, Rx::Net::Image^ xSrcImg, int iDivisor)
 Resize the given source image and store the result in the given target image using the given divisor. More...
 
void SetComputationFilterMask (Rx::Net::Image^ xImage)
 Sets the computation filter mask image. More...
 
void SetComputationFilterMask (System::String^ sFilename)
 Sets the computation filter mask image. More...
 
void SetCudaDevice (CudaDevice^ xCudaDevice)
 Sets the CUDA device that allocates the memory required for the operations and that runs the algorithms. More...
 
void UpdateTexture (EImage eImgID, OpenGlInterop^ xOpenGL)
 Updates the OpenGL texture of the image defined by the given ID. More...
 
void UpdateTexture (EImage eImgID, OpenGlInterop^ xOpenGL, bool bCreateMipmaps)
 Updates the OpenGL texture of the image defined by the given ID. More...
 
void Upload (EImage eImgID, Rx::Net::Image^ xImg)
 Uploads the image with the given image ID. More...
 
void UploadRawImage (Rx::Net::Image^ xSrcImg)
 Uploads the given image as the new raw image of all computations. More...
 

Constructor & Destructor Documentation

◆ CudaCompute() [1/2]

Rx::LFR::Net::CudaCompute::CudaCompute ( )
inline

Default constructor.

◆ CudaCompute() [2/2]

Rx::LFR::Net::CudaCompute::CudaCompute ( Rx::LFR::CCudaCompute xNative)
inline

Constructor that wraps the given native instance. Disposing does NOT destroy the native instance.

Parameters
xNative[in] The native instance to wrap by this class.

◆ ~CudaCompute()

Rx::LFR::Net::CudaCompute::~CudaCompute ( )
inline

Destructor.

Member Function Documentation

◆ ApplyCalibration()

void Rx::LFR::Net::CudaCompute::ApplyCalibration ( Calibration xCalib,
bool  bUploadGrayImg 
)
inline

Applies the given calibration to the algorithms. This must be done every time the calibration changes.

Parameters
xCalib[in] The calibration.
bUploadGrayImg[in] True to upload the gray image of the calibration to CUDA. False to use the current gray image even if it is invalid.

◆ ApplyRayImage()

void Rx::LFR::Net::CudaCompute::ApplyRayImage ( Rx::LFR::Net::RayImage xRayImage)
inline

Applies the given ray image.

This uploads the raw and the gray image to the CUDA device and applies the calibration and the parameters from the meta data to the CUDA algorithms.

Parameters
xRayImageThe ray image.

◆ Compute_Depth3D()

bool Rx::LFR::Net::CudaCompute::Compute_Depth3D ( ESpace  eSourceSpace,
ESpace  eTargetSpace 
)
inline

Calculates the depth 3D image.

This creates a RGBA float image which maps each pixel in the view camera to a 3D position in object space. The R channel is the X coordinate, the G channel is the Y coordinate and the B channel is the Z coordinate. The Z coordinate is relative to the global coordinate system which typically coincides with the light field camera sensor. All coordinate values are given in millimeters. The A channel is the Z coordinate in virtual depths.

Result image:

  • EImage::Depth3D_Virtual (if eTargetSpace == LF::ESpace::Virtual) or
  • EImage::Depth3D_Object (if eTargetSpace == LF::ESpace::Object) or
  • EImage::Depth3D_Reference (if eTargetSpace == LF::ESpace::Reference)

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • EViewCudaCompute::DepthMap_Color_Mode.
Parameters
eSourceSpace[in] The source space. This is LF::ESpace::View_VirtualUndistorted or LF::ESpace::View_Object_Orthographic.
eTargetSpace[in] The target space. This is LF::ESpace::Virtual or LF::ESpace::Object or LF::ESpace::Reference.
Returns
True if the resulting images have been updated, false if not.

◆ Compute_DepthColorCode()

bool Rx::LFR::Net::CudaCompute::Compute_DepthColorCode ( ESpace  eSpace)
inline

Calculates the colored depth map image.

Result image:

Also computes (if not valid):

  • EImage::Depth3D_Reference

Influencing parameters: (for intermediate images, see respective methods)

  • ECudaCompute::Depth_ImageDivisor
  • EViewCudaCompute::DepthMap_Color_Mode
  • EViewCudaCompute::Reference_DepthMax_MM
  • EViewCudaCompute::Reference_DepthMin_MM
  • EViewCudaCompute::DepthMap_Color_Map
  • EViewCudaCompute::DepthMap_Color_GammaCorrection.
  • EViewCudaCompute::ReferencePlane_Transformation_g_r.
Parameters
eSpace(Optional) [in] The space. This is LF::ESpace::View_VirtualUndistorted or LF::ESpace::View_Object_Orthographic.
Returns
True if the resulting images have been updated, false if not.

◆ Compute_DepthMap()

bool Rx::LFR::Net::CudaCompute::Compute_DepthMap ( ESpace  eSpace)
inline

Calculates the depth map image. This image can be filled to produce a complete filled depth map.

Result image:

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • ECudaCompute::Depth_ImageDivisor
  • ECudaCompute::Depth_Fill_Bilateral_Enabled
  • ECudaCompute::Depth_Fill_Bilateral_Algorithm
  • ECudaCompute::Depth_Fill_Bilateral_EnablePreFilter
  • ECudaCompute::Depth_Fill_Bilateral_Edge
  • ECudaCompute::Depth_Fill_Bilateral_Range
  • ECudaCompute::Depth_Fill_Bilateral_FilterRadius
  • ECudaCompute::Depth_Fill_Bilateral_DepthRadius
  • ECudaCompute::Depth_Algorithm
  • ECudaCompute::Depth_ConsistencyCheck
  • ECudaCompute::Depth_Fill_Enabled
  • ECudaCompute::Depth_Fill_Algorithm
  • ECudaCompute::Depth_Fill_IterCnt
  • ECudaCompute::Depth_Fill_IterSize
  • ECudaCompute::Depth_Fill_Complete
  • ECudaCompute::Depth_Fill_Filter_Enabled
  • ECudaCompute::Depth_Fill_ShrinkRangePX
  • ECudaCompute::Depth_Fill_DepthThreshold
  • ECudaCompute::Depth_Fill_MaxDepthVD.
Parameters
eSpace(Optional) [in] The space. This is LF::ESpace::View_VirtualCalibrated or LF::ESpace::View_Orthographic.
Returns
True if the resulting images have been updated, false if not.

◆ Compute_DepthMapGlobal()

bool Rx::LFR::Net::CudaCompute::Compute_DepthMapGlobal ( ESpace  eSourceSpace,
ESpace  eTargetSpace 
)
inline

Calculates the depth map image. This image can be filled to produce a complete filled depth map.

Result image:

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • ECudaCompute::Depth_ImageDivisor.
Parameters
eSourceSpace[in] The source space. This is LF::ESpace::Virtual or LF::ESpace::Object.
eTargetSpace[in] The target space. This is LF::ESpace::View_VirtualUndistorted or LF::ESpace::View_Object_Orthographic.
Returns
True if the resulting images have been updated, false if not.

◆ Compute_DepthRay()

bool Rx::LFR::Net::CudaCompute::Compute_DepthRay ( )
inline

Estimates the depth of the current raw image and creates the ray depth image.

Result image:

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • ECudaCompute::PreProc_Sharp1_Enable
  • ECudaCompute::PreProc_Sharp1_OnlyCalc
  • ECudaCompute::PreProc_Sharp1_BlurStdDev
  • ECudaCompute::PreProc_Sharp1_Factor
  • ECudaCompute::Depth_MinVirtualDepth
  • ECudaCompute::Depth_MaxVirtualDepth
  • ECudaCompute::Depth_MinCorrelation
  • ECudaCompute::Depth_MinStdDeviation
  • ECudaCompute::Depth_LensFilterMask
  • ECudaCompute::Depth_SparseLensSet
  • ECudaCompute::Depth_NearResolutionLevel
  • ECudaCompute::Depth_PatchDiameter
  • ECudaCompute::Depth_PatchStride
  • ECudaCompute::Depth_Fill_Enabled
  • ECudaCompute::Depth_Fill_RawEnabled
  • ECudaCompute::Depth_Algorithm
Returns
True if the resulting images have been updated, false if not.

◆ Compute_DepthRayColored()

bool Rx::LFR::Net::CudaCompute::Compute_DepthRayColored ( )
inline

Calculates the colored depth ray image.

Result image:

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • EViewCudaCompute::DepthMap_Color_Mode
  • EViewCudaCompute::Reference_DepthMax_MM
  • EViewCudaCompute::Reference_DepthMin_MM
  • EViewCudaCompute::DepthMap_Color_Map
  • EViewCudaCompute::DepthMap_Color_GammaCorrection
Returns
True if the resulting images have been updated, false if not.

◆ Compute_Grid()

bool Rx::LFR::Net::CudaCompute::Compute_Grid ( )
inline

Calculates the grid image. This is the raw or the gray image with an overlay that shows the current grid calibration.

Result image:

Required images:

Influencing parameters:

  • ECudaCompute::Grid_DrawOnGrayImage
  • ECudaCompute::Grid_DrawMlaGrid
  • ECudaCompute::PreProc_Demosaic_R
  • ECudaCompute::PreProc_Demosaic_G
  • ECudaCompute::PreProc_Demosaic_B
Returns
True if the resulting images have been updated, false if not.

◆ Compute_GridDataImage()

bool Rx::LFR::Net::CudaCompute::Compute_GridDataImage ( )
inline

Pre-Process a ray image with a minimal set of preprocessing parameters.

Result image:

Required images:

Influencing parameters:

  • ECudaCompute::PreProc_Demosaic_R
  • ECudaCompute::PreProc_Demosaic_G
  • ECudaCompute::PreProc_Demosaic_B
Returns
True if the resulting images have been updated, false if not.

◆ Compute_Histogram()

bool Rx::LFR::Net::CudaCompute::Compute_Histogram ( EImage  eImgID,
RX_OUT array< unsigned >^ %  xHistogram,
RX_OUT unsigned %  uChannels 
)
inline

Calculates the histogram of the image with the given image ID and stores the histogram data in the given array. This array must be large enough to hold 4 * 256 numbers. The number of calculated channels is returned in uChannels.

Parameters
eImgID[in] The image ID.
xHistogram[out] The histogram.
uChannels[out] The number of channels.
Returns
True if the resulting images have been updated, false if not.

◆ Compute_ImageMinMax()

bool Rx::LFR::Net::CudaCompute::Compute_ImageMinMax ( EImage  eImgID,
unsigned  uChannel,
RX_OUT float %  fMin,
RX_OUT float %  fMax 
)
inline

Calculates the minimum and the maximum value in the given image.

Parameters
eImgID[in] The image ID. The image must be of type float.
uChannel[in] The channel of each pixel that is used to get the values.
fMin[out] The minimum.
fMax[out] The maximum.
Returns
True if the resulting images have been updated, false if not.

◆ Compute_MeshImage()

bool Rx::LFR::Net::CudaCompute::Compute_MeshImage ( ESpace  eSpace)
inline

Calculates the point cloud image.

This creates a RGBA float image where each pixel describes a 3D color point from the given space. The R channel is the X coordinate, the G channel is the Y coordinate and the B channel is the Z coordinate. The Z coordinate is relative to the global coordinate system which typically coincides with the light field camera sensor. All coordinate values are given in millimeters.

The A channel describes the color of the point. Via OpenGL you can extract the color with the following methods: unpackUnorm4x8(floatBitsToUint(A)).

Result image:

  • EImage::Mesh

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • None.
Parameters
eSpace(Optional) The space to project into. This is LF::ESpace::Virtual or LF::ESpace::Object.
Returns
True if the resulting images have been updated, false if not.

◆ Compute_Multiview()

bool Rx::LFR::Net::CudaCompute::Compute_Multiview ( )
inline

Calculates the multi view image.

Result image:

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • EViewCudaCompute::Multiview_EyeSeparation
  • EViewCudaCompute::Multiview_Type
  • ECudaCompute::Depth_Fill_Complete
  • ECudaCompute::Focus_ImageDivisor
  • ECudaCompute::PreProc_DataType
  • EViewCudaCompute::ViewCamera_OffsetPx
  • EViewCudaCompute::CollimationPlaneVD
  • ECudaCompute::Depth_ImageDivisor
  • ECudaCompute::Depth_Fill_Bilateral_Enabled
  • ECudaCompute::Depth_Fill_Bilateral_Algorithm
  • ECudaCompute::Depth_Fill_Bilateral_EnablePreFilter
  • ECudaCompute::Depth_Fill_Bilateral_Edge
  • ECudaCompute::Depth_Fill_Bilateral_Range
  • ECudaCompute::Depth_Fill_Bilateral_FilterRadius
  • ECudaCompute::Depth_Fill_Bilateral_DepthRadius
  • ECudaCompute::Depth_Algorithm
  • ECudaCompute::Depth_ConsistencyCheck
  • ECudaCompute::Depth_Fill_Enabled
  • ECudaCompute::Depth_Fill_Algorithm
  • ECudaCompute::Depth_Fill_IterCnt
  • ECudaCompute::Depth_Fill_IterSize
  • ECudaCompute::Depth_Fill_Complete
  • ECudaCompute::Depth_Fill_Filter_Enabled
  • ECudaCompute::Depth_Fill_ShrinkRangePX
  • ECudaCompute::Depth_Fill_DepthThreshold
  • ECudaCompute::Depth_Fill_MaxDepthVD
  • ECudaCompute::Focus_RelativeFocusPlane
  • ECudaCompute::Depth_MinVirtualDepth
  • ECudaCompute::Depth_MaxVirtualDepth
  • ECudaCompute::Focus_DepthBlendingScale
  • ECudaCompute::Depth_Fill_Complete
  • ECudaCompute::Depth_Fill_Enabled
  • ECudaCompute::Focus_FillAlways
Returns
True if the resulting images have been updated, false if not.

◆ Compute_PointCloudImage()

bool Rx::LFR::Net::CudaCompute::Compute_PointCloudImage ( ESpace  eSpace)
inline

Calculates the point cloud image.

This creates a RGBA float image where each pixel describes a 3D color point from the given space. The R channel is the X coordinate, the G channel is the Y coordinate and the B channel is the Z coordinate. The Z coordinate is relative to the global coordinate system which typically coincides with the light field camera sensor. All coordinate values are given in millimeters.

The A channel describes the color of the point. Via OpenGL you can extract the color with the following methods: unpackUnorm4x8(floatBitsToUint(A)).

Result image:

  • EImage::PointCloud

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • None.
Parameters
eSpace(Optional) The space to project into. This is LF::ESpace::Virtual or LF::ESpace::Object.
Returns
True if the resulting images have been updated, false if not.

◆ Compute_PreProcess()

bool Rx::LFR::Net::CudaCompute::Compute_PreProcess ( )
inline

Pre-Process a ray image. This can apply denoise, brightness and sharpness adjustments.

Result image:

Required image:

Influencing parameters:

  • ECudaCompute::PreProc_DataType
  • ECudaCompute::PreProc_Demosaic_Enable
  • ECudaCompute::PreProc_Demosaic_R
  • ECudaCompute::PreProc_Demosaic_G
  • ECudaCompute::PreProc_Demosaic_B
  • ECudaCompute::PreProc_DenoiseNLM_Enable
  • ECudaCompute::PreProc_DenoiseNLM_FilterDia
  • ECudaCompute::PreProc_DenoiseNLM_NoiseLevel
  • ECudaCompute::PreProc_DenoiseNLM_BlendFactor
  • ECudaCompute::PreProc_Std_Enable
  • ECudaCompute::PreProc_Std_Gradation
  • ECudaCompute::PreProc_Sharp1_Enable
  • ECudaCompute::PreProc_Sharp1_OnlyCalc
  • ECudaCompute::PreProc_Sharp1_BlurStdDev
  • ECudaCompute::PreProc_Sharp1_Factor
Returns
True if the resulting images have been updated, false if not.

◆ Compute_RefocusBasic()

bool Rx::LFR::Net::CudaCompute::Compute_RefocusBasic ( )
inline

Focus image to a plane perpendicular to the optical axis, i.e. parallel to the image plane.

This focuses to a plane perpendicular to the optical axis. You can change the relative focal plane. A relative focus value of zero refocuses to the plane furthest away from the viewer and a value of 1 would focus to a plane that passes through the object side focal point of the recording lens.

Result image:

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • ECudaCompute::Focus_RelativeFocusPlane
  • ECudaCompute::Depth_MinVirtualDepth
  • ECudaCompute::Depth_MaxVirtualDepth
Returns
True if the resulting images have been updated, false if not.

◆ Compute_TotalFocus()

bool Rx::LFR::Net::CudaCompute::Compute_TotalFocus ( ESpace  eSpace)
inline

Focus on a depth surface.

In principle, each pixel of the result image can be focused individually. This function makes this property available by focusing the ray image to the depth surface given in the internal depth image related to the given space.

Result image:

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • ECudaCompute::Focus_DepthBlendingScale
  • ECudaCompute::Focus_ImageDivisor
  • ECudaCompute::PreProc_DataType
  • ECudaCompute::Focus_RelativeFocusPlane
  • ECudaCompute::Depth_MinVirtualDepth
  • ECudaCompute::Depth_MaxVirtualDepth
  • ECudaCompute::Depth_Fill_Enabled
  • ECudaCompute::Depth_Fill_Complete
  • ECudaCompute::Focus_FillAlways
  • ECudaCompute::Depth_Fill_IterCnt
  • ECudaCompute::Depth_Fill_IterSize
  • ECudaCompute::Depth_Fill_Filter_Enabled.
Parameters
eSpace(Optional) [in] The space. This is LF::ESpace::View_VirtualUndistorted or LF::ESpace::View_Object_Orthographic.
Returns
True if the resulting images have been updated, false if not.

◆ Compute_TotalFocusGlobal()

bool Rx::LFR::Net::CudaCompute::Compute_TotalFocusGlobal ( ESpace  eSourceSpace,
ESpace  eTargetSpace 
)
inline

Focus on a depth surface.

In principle, each pixel of the result image can be focused individually. This function makes this property available by focusing the ray image to the depth surface given in the internal depth image related to the given space.

Result image:

Also computes (if not valid):

Influencing parameters: (for intermediate images, see respective methods)

  • ECudaCompute::Focus_ImageDivisor
  • ECudaCompute::PreProc_DataType.
Parameters
eSourceSpace[in] The source space. This is LF::ESpace::Virtual or LF::ESpace::Object.
eTargetSpace[in] The target space. This is LF::ESpace::View_VirtualUndistorted or LF::ESpace::View_Object_Orthographic.
Returns
True if the resulting images have been updated, false if not.

◆ CreateFocusImageFormat()

Rx::Net::ImageFormat ^ Rx::LFR::Net::CudaCompute::CreateFocusImageFormat ( Rx::Net::ImageFormat xRawFormat,
bool  bForceLandscape 
)
inline

Creates the image format of the refocus and the total focus image. This considers the Focus_ImageDivisor parameter.

Parameters
xRawFormat[in] The raw image format.
bForceLandscape[in] True to force landscape. Otherwise the calibration is used.
Returns
The image format.

◆ Download()

void Rx::LFR::Net::CudaCompute::Download ( EImage  eImgID,
Rx::Net::Image xImg 
)
inline

Downloads the image with the given image ID.

Parameters
eImgID[in] The image ID.
xImg[out] If non-null, the image.

◆ DownloadPointCloud()

void Rx::LFR::Net::CudaCompute::DownloadPointCloud ( ESpace  eSpaceID,
RX_OUT array< Rx::Net::ColorPoint3D >^ %  axColorPoints 
)
inline

Downloads the point cloud.

Parameters
eSpaceID[in] The space ID.
axColorPoints[out] The array of colored 3D points.

◆ Free()

void Rx::LFR::Net::CudaCompute::Free ( EImage  eImgID)
inline

Frees memory used by image defined by eImgID. This invalidates the image.

Parameters
eImgIDThe image ID.

◆ FreeAll()

void Rx::LFR::Net::CudaCompute::FreeAll ( )
inline

Frees the memory used by all images. This invalidates all images.

◆ GetCameraFormat()

const void* Rx::LFR::Net::CudaCompute::GetCameraFormat ( )
inline

Gets the pointer to the internal camera format. Only for internal purposes.

Returns
The pointer to the internal camera format.

◆ GetComputeParams()

IParameters<Rx::LFR::Net::Params::ECudaCompute> ^ Rx::LFR::Net::CudaCompute::GetComputeParams ( )
inline

Gets the parameters access interface.

Returns
The parameters access interface.

◆ GetCudaDevice()

CudaDevice ^ Rx::LFR::Net::CudaCompute::GetCudaDevice ( )
inline

Gets the CUDA device that has been set by calling SetCudaDevice. Throws an exception if not set yet.

Returns
The CUDA device.

◆ GetDevicePointerPitch()

size_t Rx::LFR::Net::CudaCompute::GetDevicePointerPitch ( EImage  eImgID)
inline

Gets device pointer pitch, which is the width in bytes of the allocation. Given a row and column of an array element of type T, the address is computed as:

T* pElement = (T*)((char*)BaseAddress + Row * pitch) + Column;

Parameters
eImgIDThe image ID.
Returns
The device pointer pitch.
// Host code:
// Assuming the image in this example is of type luminance, float (TPixel_L_f).
char* pcBaseAdress = (char*) GetImageDevicePointer(EImage::DepthRay);
// CUDA code:
// Get the pointer of the pixel on the CUDA device, at row 10 and column 42.
Rx::TPixel_L_f* tPixel = (((Rx::TPixel_L_f*) (pcBaseAdress + 10 * nPitch)) + 42);

◆ GetImageDevicePointer()

System::IntPtr Rx::LFR::Net::CudaCompute::GetImageDevicePointer ( EImage  eImgID)
inline

Gets the CUDA device pointer to the data of the image defined by the given ID.

The pointer maps to the memory on a CUDA device and cannot be used on the host.

Parameters
eImgIDThe image ID.
Returns
The image device pointer.

◆ GetImageFormat()

Rx::Net::ImageFormat ^ Rx::LFR::Net::CudaCompute::GetImageFormat ( EImage  eImgID)
inline

Gets the image format of the image defined by the given ID.

Parameters
eImgID[in] The image ID.
Returns
The image format.

◆ GetInterface() [1/2]

System::Object ^ Rx::LFR::Net::CudaCompute::GetInterface ( Interfaces::ECudaCompute  eInterface)
inlineoverride

Gets the interface of the CUDA compute class determined by the Interfaces::CudaCompute enum.

Parameters
eInterface[in] The interface enum.
Returns
Null if no interface is implemented yet, else the interface object.

◆ GetInterface() [2/2]

virtual System::Object ^ Rx::Net::NativeInterfaceWrapper< Rx::LFR::CCudaCompute , Rx::LFR::Net::Interfaces::ECudaCompute >::GetInterface ( Rx::LFR::Net::Interfaces::ECudaCompute  eData)
inlinevirtualinherited

Gets the interface.

Returns
The interface.

◆ GetProjectionSystem()

const void* Rx::LFR::Net::CudaCompute::GetProjectionSystem ( )
inline

Gets the pointer to the internal projection system. Only for internal purposes.

Returns
The pointer to the internal projection system.

◆ GetRawImagePointsFromVirtualMM_s() [1/2]

void Rx::LFR::Net::CudaCompute::GetRawImagePointsFromVirtualMM_s ( RX_OUT array< double >^ %  adRawPoints,
double  dSrcX,
double  dSrcY,
double  dSrcZ,
int  iRadiusLU 
)
inline

Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses.

Parameters
adRawPoints[out] The projected points. This array contains three entries per projected point. The first and the second entry are the X and the Y coordinates of the projected point given in pixels in the raw image. The third entry is the corresponding lens type.
dSrcX[in] The X coordinate of the source point in virtual space in millimeters.
dSrcY[in] The Y coordinate of the source point in virtual space in millimeters.
dSrcZ[in] The Z coordinate of the source point in virtual space in millimeters.
iRadiusLU[in] The radius given in lens units that is used to find the suitable micro lenses. A radius of 2 or 3 lens units is recommended.

◆ GetRawImagePointsFromVirtualMM_s() [2/2]

void Rx::LFR::Net::CudaCompute::GetRawImagePointsFromVirtualMM_s ( RX_OUT array< double >^ %  adRawPoints,
double  dSrcX,
double  dSrcY,
double  dSrcZ,
int  iRadiusLU,
int  iMinAllowedDistanceToLensBorderPX 
)
inline

Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses.

Parameters
adRawPoints[out] The projected points. This array contains three entries per projected point. The first and the second entry are the X and the Y coordinates of the projected point given in pixels in the raw image. The third entry is the corresponding lens type.
dSrcX[in] The X coordinate of the source point in virtual space in millimeters.
dSrcY[in] The Y coordinate of the source point in virtual space in millimeters.
dSrcZ[in] The Z coordinate of the source point in virtual space in millimeters.
iRadiusLU[in] The radius given in lens units that is used to find the suitable micro lenses. A radius of 2 or 3 lens units is recommended.
iMinAllowedDistanceToLensBorderPX[in] Zero-based index of the minimum allowed distance to lens border in pixels.

◆ GetViewParams()

IParameters<Rx::LFR::Net::Params::EViewCudaCompute> ^ Rx::LFR::Net::CudaCompute::GetViewParams ( )
inline

Gets the parameters access interface.

Returns
The parameters access interface.

◆ GetVirtualMM_sFromRawImagePoint()

void Rx::LFR::Net::CudaCompute::GetVirtualMM_sFromRawImagePoint ( RX_OUT double %  dTrgX,
RX_OUT double %  dTrgY,
RX_OUT double %  dTrgZ,
double  dSrcX,
double  dSrcY,
double  dSrcZ 
)
inline

Projects from the given pixel position in the raw image with the given standard depth through the micro lenses into virtual space.

Parameters
dTrgX[out] The X coordinate of the target point in virtual space in mm.
dTrgY[out] The Y coordinate of the target point in virtual space in mm.
dTrgZ[out] The Z coordinate of the target point in virtual space in mm.
dSrcX[in] The X coordinate of the source point in pixels in raw image format.
dSrcY[in] The Y coordinate of the target point in pixels in raw image format.
dSrcZ[in] The Z coordinate of the target point in standard depths (Between 0.5 and 1.0)

◆ HasCudaDevice()

bool Rx::LFR::Net::CudaCompute::HasCudaDevice ( )
inline

Queries if a CUDA device has been set.

Returns
True if a CUDA device has been set, false if not.

◆ IsDataValid()

bool Rx::LFR::Net::CudaCompute::IsDataValid ( EImage  eImage)
inline

Queries of the data for the given image is valid and up-to-date.

Parameters
eImageThe image.
Returns
True if image valid, false if not.

◆ IsValid()

bool Rx::LFR::Net::CudaCompute::IsValid ( EImage  eImgID)
inline

Query if the image with the given image ID is valid.

Parameters
eImgID[in] The image ID.
Returns
True if valid, false if not.

◆ Project() [1/4]

void Rx::LFR::Net::CudaCompute::Project ( RX_OUT array< double >^ %  adTrgPoints,
array< double >^  adSrcPoints,
ESpace  eTrgSpace,
ESpace  eSrcSpace 
)
inline

Projects an array of points from the given source space into the given target space.

Parameters
adTrgPoints[out] The array of projected points.
adSrcPoints[in] The array of points to project.
eTrgSpace[in] The target space.
eSrcSpace[in] The source space.

◆ Project() [2/4]

void Rx::LFR::Net::CudaCompute::Project ( RX_OUT array< double >^ %  adTrgPoints,
array< double >^  adSrcPoints,
ESpace  eTrgSpace,
ESpace  eSrcSpace,
bool  bTrgVD,
bool  bSrcVD 
)
inline

Projects an array of points from the given source space into the given target space.

Parameters
adTrgPoints[out] The array of projected points.
adSrcPoints[in] The array of points to project.
eTrgSpace[in] The target space.
eSrcSpace[in] The source space.
bTrgVD[in] True if the target depth should be given in virtual depths. Is ignored if the target space isn't virtual.
bSrcVD[in] True if the source depth is given in virtual depths. Is ignored if the source space isn't virtual.

◆ Project() [3/4]

void Rx::LFR::Net::CudaCompute::Project ( RX_OUT array< double >^ %  adTrgPoints,
array< double >^  adSrcPoints,
ESpace  eTrgSpace,
ESpace  eSrcSpace,
Rx::Net::ImageFormat xFormat 
)
inline

Projects an array of points from the given source space into the given target space.

Parameters
adTrgPoints[out] The array of projected points.
adSrcPoints[in] The array of points to project.
eTrgSpace[in] The target space.
eSrcSpace[in] The source space.
xFormat[in] The image format of the source and/or target space. Only required if the space is a view. This parameter limits this function to allow only projections from an image format to the same image format. An invalid format also leads to the use of millimeters in the view target spaces, instead of pixel.

◆ Project() [4/4]

void Rx::LFR::Net::CudaCompute::Project ( RX_OUT array< double >^ %  adTrgPoints,
array< double >^  adSrcPoints,
ESpace  eTrgSpace,
ESpace  eSrcSpace,
Rx::Net::ImageFormat xFormat,
bool  bTrgVD,
bool  bSrcVD 
)
inline

Projects an array of points from the given source space into the given target space.

Parameters
adTrgPoints[out] The array of projected points.
adSrcPoints[in] The array of points to project.
eTrgSpace[in] The target space.
eSrcSpace[in] The source space.
xFormat[in] The image format of the source and/or target space. Only required if the space is a view. This parameter limits this function to allow only projections from an image format to the same image format. An invalid format also leads to the use of millimeters in the view target spaces, instead of pixel.
bTrgVD[in] True if the target depth should be given in virtual depths. Is ignored if the target space isn't virtual.
bSrcVD[in] True if the source depth is given in virtual depths. Is ignored if the source space isn't virtual.

◆ ProjectInto3DSpace()

bool Rx::LFR::Net::CudaCompute::ProjectInto3DSpace ( ESpace  eSpace)
inline

Project into 3D space.

Result image:

Parameters
eSpace[in] The space to project into. This is LF::ESpace::Virtual or LF::ESpace::Object.
Returns
True if the resulting images have been updated, false if not.

◆ ReinitializeDepthDB()

void Rx::LFR::Net::CudaCompute::ReinitializeDepthDB ( )
inline

Reinitializes the depth database.

This can be useful when calling Compute_DepthMap after changing the ray depth image manually.

◆ RemoveComputationFilterMask()

void Rx::LFR::Net::CudaCompute::RemoveComputationFilterMask ( )
inline

Removes the computation filter mask set by SetComputationFilterMask.

◆ ResetReferencePlane()

void Rx::LFR::Net::CudaCompute::ResetReferencePlane ( )
inline

Resets the reference plane.

◆ ResizeImage()

void Rx::LFR::Net::CudaCompute::ResizeImage ( Rx::Net::Image xTrgImg,
Rx::Net::Image xSrcImg,
int  iDivisor 
)
inline

Resize the given source image and store the result in the given target image using the given divisor.

Parameters
xTrgImg[in] The target image. This must not be a moniker. It's created inside.
xSrcImg[in] The source image.
iDivisor[in] The divisor. A value of 2 means that the target image is half the source size.

◆ SetComputationFilterMask() [1/2]

void Rx::LFR::Net::CudaCompute::SetComputationFilterMask ( Rx::Net::Image xImage)
inline

Sets the computation filter mask image.

This image is used to reduce the number of lenses used for depth estimation.

It must have the same dimension as the raw image and a pixel type of Rx::InteropNet::Runtime28::EPixelType::Lum and a data type of Rx::InteropNet::Runtime28::EDataType::UByte. Otherwise the image is converted.

Each lens of the raw image has a lens center that can be rounded to a pixel. If this pixel has the value 255 in the filter mask image, the corresponding lens is used. If this pixel has another value, the lens is not used.

Parameters
xImage[in] The computation filter mask image.

◆ SetComputationFilterMask() [2/2]

void Rx::LFR::Net::CudaCompute::SetComputationFilterMask ( System::String^  sFilename)
inline

Sets the computation filter mask image.

This image is used to reduce the number of lenses used for depth estimation.

It must have the same dimension as the raw image and a pixel type of Rx::InteropNet::Runtime28::EPixelType::Lum and a data type of Rx::InteropNet::Runtime28::EDataType::UByte. Otherwise the image is converted.

Each lens of the raw image has a lens center that can be rounded to a pixel. If this pixel has the value 255 in the filter mask image, the corresponding lens is used. If this pixel has another value, the lens is not used.

Parameters
sFilename[in] The complete image file path.

◆ SetCudaDevice()

void Rx::LFR::Net::CudaCompute::SetCudaDevice ( CudaDevice xCudaDevice)
inline

Sets the CUDA device that allocates the memory required for the operations and that runs the algorithms.

Parameters
xCudaDevice[in] The CUDA device.

◆ UpdateTexture() [1/2]

void Rx::LFR::Net::CudaCompute::UpdateTexture ( EImage  eImgID,
OpenGlInterop xOpenGL 
)
inline

Updates the OpenGL texture of the image defined by the given ID.

This copies the image into the texture and creates a valid texture ID if the texture has not been created before. The calling thread must own the OpenGL context that owns the texture.

Parameters
eImgID[in] The image ID.
xOpenGL[in] The OpenGlInterop class.

◆ UpdateTexture() [2/2]

void Rx::LFR::Net::CudaCompute::UpdateTexture ( EImage  eImgID,
OpenGlInterop xOpenGL,
bool  bCreateMipmaps 
)
inline

Updates the OpenGL texture of the image defined by the given ID.

This copies the image into the texture and creates a valid texture ID if the texture has not been created before. The calling thread must own the OpenGL context that owns the texture.

Parameters
eImgID[in] The image ID.
xOpenGL[in] The OpenGlInterop class.
bCreateMipmaps[in] True to create mipmaps of the texture.

◆ Upload()

void Rx::LFR::Net::CudaCompute::Upload ( EImage  eImgID,
Rx::Net::Image xImg 
)
inline

Uploads the image with the given image ID.

Parameters
eImgID[in] The image ID.
xImg[in] If non-null, the image.

◆ UploadRawImage()

void Rx::LFR::Net::CudaCompute::UploadRawImage ( Rx::Net::Image xSrcImg)
inline

Uploads the given image as the new raw image of all computations.

Parameters
xSrcImg[in] The source image.
Rx::TPixel
General pixel template structure.
Definition: Rx.InlinePixel.h:35
Rx::LFR::Net::CudaCompute::GetImageDevicePointer
System::IntPtr GetImageDevicePointer(EImage eImgID)
Gets the CUDA device pointer to the data of the image defined by the given ID.
Definition: Rx.LFR.Net/CudaCompute.h:1449
EImage::DepthRay
@ DepthRay
Raw depth image without fusion.
Definition: Enums.Values.h:1865
Rx::LFR::Net::CudaCompute::GetDevicePointerPitch
size_t GetDevicePointerPitch(EImage eImgID)
Gets device pointer pitch, which is the width in bytes of the allocation. Given a row and column of a...
Definition: Rx.LFR.Net/CudaCompute.h:1490