|
I32 | integral_image (image *src, image *dst) |
| Computes the Integral Image according to Viola & Jones, 2002. More...
|
|
I32 | fread_image (char *path, image *img) |
| Reads Image Content from a Bitmap File (BMP). More...
|
|
I32 | fwrite_image (char *path, image *img) |
| Writes Image Content to a Bitmap File (BMP). More...
|
|
I32 | fwrite_image_vector_color (char *path, image *imgVec, I32 maxAngle) |
| Writes Vector Image Content to a Color Bitmap File (BMP). More...
|
|
I32 | fread_image_size (char *path, I32 *dx, I32 *dy, I32 *bpp) |
|
I32 | ImgConvert_I16_U8 (image *Src16, image *Dst) |
| Scales and Converts Image Content from 16 to 8 Bits. More...
|
|
I32 | ImgConvert_I32_U8 (image *Src32, image *Dst) |
| Scales and Converts Image Content from 32 to 8 Bits. More...
|
|
I32 | vc_assign_component (image *src, image *cmp, I32 component) |
| Assigns a Reference to a Component of a Multi-Component Image to an Image Variable. More...
|
|
I32 | get_component (image *src, image *dst, I32 component) |
| Copies a Component out of a Multi-Component Image into a Grey Image. More...
|
|
Functions in this group convert image data to another representation, for example encoding images to JPEG.
Color image processing functions however, for example functions converting RGB valued pixel information to HSV, can be found at Color Image Processing.
◆ integral_image()
Performs an integral image Computation according to Viola & Jones, 2002. This function works for all box integrals up to a size of 4096x4096 (32bit destination image) or 16x16 (16bit destination image) even if the source image is larger than that. This is achieved by "computing through the overflow" i.e. if U32 is used, the result will still be correct even if several overflows occured, as long as the size of the final integral is less than the number space of U32.
- Parameters
-
src | Source Image Pointer, Type: IMAGE_GREY. |
dst | Destination Image Pointer, Type: IMAGE_GREY32, IMAGE_GREY16. |
- Return values
-
ERR_TYPE | if dst image is not of Type IMAGE_GREY32 or IMAGE_GREY16 or src is no Grey Image. |
ERR_MEMORY | iff Memory could not be allocated. |
ERR_NONE | on Success. |
◆ fread_image()
I32 fread_image |
( |
char * |
path, |
|
|
image * |
img |
|
) |
| |
This function reads the bitmap image (BMP) from the file specified by path
and stores it in image variable img
. Image types supported are IMAGE_GREY and IMAGE_RGB. BMP images must be stored in 8 Bit grey- or 24 Bit true-color mode. If the type of the file data does not fit the image variable type, the function returns with error code ERR_FORMAT. If the BMP image is larger than the image variable, the image size is truncated to the size of the image variable.
If you want to generate a compatible bitmap file by yourself, e.g. in Gimp, do use the grayscale mode, do not use run length compression (Run-Length encoded), do not write color space information (see: Compatibility Options) and choose the bit depth 24: R8 G8 B8 (see: Advanced Options).
- Parameters
-
path | Source File. |
img | Destination Image (allocated) Pointer, Type: IMAGE_GREY or IMAGE_RGB. |
- Memory Consumption
- None.
- See also
- fwrite_image().
- Return values
-
ERR_TYPE | if Output Image is not of Type IMAGE_RGB or IMAGE_GREY. |
ERR_OPEN | if Requested File could not be opened for Reading. |
ERR_FSIGN | if BMP File Format is not in Microsoft Windows Flavour. |
ERR_INCONS | if Bitmap Header is not of Type BITMAPINFOHEADER or Pixel Data Offset exceeds Header Size. |
ERR_FFMT,ERR_FORMAT | if Pixel Data is not of 8 for Grey or 24 for RGB Bit Size. |
ERR_FFMT | if Bitmap Data is compressed. |
ERR_NONE | on Success. |
◆ fwrite_image()
I32 fwrite_image |
( |
char * |
path, |
|
|
image * |
img |
|
) |
| |
This function writes the image defined by image variable img
as a bitmap file (BMP) to the file specified by path
. Image types supported are IMAGE_GREY and IMAGE_RGB. Images are stored in 8 Bit grey- or 24 Bit true-color mode depending on the type of the image variable.
- Parameters
-
- Memory Consumption
- None.
- See also
- fread_image().
- Return values
-
ERR_TYPE | if Input Image is not of Type IMAGE_RGB or IMAGE_GREY. |
ERR_OPEN | if Requested File could not be opened for Writing. |
ERR_NONE | on Success. |
◆ fwrite_image_vector_color()
I32 fwrite_image_vector_color |
( |
char * |
path, |
|
|
image * |
imgVec, |
|
|
I32 |
maxAngle |
|
) |
| |
This function writes the vector image defined by image variable imgVec
as a color bitmap file (BMP) to the file specified by path
. While the values at the st
component of the imgVec
represents the brightness of its pixel, the color represents its ccmp1
component value: Until maxAngle
is reached (for example for gradient_3x3() a value of 256 or for gradient_3x3_Thresh() a value of 128), the color cycles through: Red -> Orange -> Yellow -> Green -> Cyan -> Blue -> Violet -> Pink -> Red.
The image is stored in 24 Bit true-color mode.
- Note
- The image may be very dark, so it may be needed to be lightened up a bit.
- Parameters
-
path | The Destination File. |
imgVec | Source Image Pointer, Type: IMAGE_VECTOR. |
- Memory Consumption
- None.
- See also
- fwrite_image().
- Return values
-
ERR_TYPE | if image is not of type IMAGE_VECTOR. |
ERR_MEMORY | on memory allocation failure. |
- Returns
- any error of the fwrite_image() function.
◆ fread_image_size()
I32 fread_image_size |
( |
char * |
path, |
|
|
I32 * |
dx, |
|
|
I32 * |
dy, |
|
|
I32 * |
bpp |
|
) |
| |
Reads Image dimensions from a BMP File.
This function reads the image width and height of a BMP file.
- Parameters
-
path | Source File. |
dx,dy | Size. |
bpp | Bits per Pixel: 8 bit is grey/indexed, 24 bit is color. |
- Return values
-
ERR_OPEN | if Requested File could not be opened for Reading. |
ERR_FSIGN | if BMP File Format is not in Microsoft Windows Flavour. |
ERR_INCONS | if Bitmap Header is not of Type BITMAPINFOHEADER or Pixel Data Offset exceeds Header Size. |
ERR_NONE | on Success. |
◆ ImgConvert_I16_U8()
- Parameters
-
- Returns
- Standard Error Code.
◆ ImgConvert_I32_U8()
This function scales and converts an image from IMAGE_GREY32 to IMAGE_GREY. The maximum absolute grey value in Src32
is calculated and used for the scaling transformation according to the following formula:
The function may be used to display 32 Bit Hough transform images.
- Parameters
-
- Returns
- Standard Error Code.
◆ vc_assign_component()
The function assigns a reference to a component (e.g. a colour channel) of a multi-component image to an image variable of Type IMAGE_GREY.
- Note
- Since image data is not copied, changes done to the
coi
image will operate on the src
image's component!
- Parameters
-
src | Source Image (Various Types). |
coi | Referring Image of Type IMAGE_GREY. |
component | Number of Component (0, 1, 2). |
- Returns
- Standard Error Code.
◆ get_component()
The function copies a component (e.g. a colour channel) out of a multi-component image into an image of Type IMAGE_GREY.
- Parameters
-
src | Source Image (Various Types). |
dst | Destination Image of Type IMAGE_GREY. |
component | Number of Component (0, 1, 2). |
- Returns
- Standard Error Code.