| Customize Help
| Save Settings

MimCountDifference



Function Map
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.

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.

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.

You can set this parameter to M_NULL, since the function also returns the number of differencesbetween the two specified source buffers.

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