bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / metrics / _contingency_table / contingency_table
function
skimage.metrics._contingency_table:contingency_table
source: /dev/scikit-image/src/skimage/metrics/_contingency_table.py :7
Signature
def contingency_table ( im_true , im_test , * , ignore_labels = None , normalize = False , sparse_type = matrix ) Summary
Return the contingency table for all regions in matched segmentations.
Parameters
im_true: ndarray of intGround-truth label image, same shape as im_test.
im_test: ndarray of intTest image.
ignore_labels: sequence of int, optionalLabels to ignore. Any part of the true image labeled with any of these values will not be counted in the score.
normalize: boolDetermines if the contingency table is normalized by pixel count.
sparse_type: {"matrix", "array"}, optionalThe return type of cont, either scipy.sparse.csr_array or scipy.sparse.csr_matrix (default).
Returns
cont: scipy.sparse.csr_matrix or scipy.sparse.csr_arrayA contingency table.
cont[i, j]will equal the number of voxels labelediinim_trueandjinim_test. Depending onsparse_type, this can be returned as a scipy.sparse.csr_array.
Aliases
-
skimage.metrics.contingency_table