Raytrix Light Field SDK
5.0
|
Provides methods for using a CUDA device as the computation unit of the LFR.
Inherits Rx::LFR::CPimpl< CCudaCompute_Impl, Interfaces::ECudaCompute::ID >.
Public Member Functions | |
CCudaCompute () | |
Default constructor. More... | |
CCudaCompute (CCudaCompute &&xCudaCompute) | |
Move constructor. More... | |
~CCudaCompute () | |
Destructor. More... | |
void | ApplyCalibration (const CCalibration &xCalib, bool bUploadGrayImg=true) |
Applies the given calibration to the algorithms. This must be done every time the calibration changes. More... | |
void | ApplyRayImage (const CRayImage &xRayImage) |
Applies the given ray image. More... | |
bool | Compute_Depth3D (LF::ESpace::ID eSourceSpace, LF::ESpace::ID eTargetSpace) |
Calculates the depth 3D image. More... | |
bool | Compute_DepthColorCode (LF::ESpace::ID eSpace=LF::ESpace::View_VirtualUndistorted) |
Calculates the colored depth map image. More... | |
bool | Compute_DepthMap (LF::ESpace::ID eSpace=LF::ESpace::View_VirtualUndistorted) |
Calculates the depth map image. This image can be filled to produce a complete filled depth map. More... | |
bool | Compute_DepthMapGlobal (LF::ESpace::ID eSourceSpace, LF::ESpace::ID 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::ID eImgID, CRxArrayUInt &xHistogram, 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::ID eImgID, unsigned uChannel, float &fMin, float &fMax) |
Calculates the minimum and the maximum value in the given image. More... | |
bool | Compute_MeshImage (LF::ESpace::ID eSpace=LF::ESpace::Object) |
Calculates the point cloud image. More... | |
bool | Compute_Multiview () |
Calculates the multi view image. More... | |
bool | Compute_PointCloudImage (LF::ESpace::ID eSpace=LF::ESpace::Object) |
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 (LF::ESpace::ID eSpace=LF::ESpace::View_VirtualUndistorted) |
Focus on a depth surface. More... | |
bool | Compute_TotalFocusGlobal (LF::ESpace::ID eSourceSpace, LF::ESpace::ID eTargetSpace) |
Focus on a depth surface. More... | |
CRxImageFormat | CreateFocusImageFormat (const CRxImageFormat &xRawFormat, bool bForceLandscape) const |
Creates the image format of the refocus and the total focus image. This considers the Focus_ImageDivisor parameter. More... | |
void | Download (EImage::ID eImgID, CRxImage &xImage) const |
Downloads the image defined by eImgID. More... | |
void | DownloadPointCloud (LF::ESpace::ID eSpaceID, CRxArrayDouble &adPointPosition, CRxArrayDouble &adPointColor) |
Downloads the point cloud. More... | |
void | Free (EImage::ID 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 () const |
Gets the pointer to the internal camera format. Only for internal purposes. More... | |
CParameters< Params::ECudaCompute::ID > & | GetComputeParams () |
Gets compute parameters. More... | |
const CParameters< Params::ECudaCompute::ID > & | GetComputeParams () const |
Gets compute parameters. More... | |
const CCudaDevice & | GetCudaDevice () const |
Gets the CUDA device that has been set by calling SetCudaDevice. Throws an exception if not set yet. More... | |
size_t | GetDevicePointerPitch (EImage::ID eImgID) const |
Gets device pointer pitch. More... | |
void * | GetImageDevicePointer (EImage::ID eImgID) const |
Gets the CUDA device pointer to the data of the image defined by the given ID. More... | |
const CRxImageFormat & | GetImageFormat (EImage::ID eImgID) const |
Gets the image format of the image defined by the given ID. More... | |
CCudaCompute_Impl & | GetImpl () |
Gets the non constant implementation. More... | |
const CCudaCompute_Impl & | GetImpl () const |
Gets the constant implementation. More... | |
void * | GetInterface (Interfaces::ECudaCompute::ID eData) |
Gets the cuda compute interface. More... | |
const void * | GetInterface (Interfaces::ECudaCompute::ID eData) const |
Gets the cuda compute interface. More... | |
const void * | GetProjectionSystem () const |
Gets the pointer to the internal projection system. Only for internal purposes. More... | |
void | GetRawImagePointsFromVirtualMM_s (CRxArray< double > &adRawPoints, double dSrcX, double dSrcY, double dSrcZ, int iRadiusLU) const |
Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses. More... | |
void | GetRawImagePointsFromVirtualMM_s (CRxArray< double > &adRawPoints, double dSrcX, double dSrcY, double dSrcZ, int iRadiusLU, int iMinAllowedDistanceToLensBorderPX) const |
Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses. More... | |
CParameters< Params::EViewCudaCompute::ID > & | GetViewParams () |
Gets view parameters. More... | |
const CParameters< Params::EViewCudaCompute::ID > & | GetViewParams () const |
Gets view parameters. More... | |
void | GetVirtualMM_sFromRawImagePoint (double &dTrgX, double &dTrgY, double &dTrgZ, double dSrcX, double dSrcY, double dSrcZ) const |
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 () const |
Queries if a CUDA device has been set. More... | |
bool | HasInterface (Interfaces::ECudaCompute::ID eInterface) |
Queries if this object has the given interface. More... | |
bool | IsDataValid (EImage::ID eImage) const |
Queries of the data for the given image is valid and up-to-date. More... | |
bool | IsValid (EImage::ID eImgID) const |
Query if the image defined by eImgID is valid. More... | |
CCudaCompute & | operator= (CCudaCompute &&xCudaCompute) |
Move assignment operator. More... | |
void | Project (CRxArray< double > &adTrgPoints, const CRxArray< double > &adSrcPoints, LF::ESpace::ID eTrgSpace, LF::ESpace::ID eSrcSpace) const |
Projects an array of points from the given source space into the given target space. More... | |
void | Project (CRxArray< double > &adTrgPoints, const CRxArray< double > &adSrcPoints, LF::ESpace::ID eTrgSpace, LF::ESpace::ID eSrcSpace, bool bTrgVD, bool bSrcVD) const |
Projects an array of points from the given source space into the given target space. More... | |
void | Project (CRxArray< double > &adTrgPoints, const CRxArray< double > &adSrcPoints, LF::ESpace::ID eTrgSpace, LF::ESpace::ID eSrcSpace, const CRxImageFormat &xFormat) const |
Projects an array of points from the given source space into the given target space. More... | |
void | Project (CRxArray< double > &adTrgPoints, const CRxArray< double > &adSrcPoints, LF::ESpace::ID eTrgSpace, LF::ESpace::ID eSrcSpace, const CRxImageFormat &xFormat, bool bTrgVD, bool bSrcVD) const |
Projects an array of points from the given source space into the given target space. More... | |
bool | ProjectInto3DSpace (LF::ESpace::ID 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 (CRxImage &xTrgImg, const CRxImage &xSrcImg, int iDivisor) |
Resize the given source image and store the result in the given target image using the given divisor. More... | |
void | SetComputationFilterMask (const CRxImage &xImage) |
Sets the computation filter mask image. More... | |
void | SetComputationFilterMask (const CRxString &sxFilename) |
Sets the computation filter mask image. More... | |
void | SetCudaDevice (const CCudaDevice &xCudaDevice) |
Sets the CUDA device that allocates the memory required for the operations and that runs the algorithms. More... | |
void | UpdateTexture (EImage::ID eImgID, COpenGlInterop &xOpenGL, bool bCreateMipmaps=false) |
Updates the OpenGL texture of the image defined by the given ID. More... | |
void | Upload (EImage::ID eImgID, const CRxImage &xImage) |
Uploads the given image onto the CUDA device. More... | |
void | UploadRawImage (const CRxImage &xSrcImg) |
Uploads the given image as the new raw image of all computations. More... | |
Rx::LFR::CCudaCompute::CCudaCompute | ( | ) |
Default constructor.
Rx::LFR::CCudaCompute::CCudaCompute | ( | CCudaCompute && | xCudaCompute | ) |
Move constructor.
xCudaCompute | [in,out] The CUDA compute instance. |
Rx::LFR::CCudaCompute::~CCudaCompute | ( | ) |
Destructor.
void Rx::LFR::CCudaCompute::ApplyCalibration | ( | const CCalibration & | xCalib, |
bool | bUploadGrayImg = true |
||
) |
Applies the given calibration to the algorithms. This must be done every time the calibration changes.
xCalib | [in] The calibration. |
bUploadGrayImg | (Optional) [in] True to upload the gray image of the calibration to CUDA. False to use the current gray image even if it is invalid. |
void Rx::LFR::CCudaCompute::ApplyRayImage | ( | const CRayImage & | xRayImage | ) |
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.
xRayImage | [in] The ray image. |
bool Rx::LFR::CCudaCompute::Compute_Depth3D | ( | LF::ESpace::ID | eSourceSpace, |
LF::ESpace::ID | eTargetSpace | ||
) |
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:
Also computes (if not valid):
Influencing parameters: (for intermediate images, see respective methods)
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. |
bool Rx::LFR::CCudaCompute::Compute_DepthColorCode | ( | LF::ESpace::ID | eSpace = LF::ESpace::View_VirtualUndistorted | ) |
Calculates the colored depth map image.
Result image:
Also computes (if not valid):
Influencing parameters: (for intermediate images, see respective methods)
eSpace | (Optional) [in] The space. This is LF::ESpace::View_VirtualUndistorted or LF::ESpace::View_Object_Orthographic. |
bool Rx::LFR::CCudaCompute::Compute_DepthMap | ( | LF::ESpace::ID | eSpace = LF::ESpace::View_VirtualUndistorted | ) |
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)
eSpace | (Optional) [in] The space. This is LF::ESpace::View_VirtualCalibrated or LF::ESpace::View_Orthographic. |
bool Rx::LFR::CCudaCompute::Compute_DepthMapGlobal | ( | LF::ESpace::ID | eSourceSpace, |
LF::ESpace::ID | eTargetSpace | ||
) |
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)
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. |
bool Rx::LFR::CCudaCompute::Compute_DepthRay | ( | ) |
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)
bool Rx::LFR::CCudaCompute::Compute_DepthRayColored | ( | ) |
Calculates the colored depth ray image.
Result image:
Also computes (if not valid):
Influencing parameters: (for intermediate images, see respective methods)
bool Rx::LFR::CCudaCompute::Compute_Grid | ( | ) |
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:
bool Rx::LFR::CCudaCompute::Compute_GridDataImage | ( | ) |
Pre-Process a ray image with a minimal set of preprocessing parameters.
Result image:
Required images:
Influencing parameters:
bool Rx::LFR::CCudaCompute::Compute_Histogram | ( | EImage::ID | eImgID, |
CRxArrayUInt & | xHistogram, | ||
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.
eImgID | [in] The image ID. |
xHistogram | [out] The histogram. |
uChannels | [out] The number of channels. |
bool Rx::LFR::CCudaCompute::Compute_ImageMinMax | ( | EImage::ID | eImgID, |
unsigned | uChannel, | ||
float & | fMin, | ||
float & | fMax | ||
) |
Calculates the minimum and the maximum value in the given image.
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. |
bool Rx::LFR::CCudaCompute::Compute_MeshImage | ( | LF::ESpace::ID | eSpace = LF::ESpace::Object | ) |
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:
Also computes (if not valid):
Influencing parameters: (for intermediate images, see respective methods)
eSpace | (Optional) The space to project into. This is LF::ESpace::Virtual or LF::ESpace::Object. |
bool Rx::LFR::CCudaCompute::Compute_Multiview | ( | ) |
Calculates the multi view image.
Result image:
Also computes (if not valid):
Influencing parameters: (for intermediate images, see respective methods)
bool Rx::LFR::CCudaCompute::Compute_PointCloudImage | ( | LF::ESpace::ID | eSpace = LF::ESpace::Object | ) |
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:
Also computes (if not valid):
Influencing parameters: (for intermediate images, see respective methods)
eSpace | (Optional) The space to project into. This is LF::ESpace::Virtual or LF::ESpace::Object. |
bool Rx::LFR::CCudaCompute::Compute_PreProcess | ( | ) |
Pre-Process a ray image. This can apply denoise, brightness and sharpness adjustments.
Result image:
Required image:
Influencing parameters:
bool Rx::LFR::CCudaCompute::Compute_RefocusBasic | ( | ) |
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)
bool Rx::LFR::CCudaCompute::Compute_TotalFocus | ( | LF::ESpace::ID | eSpace = LF::ESpace::View_VirtualUndistorted | ) |
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)
eSpace | (Optional) [in] The space. This is LF::ESpace::View_VirtualUndistorted or LF::ESpace::View_Object_Orthographic. |
bool Rx::LFR::CCudaCompute::Compute_TotalFocusGlobal | ( | LF::ESpace::ID | eSourceSpace, |
LF::ESpace::ID | eTargetSpace | ||
) |
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)
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. |
CRxImageFormat Rx::LFR::CCudaCompute::CreateFocusImageFormat | ( | const CRxImageFormat & | xRawFormat, |
bool | bForceLandscape | ||
) | const |
Creates the image format of the refocus and the total focus image. This considers the Focus_ImageDivisor parameter.
xRawFormat | [in] The raw image format. |
bForceLandscape | [in] True to force landscape. Otherwise the calibration is used. |
void Rx::LFR::CCudaCompute::Download | ( | EImage::ID | eImgID, |
CRxImage & | xImage | ||
) | const |
Downloads the image defined by eImgID.
eImgID | [in] Identifier for the image. |
xImage | [out] the Image. |
void Rx::LFR::CCudaCompute::DownloadPointCloud | ( | LF::ESpace::ID | eSpaceID, |
CRxArrayDouble & | adPointPosition, | ||
CRxArrayDouble & | adPointColor | ||
) |
Downloads the point cloud.
eSpaceID | [in] Identifier for the space. |
adPointPosition | [out] The ad point position. |
adPointColor | [out] The ad point color. |
void Rx::LFR::CCudaCompute::Free | ( | EImage::ID | eImgID | ) |
Frees memory used by image defined by eImgID. This invalidates the image.
eImgID | [in] The image ID. |
void Rx::LFR::CCudaCompute::FreeAll | ( | ) |
Frees the memory used by all images. This invalidates all images.
const void* Rx::LFR::CCudaCompute::GetCameraFormat | ( | ) | const |
Gets the pointer to the internal camera format. Only for internal purposes.
CParameters<Params::ECudaCompute::ID>& Rx::LFR::CCudaCompute::GetComputeParams | ( | ) |
Gets compute parameters.
const CParameters<Params::ECudaCompute::ID>& Rx::LFR::CCudaCompute::GetComputeParams | ( | ) | const |
Gets compute parameters.
const CCudaDevice& Rx::LFR::CCudaCompute::GetCudaDevice | ( | ) | const |
Gets the CUDA device that has been set by calling SetCudaDevice. Throws an exception if not set yet.
size_t Rx::LFR::CCudaCompute::GetDevicePointerPitch | ( | EImage::ID | eImgID | ) | const |
Gets device pointer pitch.
eImgID | [in] The image ID. |
void* Rx::LFR::CCudaCompute::GetImageDevicePointer | ( | EImage::ID | eImgID | ) | const |
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.
eImgID | [in] The image ID. |
const CRxImageFormat& Rx::LFR::CCudaCompute::GetImageFormat | ( | EImage::ID | eImgID | ) | const |
Gets the image format of the image defined by the given ID.
eImgID | [in] The image ID. |
|
inlineinherited |
Gets the non constant implementation.
|
inlineinherited |
Gets the constant implementation.
void* Rx::LFR::CCudaCompute::GetInterface | ( | Interfaces::ECudaCompute::ID | eData | ) |
Gets the cuda compute interface.
eData | [in] The interface type. |
const void* Rx::LFR::CCudaCompute::GetInterface | ( | Interfaces::ECudaCompute::ID | eData | ) | const |
Gets the cuda compute interface.
eData | [in] The interface type. |
const void* Rx::LFR::CCudaCompute::GetProjectionSystem | ( | ) | const |
Gets the pointer to the internal projection system. Only for internal purposes.
void Rx::LFR::CCudaCompute::GetRawImagePointsFromVirtualMM_s | ( | CRxArray< double > & | adRawPoints, |
double | dSrcX, | ||
double | dSrcY, | ||
double | dSrcZ, | ||
int | iRadiusLU | ||
) | const |
Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses.
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 | The X coordinate of the source point in virtual space in millimeters. |
dSrcY | The Y coordinate of the source point in virtual space in millimeters. |
dSrcZ | The Z coordinate of the source point in virtual space in millimeters. |
iRadiusLU | 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. |
void Rx::LFR::CCudaCompute::GetRawImagePointsFromVirtualMM_s | ( | CRxArray< double > & | adRawPoints, |
double | dSrcX, | ||
double | dSrcY, | ||
double | dSrcZ, | ||
int | iRadiusLU, | ||
int | iMinAllowedDistanceToLensBorderPX | ||
) | const |
Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses.
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 | The X coordinate of the source point in virtual space in millimeters. |
dSrcY | The Y coordinate of the source point in virtual space in millimeters. |
dSrcZ | The Z coordinate of the source point in virtual space in millimeters. |
iRadiusLU | 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 | The minimal allowed distance to lens border in pixels. |
CParameters<Params::EViewCudaCompute::ID>& Rx::LFR::CCudaCompute::GetViewParams | ( | ) |
Gets view parameters.
const CParameters<Params::EViewCudaCompute::ID>& Rx::LFR::CCudaCompute::GetViewParams | ( | ) | const |
Gets view parameters.
void Rx::LFR::CCudaCompute::GetVirtualMM_sFromRawImagePoint | ( | double & | dTrgX, |
double & | dTrgY, | ||
double & | dTrgZ, | ||
double | dSrcX, | ||
double | dSrcY, | ||
double | dSrcZ | ||
) | const |
Projects from the given pixel position in the raw image with the given standard depth through the micro lenses into virtual space.
dTrgX | [in,out] The X coordinate of the target point in virtual space in mm. |
dTrgY | [in,out] The Y coordinate of the target point in virtual space in mm. |
dTrgZ | [in,out] The Z coordinate of the target point in virtual space in mm. |
dSrcX | The X coordinate of the source point in pixels in raw image format. |
dSrcY | The Y coordinate of the target point in pixels in raw image format. |
dSrcZ | The Z coordinate of the target point in standard depths (Between 0.5 and 1.0) |
bool Rx::LFR::CCudaCompute::HasCudaDevice | ( | ) | const |
Queries if a CUDA device has been set.
|
inlineinherited |
Queries if this object has the given interface.
eInterface | [in] The interface to query. |
bool Rx::LFR::CCudaCompute::IsDataValid | ( | EImage::ID | eImage | ) | const |
Queries of the data for the given image is valid and up-to-date.
eImage | The image. |
bool Rx::LFR::CCudaCompute::IsValid | ( | EImage::ID | eImgID | ) | const |
Query if the image defined by eImgID is valid.
eImgID | [in] Identifier for the image. |
CCudaCompute& Rx::LFR::CCudaCompute::operator= | ( | CCudaCompute && | xCudaCompute | ) |
Move assignment operator.
xCudaCompute | [in,out] The cuda compute instance. |
void Rx::LFR::CCudaCompute::Project | ( | CRxArray< double > & | adTrgPoints, |
const CRxArray< double > & | adSrcPoints, | ||
LF::ESpace::ID | eTrgSpace, | ||
LF::ESpace::ID | eSrcSpace | ||
) | const |
Projects an array of points from the given source space into the given target space.
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. |
void Rx::LFR::CCudaCompute::Project | ( | CRxArray< double > & | adTrgPoints, |
const CRxArray< double > & | adSrcPoints, | ||
LF::ESpace::ID | eTrgSpace, | ||
LF::ESpace::ID | eSrcSpace, | ||
bool | bTrgVD, | ||
bool | bSrcVD | ||
) | const |
Projects an array of points from the given source space into the given target space.
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. |
void Rx::LFR::CCudaCompute::Project | ( | CRxArray< double > & | adTrgPoints, |
const CRxArray< double > & | adSrcPoints, | ||
LF::ESpace::ID | eTrgSpace, | ||
LF::ESpace::ID | eSrcSpace, | ||
const CRxImageFormat & | xFormat | ||
) | const |
Projects an array of points from the given source space into the given target space.
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. |
void Rx::LFR::CCudaCompute::Project | ( | CRxArray< double > & | adTrgPoints, |
const CRxArray< double > & | adSrcPoints, | ||
LF::ESpace::ID | eTrgSpace, | ||
LF::ESpace::ID | eSrcSpace, | ||
const CRxImageFormat & | xFormat, | ||
bool | bTrgVD, | ||
bool | bSrcVD | ||
) | const |
Projects an array of points from the given source space into the given target space.
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. |
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. |
bool Rx::LFR::CCudaCompute::ProjectInto3DSpace | ( | LF::ESpace::ID | eSpace | ) |
Project into 3D space.
Result image:
eSpace | [in] The space to project into. This is LF::ESpace::Virtual or LF::ESpace::Object. |
void Rx::LFR::CCudaCompute::ReinitializeDepthDB | ( | ) |
Reinitializes the depth database.
This can be useful when calling Compute_DepthMap after changing the ray depth image manually.
void Rx::LFR::CCudaCompute::RemoveComputationFilterMask | ( | ) |
Removes the computation filter mask set by SetComputationFilterMask.
void Rx::LFR::CCudaCompute::ResetReferencePlane | ( | ) |
Resets the reference plane.
void Rx::LFR::CCudaCompute::ResizeImage | ( | CRxImage & | xTrgImg, |
const CRxImage & | xSrcImg, | ||
int | iDivisor | ||
) |
Resize the given source image and store the result in the given target image using the given divisor.
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. |
void Rx::LFR::CCudaCompute::SetComputationFilterMask | ( | const CRxImage & | xImage | ) |
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::Interop::Runtime28::EPixelType::Lum and a data type of Rx::Interop::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.
xImage | [in] The computation filter mask image. |
void Rx::LFR::CCudaCompute::SetComputationFilterMask | ( | const CRxString & | sxFilename | ) |
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::Interop::Runtime28::EPixelType::Lum and a data type of Rx::Interop::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.
sxFilename | [in] The image file to load. |
void Rx::LFR::CCudaCompute::SetCudaDevice | ( | const CCudaDevice & | xCudaDevice | ) |
Sets the CUDA device that allocates the memory required for the operations and that runs the algorithms.
xCudaDevice | [in] The CUDA device. |
void Rx::LFR::CCudaCompute::UpdateTexture | ( | EImage::ID | eImgID, |
COpenGlInterop & | xOpenGL, | ||
bool | bCreateMipmaps = false |
||
) |
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.
eImgID | [in] The image ID. |
xOpenGL | [in] The OpenGlInterop class. |
bCreateMipmaps | [in] True to create mipmaps of the texture. |
void Rx::LFR::CCudaCompute::Upload | ( | EImage::ID | eImgID, |
const CRxImage & | xImage | ||
) |
Uploads the given image onto the CUDA device.
eImgID | [in] Identifier for the image. |
xImage | [in] The image. |
void Rx::LFR::CCudaCompute::UploadRawImage | ( | const CRxImage & | xSrcImg | ) |
Uploads the given image as the new raw image of all computations.
xSrcImg | [in] The source image. |