Compare properties of several images
dip_Error dip_ImagesCompare( images, condition, result )
This function compares some standard fields of a number of Images or performs a full comparison. Only if the comparison result is true between each of the Images, will the final comparison result be true. The condition parameter specifies which properties should be tested. If 0, a full comparison of the Images is performed. Otherwise it should be a logical OR of the dipf_ImagesCompare flags. DIP_CPIM_MATCH_ALL_STANDARD is equivalent to all the flags OR'ed together. The difference between DIP_CPIM_MATCH_ALL_STANDARD and the full comparison specified by 0, is that the first will compare all the standard fields ( type, data type, dimensions ), whereas the other compares all fields relevant to a particular DIPlib Image type. This may exclude some of the standard fields and include some fields particular to the type of DIPlib Image in question. There are two modes of operation. If the result parameter is set, it is used to store the result of the comparison, a set of OR'ed dipf_ImagesCompare flags. If the result parameter is 0, an error is returned if the condition parameter and the resulting set of flags are not the same.
Data type | Name | Description |
dip_ImageArray | images | Array of Images |
dipf_ImagesCompare | condition | Properties to compare. 0 indicates full comparison |
dipf_ImagesCompare * | result | Result: flags to indicate if the properties were the same. 0 indicates that an error should be returned if the requested properties do not match |
Name | Description |
DIP_CPIM_DIMENSIONALITIES_MATCH | Dimensionalities match |
DIP_CPIM_DIMENSIONS_MATCH | Dimensions match. The comparison is done up to the lower of the of the two dimensionalities |
DIP_CPIM_SIZE_MATCH | Combination of DIP_CPIM_DIMENSIONALITIES_MATCH and DIP_CPIM_DIMENSIONS_MATCH |
DIP_CPIM_TYPES_MATCH | Types match |
DIP_CPIM_DATA_TYPES_MATCH | Data types match |
DIP_CPIM_MATCH_ALL_STANDARD | All flags above OR'ed together |
DIP_CPIM_STRIDES_MATCH | Strides match |
DIP_CPIM_FULL_MATCH | Full match. Returned in result. To test for a full match use 0. Note: This is NOT equivalent to the other flags OR'ed together, and it cannot be used as condition |