MimConvolve()函数

MimConvolve()函数

Synopsis

Perform a general convolution operation.

Format

void MimConvolve(SrcImageBufId, DestImageBufId, KernelBufId)

MIL_ID SrcImageBufId; Source image buffer identifier
MIL_ID DestImageBufId; Destination image buffer identifier
MIL_ID KernelBufId; Kernel buffer identifier
Description

This function performs a general convolution operation on the source buffer using the specified kernel, storing results in the specified destination buffer.
The SrcImageBufId parameter specifies the identifier of the data source of the operation. This parameter must be given an image buffer identifier.
The DestImageBufId parameter specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier.
The KernelBufId parameter specifies the identifier of the kernel buffer. This parameter can be given a custom or predefined kernel identifier. If you use a custom kernel, you must have previously allocated it with MbufAlloc1d or MbufAlloc2d and loaded it with values, using MbufPut.

Operation flags associated with custom kernels can be modified in order to control the behavior of the convolution operation. By using MbufControlNeighborhood you can control how the operation handles the borders of an image (overscan), whether or not the absolute value of the result is taken, which division factor to apply to the result, whether or not to saturate the result, and the position of the kernel’s center.
The following is a list of predefined kernel buffer identifiers:

MimLutMap()函数

MimLutMap()函数

Synopsis

Perform a point-to-point LUT mapping operation.

Format

void MimLutMap(SrcImageBufId, DestImageBufId, LutBufId)

MIL_ID SrcImageBufId; Source image buffer identifier
MIL_ID DestImageBufId; Destination image buffer identifier
MIL_ID LutBufId; LUT identifier
Description

This function maps each pixel in the specified source image to values determined by the specified look-up table (LUT).
If the source image is signed, negative numbers are treated as unsigned values and address the LUT accordingly. For example, -1 is represented as 0xff for 8-bit image data and 0xffff for 16-bit image data and will therefore address LUT entry 0xff or 0xffff, respectively.
The SrcImageBufId parameter specifies the identifier of the data source of the operation. This parameter must be given an image buffer identifier.

The DestImageBufId parameter specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier.
The LutBufId parameter specifies the LUT through which to map source input values. This parameter must be given a valid LUT buffer identifier.
If the LUT has fewer entries than the full range of source values, unexpected results will occur. If the LUT buffer depth is greater than that of the destination buffer, results will be truncated to fit the destination buffer. LUT entries must have been previously initialized (for example, using MgenLutRamp or MbufPut1d).

MimShift()函数

MimShift()函数

Synopsis

Perform a point-to-point bit shift.

Format

void MimShift(SrcImageBufId, DestImageBufId, BitsToShift)

MIL_ID SrcImageBufId; Source image buffer identifier
MIL_ID DestImageBufId; Destination image buffer identifier
long BitsToShift; Number of bits to shift
Description

This function performs left or right bit-shifting on each pixel in the specified image. The shift operation is signed or unsigned depending on the source image buffer’s data type.
The SrcImageBufId parameter specifies the identifier of the data source of the operation. This parameter must be given an image buffer identifier.
The DestImageBufId parameter specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier.

The BitsToShift parameter specifies the number of bits to shift. If the given value is negative, each pixel in the specified image is right bit-shifted by the specified number of bits; otherwise, it is left bit-shifted.

MimArithMultiple()函数

MimArithMultiple()函数

Synopsis

Perform a point-to-point arithmetic operation using multiple source images.

Format

void MimArithMultiple(Src1ImageBufId, Src2ImageBufId, Src3ImageBufId, Src4ImageBufId, Src5ImageBufId, DestImageBufId, Operation, OperationFlag)

double Src1ImageBufId; Source 1 image buffer identifier or a constant
double Src2ImageBufId; Source 2 image buffer identifier or a constant
double Src3ImageBufId; Source 3 image buffer identifier or a constant
double Src4ImageBufId; Source 4 image buffer identifier or a constant
double Src5ImageBufId; Source 5 image buffer identifier or a constant
MIL_ID DestImageBufId; Destination image buffer identifier
long Operation; Operation to perform
long OperationFlag; Flag associated with the Operation argument
Description

MimArith()函数

MimArith()函数

Synopsis

Perform a point-to-point arithmetic operation.

Format

void MimArith(Src1ImageBufId, Src2ImageBufId, DestImageBufId, Operation)

double Src1ImageBufId; Source 1 image buffer identifier or a constant
double Src2ImageBufId; Source 2 image buffer identifier or a constant
MIL_ID DestImageBufId; Destination image buffer identifier
long Operation; Operation to perform
Description

MimBinarize转二值图

Format

void MimBinarize(SrcImageBufId, DestImageBufId, Condition, CondLow, CondHigh)

MIL_ID SrcImageBufId; Source image buffer identifier
MIL_ID DestImageBufId; Destination image buffer identifier
long Condition; Conditional operator for selection
double CondLow; Low compare value for the condition
double CondHigh; High compare value for the condition

Description

This function performs binary thresholding on the specified image. Each pixel that meets the specified condition is set to the highest unsigned destination buffer value, while other pixels are set to 0. For example, the highest buffer value for an 8-bit buffer is 0xff.
The SrcImageBufId parameter specifies the identifier of the data source of the operation. This parameter must be given an image buffer identifier.
The DestImageBufId parameter specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier.

The Condition parameter specifies the thresholding condition. This parameter can be set to one of two types of conditions.

MimClip剪切点操作

Format

void MimClip(SrcImageBufId, DestImageBufId, Condition, CondLow, CondHigh, WriteLow, WriteHigh)

MIL_ID SrcImageBufId; Source image buffer identifier
MIL_ID DestImageBufId; Destination image buffer identifier
long Condition; Clipping condition
double CondLow; Low clipping point
double CondHigh; High clipping point
double WriteLow; Value written if low clipping condition satisfied
double WriteHigh; Value written if high clipping condition satisfied

Description

This function clips each image pixel that meets the specified condition. If the condition has one clipping point, each pixel that satisfies this condition is replaced with the specified WriteLow value. If it has two clipping points, they are either replaced with the WriteLow or WriteHigh value depending on the condition. Pixels that do not satisfy the condition are not affected.
The SrcImageBufId parameter specifies the identifier of the image data source.

The DestImageBufId parameter specifies the identifier of the destination image buffer.
The Condition parameter specifies the clipping condition. This parameter can be set to one of two types of conditions.

Mmeas测量模块介绍

一般mil测量步骤如下;

1.使用MmeasAllocMarker函数,先分配测量的MIL_ID。

2.使用MmeasSetMarker函数,设置 边(Edge)或条纹(stripe)参数, 如极性,强度,宽度,测量范围,角度等

3.使用MmeasFindMarker函数,寻找 边(Edge)或条纹(stripe)位置

4.使用MmeasGetResult函数,获取结果,分数,角度,位置等

5.使用MmeasFree函数, 释放分配测量的MIL_ID