Jaccard similarity coefficient for image segmentation

`similarity = jaccard(BW1,BW2)`

`similarity = jaccard(L1,L2)`

`similarity = jaccard(C1,C2)`

computes the intersection of binary images `similarity`

= jaccard(`BW1`

,`BW2`

)`BW1`

and
`BW2`

divided by the union of `BW1`

and
`BW2`

, also known as the Jaccard index. The images can be
binary images, label images, or categorical images.

computes the Jaccard index for each label in label images `similarity`

= jaccard(`L1`

,`L2`

)`L1`

and `L2`

.

computes the Jaccard index for each category in categorical images
`similarity`

= jaccard(`C1`

,`C2`

)`C1`

and `C2`

.