Vector Operations

Extracting 1-dimensional data from an image generates linear sets of data that are handled as vectors. Subsequent operations are fast thanks to the reduced amount of data. Extraction methods are:

Projection

../../../_images/detectdefaults.webp

Example of a projection on a column. Notice the peaks allowing to detect characters.

Projects the sum or average of all gray color-level values in a given direction, into various vector types:

Two projections direction are supported:

Profile

Example of a profile alongside an arbitrarily oriented line segment.

Samples a series of pixel values along a given segment, path or contour, then analyze and modify their Peaks and Transitions to make images clearer:

  1. Obtain the profile of a line segment / path / contour

  2. Analyze the profile to find peaks or transitions

    • EasyImage::GetProfilePeaks .NET Python detects max and min peaks in a gray-level profile. To eliminate false peaks due to noise, two selection criteria are used. The result is stored in a peaks vector (EPeakVector .NET Python). A peak (EPeak .NET Python) is a maximum or minimum of the signal which may correspond to the crossing of a white or black line or thin feature. It is defined by its:

    • EPeak::Amplitude .NET Python: difference between the threshold value and the max [or min] signal value.

    • EasyImage::Area .NET Python: surface between the signal curve and the horizontal line at the given threshold. A transition corresponds to an object edge (black to white, or white to black). It can be detected by taking the first derivative of the signal and looking for peaks in it.

    • EasyImage::ProfileDerivative .NET Python computes the first derivative of a profile extracted from a gray-level image. This derivative transforms transitions (edges) into peaks.

    • EBW8 .NET Python data type only handles unsigned values, so the derivative is shifted up by 128. Values under 128 correspond to negative derivative (decreasing slope), values above 128 correspond to positive derivative (increasing slope).

  3. Insert the profile into an image

See Also

Code Snippets

Easy to understand, ready to copy code snippets.

Vector Operations