Ask Your Question

Revision history [back]

Those threshold parameters, according to the tutorial mentioned by @theodore, are to be used in grayscale images (have in mind that your IR image is a grayscale image).

The minThreshold sets pixels bellow that value to zero. The maxThreshold sets pixels above that value to zero.

Imagine your minThreshold = 10 and maxThreshold = 200. In your grayscale image the pixels with value bellow 10 will be set to zero, and pixels with value above 200 will also be set to zero.

In your problem, since you have a dark area with very bright spots, the maxThreshold shouldn't be used (set it to 255 which is maximum for grayscale 8bit images), and minThreshold should be rather high (i'd start at 40 and go up till my bright spots start to disappear), to ignore most dark areas and keep only the bright spots in the image.

You want this threshold to discard everything but the bright spots, so you have to set minThreshold to as high as you can without compromising bright spots.