Tnimage can use the quick segmentation algorithm, a neural network algorithm, or a spatial differencing algorithm to identify and count objects in an image. The choice of which algorithm to use will depend on the pattern to be counted. Neural networks are preferable for complex patterns, since they take the internal structure of the pattern into account. However, neural networks require the adjustment of 3 parameters (threshold, match weight, and mismatch weight) instead of one, so it can be tricky to find the best combination of parameters to optimally discriminate between similar patterns.
Quick segmentation is extremely efficient and fast, but is only suitable for counting black grains on a light background. The grains need to be already separated from each other.
The differencing algorithm is also suitable mainly for small dark objects like grains, but is better at separating objects that touch each other.