I am using openCV and Python to make a computer vision application that detects hotspots in an image from thermal cameras.
The image is basically of a big machinery and I want to get the hottest (in terms of temperature) part of the image.
What I thought of till now:
Now I've successfully done the first part. I have a quantized image which contains 8 colors only.
All the thresholding I've done till now needs me to put the color range myself (i.e using cv2.inRange
function to create a mast and then using cv2.bitwiseAND
to apply the mask to the image). But here I want it to be dynamic, so that it just gets the hottest part. i.e even if there is very little red, it should just get me the region with most red.
So what is a way to do that?
(Also, by "Hotspots", here I mean actual HOT spots. I.e spots which have the highest temparature.)
Edit:
As the comment from Photon mentioned, currently I'm calculating the histogram of red and using that to set the threshold.
I'm looking to optimize this further, so let me know if any more efficient method exists. (The process should be fast. I can compromise on the accuracy to an extent)
In order to estimate a threshold dynamically, you need to look at the distribution of the data. For this purpose, you need to calculate the histogram of the red. Then, find a threshold such that a certain percentage of the pixels are below it. For example 90%.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With