Module providing color correction of the camera view.
Data Structures | |
| struct | dwColorCorrectParameters |
| Configuration parameters of the color correction module. More... | |
Typedefs | |
| typedef struct dwColorCorrectObject * | dwColorCorrectHandle_t |
| Handles representing the Color Correction interface. More... | |
Functions | |
| DW_API_PUBLIC dwStatus | dwColorCorrect_correctByReferenceView (dwImageHandle_t image, uint32_t curCameraIdx, float32_t factor, dwColorCorrectHandle_t obj) |
| Applies global color correction on the given image. More... | |
| DW_API_PUBLIC dwStatus | dwColorCorrect_getCUDAStream (cudaStream_t *stream, dwColorCorrectHandle_t obj) |
| Returns the CUDA stream on which the calculations of the color correction are executed. More... | |
| DW_API_PUBLIC dwStatus | dwColorCorrect_initializeFromProjectionMap (dwColorCorrectHandle_t *obj, dwContextHandle_t ctx, const uint32_t cameraCount, const dwVector2f *pProjToGroundMap, const dwColorCorrectParameters *params) |
| Creates and initializes the color correction module using the existing reprojection matrix that reprojects cameras onto a common plane (i.e., groundplane) and then extracts color information based on the overlapping regions. More... | |
| DW_API_PUBLIC dwStatus | dwColorCorrect_initializeFromRig (dwColorCorrectHandle_t *obj, const dwColorCorrectParameters *parameters, dwRigHandle_t rigConfig, dwContextHandle_t ctx) |
| Creates and initializes the color correction module using dwRig. More... | |
| DW_API_PUBLIC dwStatus | dwColorCorrect_release (dwColorCorrectHandle_t obj) |
| This method releases all resources associated with a color_correct object. More... | |
| DW_API_PUBLIC dwStatus | dwColorCorrect_setCUDAStream (cudaStream_t stream, dwColorCorrectHandle_t obj) |
| Sets the CUDA stream to run the required calculations of the color correction. More... | |
| DW_API_PUBLIC dwStatus | dwColorCorrect_setReferenceCameraView (const dwImageHandle_t referenceImage, uint32_t cameraIdx, dwColorCorrectHandle_t obj) |
| This method adds reference view to color correction; the color of all the other views are corrected based on this view. More... | |
| struct dwColorCorrectParameters |
| typedef struct dwColorCorrectObject* dwColorCorrectHandle_t |
Handles representing the Color Correction interface.
Definition at line 63 of file ColorCorrection.h.
| DW_API_PUBLIC dwStatus dwColorCorrect_correctByReferenceView | ( | dwImageHandle_t | image, |
| uint32_t | curCameraIdx, | ||
| float32_t | factor, | ||
| dwColorCorrectHandle_t | obj | ||
| ) |
Applies global color correction on the given image.
This function does correction based on statistic data collected from the whole reprojected topview.
| [in,out] | image | Image to correct. The color correction happens in-place. |
| [in] | curCameraIdx | Camera index of the given image in the specified rig. |
| [in] | factor | Blending weight, float number between [0.f, 1.f] 0.f means using the original image and no color correction 1.f means using full weight of reference color. |
| [in] | obj | Handle to the color_correct class. |
| DW_API_PUBLIC dwStatus dwColorCorrect_getCUDAStream | ( | cudaStream_t * | stream, |
| dwColorCorrectHandle_t | obj | ||
| ) |
Returns the CUDA stream on which the calculations of the color correction are executed.
| [out] | stream | Pointer to the CUDA stream to return. |
| [in] | obj | Handle to the color_correct class. |
| DW_API_PUBLIC dwStatus dwColorCorrect_initializeFromProjectionMap | ( | dwColorCorrectHandle_t * | obj, |
| dwContextHandle_t | ctx, | ||
| const uint32_t | cameraCount, | ||
| const dwVector2f * | pProjToGroundMap, | ||
| const dwColorCorrectParameters * | params | ||
| ) |
Creates and initializes the color correction module using the existing reprojection matrix that reprojects cameras onto a common plane (i.e., groundplane) and then extracts color information based on the overlapping regions.
| [out] | obj | The module handle is returned here. |
| [in] | ctx | Handle to the context under which it is created. |
| [in] | cameraCount | Number of cameras to correct. |
| [in] | pProjToGroundMap | An array of pixel maps mapping from ground plane into each camera's image plane. The given float array contains cameraCount*projectionWidth*projectionHeight*2 float numbers. Start address of the k-th camera's data is camera[k] = pProjToGroundMap + k*projectWidth*projectHeight*2. Each float pair at index (i,j) for a camera k represents a pixel coordinate in camera's image plane at position: x = pProjToGroundMap[camera[k] + (j * projectionWidth + i) * 2], y = pProjToGroundMap[camera[k] + (j * projectionWidth + i) * 2 + 1] Out(k, i, j) = CameraSpaceImage(k, x, y) is a ground plane projection image of the k-th camera. |
| [in] | params | Configuration parameters of the camera system to set up correction algorithms. |
| DW_API_PUBLIC dwStatus dwColorCorrect_initializeFromRig | ( | dwColorCorrectHandle_t * | obj, |
| const dwColorCorrectParameters * | parameters, | ||
| dwRigHandle_t | rigConfig, | ||
| dwContextHandle_t | ctx | ||
| ) |
Creates and initializes the color correction module using dwRig.
All camera relationships are extracted from the provided rig. Color correction is performed by reprojecting all cameras onto a common plane (i.e., groundplane) and then by extracting color information based on the overlapping regions.
| [out] | obj | The module handle is returned here. |
| [in] | parameters | Configuration parameters of the camera system to setup correction algorithms. |
| [in] | rigConfig | An opening dwRig handle. |
| [in] | ctx | Handle to the context under which it is created. |
| DW_API_PUBLIC dwStatus dwColorCorrect_release | ( | dwColorCorrectHandle_t | obj | ) |
This method releases all resources associated with a color_correct object.
| [in] | obj | The object handle to release. |
| DW_API_PUBLIC dwStatus dwColorCorrect_setCUDAStream | ( | cudaStream_t | stream, |
| dwColorCorrectHandle_t | obj | ||
| ) |
Sets the CUDA stream to run the required calculations of the color correction.
| [in] | stream | CUDA stream that is used during color correction. |
| [in] | obj | Handle to the color_correct class. |
| DW_API_PUBLIC dwStatus dwColorCorrect_setReferenceCameraView | ( | const dwImageHandle_t | referenceImage, |
| uint32_t | cameraIdx, | ||
| dwColorCorrectHandle_t | obj | ||
| ) |
This method adds reference view to color correction; the color of all the other views are corrected based on this view.
The reference image is not modified.
| [in] | cameraIdx | Index of the reference camera in the provided camera rig. |
| [in] | referenceImage | Image of the reference camera. |
| [in] | obj | Handle to the color_correct class. |