Function:FPNCorrection

From CUVI Wiki

Removes fixed point camera noise from the image using a more robust method than Function:fpn. In addition to black image, the function also takes a white image and gain value to remove noise from the input image using the internal formula: dst[i] = Saturate(gain * (src[i]- black[i])/(white[i] - black[i]),0,maxValue);

Function

CuviStatus FPNCorrection(const CuviImage& src,
                         CuviImage& dst,
                         const CuviImage& white, 
                         const CuviImage& black, 
                         Cuvi32f gain,
                         const CuviStream& stream)

Parameters

Name Type Description
src CuviImage& Source Image with noise
dst CuviImage& Resultant Image with no noise
white CuviImage& White image from camera
black CuviImage& Black image from camera with closed shutter
gain Cuvi32f Gain value for white correction
stream CuviStream& GPU stream ID for execution

Image Type Support

output input blackImage
8uC1 8uC1 8uC1
16uC1 16uC1 16uC1
8uC3 8uC3 8uC3
16uC3 16uC3 16uC3


Example

CuviImage src= cuvi::io::loadImage(path);
CuviImage black= cuvi::io::loadImage(path);
CuviImage white= cuvi::io::loadImage(path);
CuviImage src;
Cuvi32f gain = 1.15f;

//fpn
cuvi::colorOperations::FPNCorrection(const CuviImage& src,
                                     CuviImage& dst,
                                     const CuviImage& white,
                                     const CuviImage& black, 
                                     Cuvi32f gain)