PICLAB32 Image Processing Library

Features

PICLAB32 library covers a broad spectrum of image processing techniques that are applicable to a

wide range of industrial, medical and other applications, where fast and accurate image processing is

a must.

The image processing techniques in PICLAB32 include:

- Arithmetic and boolean operations, including image combination functions, center of gravity calculation etc.

- Morphological and other filter operations, including convolution filters, low- and high-pass filters, edge detection and 

  enhancement filters, etc.

- Conversion functions, including binarization and color conversion functions.

- Binary image enhancement functions, including erosion, expansion, object connection/separation etc.

- Histogram calculation, enhancement and analysis.

- Spectral analysis based on Fourier transform.

- Object analysis with shape detection, including calculation of various object characteristics, like perimeter, number of

  holes, roundness, porosity, ellipse equivalent etc.

¡@

¡@

General Description

PICLAB32 is a 32-bit library available as:

- DLL for Win32s, Windows 95 and Windows NT

- Static 32-bit library for three DOS-extenders:

¡@

Compiler

Extender

Pharlap

Power Pack

Rational

Borland

Yes

yes

no

Microsoft

Yes

no

no

Watcom

Yes

no

yes

PICLAB32 is based on a sophisticated ROI (Region of Interest) concept. This means that a part of

 source image first have to be copied to ROI-type image buffer (which has PICLAB32 internal format)

 and after processing have to be converted back to application dependent format (if necessary). The

 ROI type image buffer is designed to enable high speed as well as a high precision of the operations.

 Greylevel (or one color plane) pixels in ROI-type buffer are stored in 16-bit type; for certain operations

 like FFT even 64-bit (double) type is used to achieve optimal accuracy.

¡@

Even if most of the functions are intended to process greyscale or black& white (=binary) images,

 PICLAB32 can process color images as well; greyscale functions can be applied to color channels of

 color images, that can be held in PICLAB32 in 4 different color schemes: RGB, HSI, HSV and YUV.

¡@

PICLAB32 can be used as a framegrabber independent library; however Leutron Vision boards from

 xFP-AT family are directly supported in PICLAB32 and image interface functions are provided to

 support indirectly other boards as well.

¡@

PICLAB32 does not provide image file open/save functions since there is a lot of general image

 reading and writing packages available on the market. There is an implementation of Windows Device

 Independent Bitmap (DIB, BMP) file format reading/writing code in the sample program included with

 PICLAB32.

The PICLAB32 sample Windows program included with PICLAB32 enables to explore visually most of

the PICLAB32 functions . As an input a DIB file or TWAIN source can be used. The sample program

can be used as a start framework for your application in case you use MS Visual C++ 4.x and MFC. If

you use another compiler, the sample program can still be used as a supplementary guide showing

usage of PICLAB32 functions - for this purpose most of the PICLAB32 calls are located in separate

CPP module, in which MFC is not used.

¡@

The following list of PICLAB32 function names and brief descriptions may give you closer sight in

 PICLAB32 capabilities.

PICLAB32 Functions

Arithmetical and logical image functions

LvArithAddConst Pixelwise addition of a constant value(dst = src + const)
LvArithSubtConst Pixelwise subtraction of a constant value(dst = src - const).
LvArithDivideByConst Pixelwise division by a constant value(dst = src / const)
LvArithMultiplyByConst Pixelwise multiplication by a constant value(dst = src * const)
LvArithAddImage Relative pixelwise addition of two image buffers (dst = src1 / 2 + src2 / 2)
LvArithAddImageAbs Absolute pixelwise addition of two image buffers (dst = src1 + src2)
LvArithSubImage Relative pixelwise subtraction of two image buffers (dst = ( src1 - scr2 + white ) / 2 )
LvArithSubImageAbs Absolute pixlewise subtraction of two image buffers (dst = abs(src1 - src2))
LvArithMultiplyByImage Pixelwise multiplication of two image buffers (dst = src1 * src2).
LvArithDivideByImage Pixelwise division of two image buffers(dst = src1 / src2).
LvArithMaxImage Pixelwise maximum value selection(dst = max(src1, src2))
LvArithMinImage Pixelwise minimum value selection(dst = min(src1, src2))
LvBinaryAnd Pixelwise "AND" operation on two (binarized) images (dst = src1 and src2)
LvBinaryOr Pixelwise "OR" operation on two (binarized) images (dst = src1 or src2)
LvBinaryXor Pixelwise "XOR" operation on two (binarized) images (dst = src1 xor src2)
LvGreyLinSum Calculates and returns line sums for all lines of the image buffer.
LvGreyColSum Calculates and returns column sums for all columns of the image buffer.
LvGreyGravity Calculates the center of gravity over selected pixels.
LvGeneralFractArea Calculates the covering with object (255) or background (0) pixel

Image enhancement (filter) functions

LvGreyFltAverage Executes 3x3 pixel grayscale averaging convolution.
LvGreyFltBiLaPlace Executes BiLaplace edge-sharpening greyscale convolution.
LvGreyFltCompass Executes an edge detection operation in specified direction.
LvGreyFltEdgeHor Executes a horizontal edge-enhancing operation.
LvGreyFltEdgeHorVer Executes a horizontal and vertical edge-enhancing greyscale operation.
LvGreyFltEdgeVer Executes a vertical edge-enhancing greyscale operation
LvGreyFltFreiChen Executes a Frei-Chen line filter operation.
LvGreyFltGauss Executes a Gaussian filter operation.
LvGreyFltKirsch Executes a Kirsch grey value filter operation.
LvGreyFltLaPlace1 Executes a medium-strength Laplace edge sharpening operation.
LvGreyFltLaPlace2 Executes a strong Laplace edge sharpening operation.
LvGreyFltLineFrei Executes a line filter edge detection and enhancement operation
LvGreyFltLocalDispersion Executes a filter operation for edge detection using local dispersion in a 3x3 neighbourhood.
LvGreyFltLowPass Executes a low-pass filter operation.
LvGreyFltMaxDiff Executes an edge detection by looking for the maximum difference in pixels in a 3x3 surrounding area.
LvGreyFltMeanDiff Executes a mean difference operation in a 3x3 neighbourhood.
LvGreyFltMedian Executes a 3x3 or 5x5 median filter operation.
LvGreyFltPrewitt Executes a Prewitt filter operation for line detection.
LvGreyFltRank Executes a rank order filter operation.
LvGreyFltRawEdge Executes quick&raw edge filter operation.
LvGreyFltRoberts Executes a Roberts edge filter operation.
LvGreyFltSharpenHigh Executes a strong edge sharpening operation.
LvGreyFltSharpenLow Executes a mild edge sharpening operation.
LvGreyFltSharpenMed Executes a medium-strength edge sharpening grayscale operation.
LvGreyFltSobel Executes a Sobel filter operation.
LvGreyFltSobelCarToPol Calculates the polar representation of the Sobel gradient filter operation.
LvGreyFltSobelDxDy Executes a gradient Sobel filter operation.
LvGreyFltSobelMagAng Executes Sobel filter operation and stores magnitude and angle to output buffers.
LvGreyFltVariance Executes an edge filter operation based on the variance value in 3x3 neighbourhood.
LvGreyMexHat Executes a morphological edge detection with a Mexican hat operator.
LvGreyMorphErosion Executes an erosion using a user-defined morphological operator.
LvGreyMorphExpansion Executes an expansion using a user-defined morphological operator.
LvGreyMorphOpen Executes an opening using a user-defined morphological operator
vGreyUserDefinedFilter Executes an user-defined filter operation.

¡@

Binarization functions

LvBinaryThresBin Performs a 3-level binarization of a greyscale image.
LvBinaryHistoBin Performs a histogram based automatic binarization.
LvBinaryCheckBinary Checks if the image contains binary (=black or white) pixels
LvColorBinarizeHSI Binarizes a selected color channel in HSI color scheme
LvColorBinarizeRGB Binarizes each color channel in RGB color scheme.
Binary image edge detection and enhancement functions
LvBinaryInnerBoundary Detects inner edges of binary objects.
LvBinaryOuterBoundary Detects inner edges of binary objects.
LvBinaryBound4 Extracts and thins contours of objects
LvBinaryConnectPixels Connects or separates binary objects by searching horizontal, diagonal and/or vertical gaps between objects.
LvBinaryErosion Performs a binary object erosion
LvBinaryExpansion Performs a binary object expansion
LvBinaryMorphErosion Executes an erosion on a binarized image using a user defined morpho logical operator
LvBinaryMorphExpansion Executes an expansion on a binarized image using a user defined morphological operator

¡@

Object analysis functions

LvBinaryObject Analyzes all binary objects in the ROI and stores results in the object data structure.
LvBinaryEllipseEquivalent Calculates major and minor axis, angle and irradiance of the ellipse equivalent of an object.
LvBinaryObjectFilter Filters detected objects according to the current settings.
LvBinaryInvariantMoments Calculates the invariant moments of the third order.
LvBinaryMarkObject Marks/unmarks an object by setting the markflag in the object data structure.
LvBinaryObjectReset Clears all object data structures.
LvBinaryFourDesc Finds fourier descriptors from the object's chain code.
LvGetFourierDescriptors Gets object specific fourier descriptors.
LvGetObjectBins Returns the total number of bins and access pointer to the object bins structure.
LvGetObjectFeatureStatistic Returns access pointer to a structure with object features statistics.
LvGetObjectFilterCount Returns a count of objects found within one class.
LvGetObjects Returns a number of measured objects and access pointer to their measurements.
LvStatisticObjectStatistics Calculates field data statistics of the objects.
LvStatisticSortToBins Sorts input object data into bins.

¡@

Fourier transfom functions

LvGeneralSetRegionFFTany Sets a nonregular region on a FFT buffer.
LvGeneralSetRegionFFTrect Sets a rectangular region of a FFT magnitude buffer.
LvGreyFFT Calculates a Fourier transform.
LvGreyInversFFT Calculates an inverse Fourier transform.

¡@

Histogram handling functions

LvGreyHistogram Calculates a standard histogram and its statistical values.
LvGreyHistogramEqualize Executes a histogram equalisation of the image buffer.
LvGreyHistogramLocalMin Determines local minima in a histogram.
LvGreyHistogramLog Weights existing histogram with a natural logarithm.
LvGreyHistogramNormalize Normalizes a histogram and calculates mean value and variance.
LvGreyHistogramSmooth Executes a smoothing of a histogram by calculating the average of adjacent values.
LvGreyHistogramSqrt Weights existing histogram with the square root.
LvGetHistogramData Gets greylevel histogram data.
LvGetHistogramStatistic Gets greylevel statistic data of the histogram.

¡@

Color functions

LvColorBGRToHSI Converts image data from RGB color scheme to HSI color scheme.
LvColorHSIToBGR Converts image data from RGB color scheme to HSI color scheme
LvColorBGRToHSV Converts image data from RGB color scheme to HSV color scheme.
LvColorHSVToBGR Converts image data from RGB color scheme to HSI color scheme
LvColorBGRToYUV Converts image data from RGB color scheme to YUV color scheme
LvColorHistoEqRGB Equalizes an image in RGB color scheme
LvColorMaskBGRWithMeanIntensity Rescales image data in RGB color scheme with mean intensity values.
LvColorMeanIntensity Converts image data from RGB color scheme to Intensity (arithmetic mean).

Image buffer handling functions

LvGeneralCreateBuffer Allocates memory for ROI-type image buffer.
LvGeneralCreateRGBBuffer Allocates memory for three ROI-type image buffers, intended to hold RGB channels.
LvGeneralCopyBuffer Copies an image buffer to another image buffer.
LvGeneralFillBuffer Fills the image buffer with a constant value.
LvGeneralSetRegionROIany Sets a nonrectangular region of a ROI buffer to a defined value.
LvGeneralSetRegionROIrect Sets a rectangular region of a ROI buffer to a defined value.
LvGeneralEraseBuffer Frees memory allocated for ROI-type image buffer.
LvGeneralGetBuffer Returns a pointer to the image data in the ROI structure.
LvGeneralGetBufferData Returns x and y dimension of the image.

¡@

Image format conversion functions

LvGeneralCopyBitmapToBuf Copies image data from a common bitmap format to a ROI ¡Vtype image buffer.
LvGeneralCopyBufToBitmap Copies image data from ROI-type image buffer to a common bitmap format.
LvGeneralCopyBufToColorPlane Copies image data from a single ROI-type image buffer to a color plane in common RGB bitmap format.
LvGeneralCopyColorPlaneToBuf Copies image data from a color plane in common RGB bitmap format to a single ROI-type image buffer.
LvGeneralCopyBufToMap Copies image data from ROI-type image buffer to a LV-framegrabber memory.
LvGeneralCopyMapToBuf Copies image data from a LV-framegrabber memory to a ROI-type image buffer.

¡@

Functions setting user defined data

LvSetCalibrator Sets a calibration factor.
LvSetMorphOp Sets a morphologic operator.
LvSetObjectFilter Set an object filter.
LvSetUserFilter Set an user-defined filter.

¡@

Other functions for general use

LvGeneralExit Frees all the allocated structures except for ROI image buffers.
LvGeneralGetVersion Finds the version number and returns it as a string.

¡@

Miscellaneous functions

LvGreyInvers Inverses the pixels in the image buffer.
LvGeneralRotate Rotates image data by an specified angle.