# CompareHistogram3D

The CompareHistogram3D function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications. is used to compare two 3D histograms (existing in the spreadsheet as Histogram3D structures) in terms of their distribution of frequencies. When using the function, consider the following factors:

- To make sense of the comparison, Cognex recommends to compare histograms with similar configuration parameters (such as similar Bin and Subsample Sizes, or similar Minimum and Maximum values). Otherwise, the comparison percentage returned by the function will not reflect the similarity of the two object surfaces associated with the compared histograms.

- Regardless of the configured Bin Size, the number of bins must be the same in the compared histograms. If the number of bins are different, the function returns the Different Number of Bins error message.

Inputs

The CompareHistogram3D function has the following syntax:

CompareHistogram3D(PointCloud A point cloud is a 3D structure that consists of the data points collected by a 3D vision system during acquisition.,ExternalHistogram0,ExternalHistogram1)

See the table for a description of the available parameters.

Parameter | Description
PointCloud | Reference to a cell containing a point cloud A point cloud is a 3D structure that consists of the data points collected by a 3D vision system during acquisition.. The default value is $A$0.
External Histogram A histogram is a graphical representation of the distribution of pixel intensity values. A histogram refers to an array of pixels - how many and their individual greyscale values - within a region of interest (ROI). 0 | Specifies a reference to the first Histogram3D structure created in another cell to be used for comparison.
External Histogram 1 | Specifies a reference to the second Histogram3D structure created in another cell to be used for comparison.

Outputs

Returns | The similarity percentage of the compared histograms, as an integer.
Results | When initially inserted into a cell, the function either returns an integer with a value range of 0 – 100 (standing for the similarity percentage), or #ERR if the function encountered any issues (such as a different number of bins in the two histograms).