| MIL 10 Reference
| Customize Help
| Save Settings

MimCountDifference



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Partially supported on:
Partially supported on Matrox GPU processing driver

Fully supported on:
Fully supported on Host system
Fully supported on Matrox CronosPlus
Fully supported on Matrox GigE Vision driver
Fully supported on Matrox IEEE 1394 IIDC driver
Fully supported on Matrox Iris GT
Fully supported on Matrox Morphis
Fully supported on Matrox Morphis QxT
Fully supported on Matrox Orion HD
Fully supported on Matrox Radient eCL
Fully supported on Matrox Radient eV-CXP
Fully supported on Matrox Solios eA/XA
Fully supported on Matrox Solios ecl/xcl/ev-cl
Fully supported on Matrox USB3 Vision driver (requires Update 19)
Fully supported on Matrox Vio

For any information regarding a MIL system added during a MIL Update, see the MIL system’s release note

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Count the number of pixels that differ in each image.
Syntax
MIL_INT MimCountDifference(
MIL_ID Src1ImageBufId, //in
MIL_ID Src2ImageBufId, //in
MIL_ID CountResultImId //in
)
Description

This function finds the number of differences between the two specified source buffers and stores the resulting number in the specified result buffer.

You can read the number of differences from the result buffer, using MimGetResult1d() or MimGetResult(), specifying M_VALUE as the result type.

You can limit this function's results to a region of an image buffer using a region of interest (ROI) set using MbufSetRegion(). The ROI must be defined in raster format (M_RASTER or M_VECTOR_AND_RASTER). An error is generated if the ROI is only in vector format (M_VECTOR). If you specify multiple image buffers with an ROI, results are limited to the portion of the ROIs that intersect.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
Src1ImageBufId

Specifies the identifier of the first image data source. This parameter can be given an image buffer identifier. The image buffer must be 1-band. If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.

[Matrox GPU processing driver]

The first source image buffer must be unsigned monochrome 8- or 16-bit.

Src2ImageBufId

Specifies the identifier of the second image data source. This parameter can only be given an image buffer identifier. The image buffer must be 1-band. If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.

[Matrox GPU processing driver]

The second source image buffer must be unsigned monochrome 8- or 16-bit.

CountResultImId

Specifies the identifier of the buffer in which to store the differences. This parameter must be given the identifier of an image processing result buffer that was allocated with MimAllocResult() and has an M_COUNT_LIST type. The buffer needs only one entry.

[Matrox GPU processing driver]

The result image buffer must be unsigned monochrome 8- or 16-bit.

Return value
The returned value is the number of differences between the two specified source buffers.
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC VECTOR PROC VECTOR