CR2RE Pipeline Reference Manual 1.6.2
Functions
Cr2res_bpm

Functions

cpl_mask * cr2res_bpm_compute (cpl_image *in, cr2res_bpm_method method, double kappa, double lines_ratio, int clean_flag)
 The BPM computation with min/max threshold.
 
int cr2res_bpm_count (cpl_image *bpm, cr2res_bpm_type type)
 Count BPM of a given type.
 
cpl_image * cr2res_bpm_from_mask (cpl_mask *mask, cr2res_bpm_type type)
 Create a BPM from a mask.
 
int cr2res_bpm_set_and_correct_image (cpl_image *in, const char *bpm, int chip, int correct)
 Set the BPM and optionally apply the correction to an image.
 
cpl_mask * cr2res_bpm_extract_mask (const cpl_image *bpm_ima, cr2res_bpm_type bpm_type)
 Extract a mask from a BPM image.
 
int cr2res_bpm_add_mask (cpl_image *bpm_ima, cpl_mask *bpm, int bpm_code)
 Add a mask to a BPM image with a dedicated code

 

Detailed Description

Function Documentation

◆ cr2res_bpm_add_mask()

int cr2res_bpm_add_mask ( cpl_image *  bpm_ima,
cpl_mask *  bpm,
int  bpm_code 
)

Add a mask to a BPM image with a dedicated code

Parameters
bpm_imaThe input BPM image
bpmThe mask to add
bpm_codeCR2RES_BPM_DARK, CR2RES_BPM_FLAT,...
Returns
0 if ok, -1 otherwise

Definition at line 287 of file cr2res_bpm.c.

◆ cr2res_bpm_compute()

cpl_mask * cr2res_bpm_compute ( cpl_image *  in,
cr2res_bpm_method  method,
double  kappa,
double  lines_ratio,
int  clean_flag 
)

The BPM computation with min/max threshold.

Parameters
inThe input image
methodCR2RES_BPM_GLOBAL_STATS CR2RES_BPM_LOCAL_STATS CR2RES_BPM_RUNNING_FILTER
kappaThe kappa value
clean_flagClean the image using the computed BPM
lines_ratioThe maximum ratio of bad pixels per line
Returns
the BPM

Definition at line 78 of file cr2res_bpm.c.

◆ cr2res_bpm_count()

int cr2res_bpm_count ( cpl_image *  bpm,
cr2res_bpm_type  type 
)

Count BPM of a given type.

Parameters
bpmthe BPM
typethe bad pixel type
Returns
the count or -1 in error case

Definition at line 148 of file cr2res_bpm.c.

◆ cr2res_bpm_extract_mask()

cpl_mask * cr2res_bpm_extract_mask ( const cpl_image *  bpm_ima,
cr2res_bpm_type  bpm_type 
)

Extract a mask from a BPM image.

Parameters
bpm_imaBPM image to extract from
bpm_typeCan use a bitwise combination
Returns
The newly allocated mask

Definition at line 247 of file cr2res_bpm.c.

◆ cr2res_bpm_from_mask()

cpl_image * cr2res_bpm_from_mask ( cpl_mask *  mask,
cr2res_bpm_type  type 
)

Create a BPM from a mask.

Parameters
maskthe input mask
typethe bad pixel type
Returns
the BPM or NULL in error case

Definition at line 175 of file cr2res_bpm.c.

◆ cr2res_bpm_set_and_correct_image()

int cr2res_bpm_set_and_correct_image ( cpl_image *  in,
const char *  bpm,
int  chip,
int  correct 
)

Set the BPM and optionally apply the correction to an image.

Parameters
inthe input image
bpmthe BPM
chipthe chip number (1 to CR2RES_NB_DETECTORS)
correctionflag to apply the correction
Returns
0 if everything is ok, -1 otherwise

Definition at line 199 of file cr2res_bpm.c.

References cr2res_io_load_BPM().

Referenced by cr2res_calib_image().