# Threshold strategy and Thresholding method -theory

#1

Hi everyone,

I am struggling with the theory regarding these two settings (Threshold strategy and Thresholding method ) present on IdentifyPrimaryObjects module. You wrote on manuals that the Threshold strategy “determines the type of input that is used to calculate the threshold”, while Thresholding method calculates the actual value of threshold. In my case I used Global and Otsu respectively. I do not understand which of them Threshold strategy and Thresholding method ) really classifies the pixels as background or foreground.
In Global strategy you wrote “calculate a single threshold value based on the unmasked pixels of the input image and use that value to classify pixels above the threshold as foreground and below as background”.
In Otsu method you wrote: “This approach calculates the threshold separating the two classes of pixels (foreground and background) by minimizing the variance within the each class”

So, Global strategy orders the calculation of threshold value based on pixels. The actual value is calculated by Otsu method. Then, is the global strategy which classifies the pixels based on the threshold value calculated?

Best Regards,
Maria

#2

Hi Maria,

The threshold strategy determines on what part of the image the threshold is calculated/applied- globally to the whole image at once, or adaptively (separately for individual chunks). The threshold method determines what you’re actually going to do to calculate it- use a measurement, define it manually, use Otsu’s algorithm, use the Robust Background algorithm, etc.

Your explanation is therefore essentially correct- if you chose Global and Otsu, CP takes all the pixel values in the whole image, runs the Otsu algorithm to calculate what the threshold should be, then applies it to all the pixels in the whole image. If you’d chosen Adaptive and Otsu, you’d individually take each chunk of the image, calculate Otsu for that chunk, then apply it to the pixels in that chunk.

Does that help at all?