Menu

Basic Structures

Perrotti

TfiSize

Simple record to inform the size of two-dimensional structures. When is relevant the classes return this record by property iSize.

type
  TfiSize = record
    Width, Height: integer;
  end;

Function fiSize can be used to make a new record:
function fiSize(Width, Height: integer): TfiSize;

TFloatPoint

Record to store a float point.

type
  TFloatPoint = record
    X, Y: single;
  end;

Function FloatPoint can be used to make a new float point. Function RoundPoint round X and Y values to make a Delphi TPoint record:

function FloatPoint(const X: single; const Y: single): TFloatPoint;
function RoundPoint(const fpt: TFloatPoint): TPoint;

Channel maps

The channels can be 8, 16 or 32 bits deep. Each channel is stored in a two-dimensional array which is called 'map' by package. A map is actually an array of rows, so you can access the entire map or one row at a time. Below the declarations of the lines and maps to the types of channels supported at this time.

type
  // 8 bits map
  PByteArray = ^TByteArray;
  TByteArray = array [0..MaxListSize-1] of byte;
  PByteMap = ^TByteMap;
  TByteMap = array [0..MaxListSize-1] of PByteArray;

  // 16 bits map
  PSIntArray = ^TSIntArray;
  TSIntArray = array [0..MaxListSize-1] of Smallint;
  PSIntMap = ^TSIntMap;
  TSIntMap = array [0..MaxListSize-1] of PSIntArray;

  // 32 bits map
  PFloatArray = ^TFloatArray;
  TFloatArray = array [0..MaxListSize-1] of single;
  PFloatMap = ^TFloatMap;
  TFloatMap = array [0..MaxListSize-1] of PFloatArray;

When is necessary, the constants below are use to inform the channel depth:

const
  // Channel's depth
  fi_U8  = 1;  // unsigned 8 bits (byte)
  fi_S16 = 2;  // signed 16 bits (smallint)
  fi_F32 = 3;  // float 32 bits (single)

Histograms

The histogram shows the intensities distribution of the image’s pixels, or in the case of channel, components of channel. This implementation only supports histograms for 8-bit channels. Histograms are discrete by nature; it makes no sense to try to produce a histogram of a float channel where each element can have any value. So, unless someone suggests some criteria (and usefulness), histograms for 32-bit channels are not in plans. In 16-bit channels, histograms are theoretically possible, but still need some practical use for them. Suggestions about it are welcome.
Below the array type defined to histograms:

type
  PHistogram = ^THistogram;
  THistogram = array[0..255] of integer;

Projections

Projections are a simple and powerful way to perform morphological analysis on images. A vertical projection is the sum of columns of the channel or region. A horizontal projection is the sum of rows. To store the vertical and horizontal projections this package defines the array type below:

type
  PProjection = ^TProjection;
  TProjection = array [0..MaxListSize-1] of integer;

Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.