| Bsoft 1.9 Bernard's software package

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions
img_background.h File Reference

Header file for manipulating image backgrounds. More...

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <ctype.h>`
`#include <unistd.h>`
`#include <math.h>`
`#include <time.h>`
`#include "rwimg.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_shift_background (Bimage *p, double background)
| Sets the background for each sub-image to a given value. More...

## Detailed Description

Header file for manipulating image backgrounds.

Author
  Bernard Heymann

Date
  Created: 20000430 Modified: 20110628

Definition in file img_background.h.

## Function Documentation

Bimage* img_background_mask | ( | Bimage * | p | ) |

Calculates a background mask.

Parameters

  *p | image.

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

  *p | image.
  n | sub-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

  *p | 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 153 of file img_background.cpp.

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

Calculates the background for one sub-image.

Parameters

  *p | image.
  *pmask | foreground mask.
  n | sub-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

  *p | image.
  *pmask | foreground 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

  *p | image.
  n | sub-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

  *p | 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 324 of file img_background.cpp.

int img_correct_background | ( | Bimage * | p,
|  | Bimage * | pmask
| ) |  |

Corrects the background for each sub-image.

Parameters

  *p | image.
  *pmask | foreground 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

  *p | image.
  background | new 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

  *p | image.

Returns
  int 0, <0 on error.

      The background is taken from the sub-image structures.

Definition at line 402 of file img_background.cpp.