Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
img_background.cpp File Reference

Library routines for manipulating image backgrounds. More...

#include "rwimg.h"
#include "img_background.h"
#include "Complex.h"
#include "Matrix.h"
#include "utilities.h"

Go to the source code of this file.

Functions

Bimage * img_background_mask (Bimage *p)
 Calculates a background mask. More...
 
int img_calculate_background (Bimage *p, int n)
 Calculates the background for one sub-image. More...
 
int img_calculate_background (Bimage *p)
 Calculates the background for each sub-image. More...
 
int img_calculate_background (Bimage *p, Bimage *pmask, int n)
 Calculates the background for one sub-image. More...
 
int img_calculate_background (Bimage *p, Bimage *pmask)
 Calculates the background for each sub-image. More...
 
int img_correct_background (Bimage *p, int n)
 Corrects the background for one sub-image. More...
 
int img_correct_background (Bimage *p)
 Corrects the background for each sub-image. More...
 
int img_correct_background (Bimage *p, Bimage *pmask)
 Corrects the background for each sub-image. More...
 
int img_subtract_background (Bimage *p)
 Subtracts the background for each sub-image. More...
 
int img_subtract_background2 (Bimage *p)
 Subtracts the background for each sub-image. More...
 
int img_shift_background (Bimage *p, double background)
 Sets the background for each sub-image to a given value. More...
 

Variables

int verbose
 

Detailed Description

Library routines for manipulating image backgrounds.

Author
Bernard Heymann
Date
Created: 19990321
Modified: 20131122

Definition in file img_background.cpp.

Function Documentation

Bimage* img_background_mask ( Bimage *  p)

Calculates a background mask.

Parameters
*pimage.
Returns
Bimage* mask.
The background mask is taken as the region outside the
circle or sphere enclosed by the image.

Definition at line 27 of file img_background.cpp.

int img_calculate_background ( Bimage *  p,
int  n 
)

Calculates the background for one sub-image.

Parameters
*pimage.
nsub-image.
Returns
int 0, <0 on error.
The background is taken as the average of the values outside the
circle or sphere enclosed by the image.

Definition at line 89 of file img_background.cpp.

int img_calculate_background ( Bimage *  p)

Calculates the background for each sub-image.

Parameters
*pimage.
Returns
int 0, <0 on error.
The background is taken as the average of the values outside the
circle or sphere enclosed by the image.

Definition at line 153 of file img_background.cpp.

int img_calculate_background ( Bimage *  p,
Bimage *  pmask,
int  n 
)

Calculates the background for one sub-image.

Parameters
*pimage.
*pmaskforeground mask.
nsub-image.
Returns
int 0, <0 on error.
The background is taken as the average of the values outside the
circle or sphere enclosed by the image.
If the mask is specified, it is used to define the part of the 
image to be used for background calculation (where the mask is zero).

Definition at line 188 of file img_background.cpp.

int img_calculate_background ( Bimage *  p,
Bimage *  pmask 
)

Calculates the background for each sub-image.

Parameters
*pimage.
*pmaskforeground mask.
Returns
int 0, <0 on error.
The background is taken as the average of the values outside the
circle or sphere enclosed by the image.
If the mask is specified, it is used to define the part of the 
image to be used for background calculation (where the mask is zero).

Definition at line 227 of file img_background.cpp.

int img_correct_background ( Bimage *  p,
int  n 
)

Corrects the background for one sub-image.

Parameters
*pimage.
nsub-image.
Returns
int 0, <0 on error.
The background is taken as the average of the values outside the
circle or sphere enclosed by the image.

Definition at line 261 of file img_background.cpp.

int img_correct_background ( Bimage *  p)

Corrects the background for each sub-image.

Parameters
*pimage.
Returns
int 0, <0 on error.
The background is taken as the average of the values outside the
circle or sphere enclosed by the image.

Definition at line 324 of file img_background.cpp.

int img_correct_background ( Bimage *  p,
Bimage *  pmask 
)

Corrects the background for each sub-image.

Parameters
*pimage.
*pmaskforeground mask.
Returns
int 0.
The background is taken as the average of the values outside the
circle or sphere enclosed by the image.
If the mask is specified, it is used to define the foreground of the 
image. The correction then includes the area outside the circle or 
sphere as well as the area where the mask is zero.

Definition at line 362 of file img_background.cpp.

int img_shift_background ( Bimage *  p,
double  background 
)

Sets the background for each sub-image to a given value.

Parameters
*pimage.
backgroundnew background value.
Returns
int 0, <0 on error.
The background is taken as the average of the values outside the
circle or sphere enclosed by the image.

Definition at line 471 of file img_background.cpp.

int img_subtract_background ( Bimage *  p)

Subtracts the background for each sub-image.

Parameters
*pimage.
Returns
int 0, <0 on error.
The background is taken from the sub-image structures.

Definition at line 402 of file img_background.cpp.

int img_subtract_background2 ( Bimage *  p)

Subtracts the background for each sub-image.

Parameters
*pimage.
Returns
int 0, <0 on error.
The background is taken from the sub-image structures.

Definition at line 415 of file img_background.cpp.

Variable Documentation

int verbose