Page 1 of 1

Detect a candle fire using OpenMV H7 and FLIR

Posted: Sun May 26, 2019 8:49 am
by mike58smile
Hello, my project is to use OpenMV cam H7 and some of the FLIR lepton to detect a candle fire (approximately 2 or less centimetres high) from at least 2 metre distance. I would like to know if it is possible (I also want the maximum FPS because it would be mounted to a moving object), then which FLIR Lepton to use to get the best results. I also tried doing it without FLIR, after using gamma correction and turning off automatic light correction I get almost good results, but it wasn't resistant to sun light (which I need it to be), but using grayscale I got 70 FPS witch was pretty great. So I would like to know what is the best way to use. Maybe also use the special sun lens you are offering.
Thank you a lot.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sun May 26, 2019 9:18 am
by iabdalkader
You can definitely use FLIR for this, but note it's limited to 9FPS.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sun May 26, 2019 9:48 am
by mike58smile
Thank you! Do you mean FLIR Lepton 3 or 3.5? And do you think it can be done without it and somehow isolate the sun light using polarizing filter you are offering?

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sun May 26, 2019 12:15 pm
by kwagyeman
Hi, the FLIR Lepton sees heat. As long as the sun isn't behind the candle it will isolate the sun out. You don't need the lens polarizer. That's for visible light. Not thermal.

I'd use the 3.5 if possible, you can set a target temperature rang using it.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sun May 26, 2019 12:27 pm
by mike58smile
But maybe it would be not so good because of FPS, so I am mapping the possibillities. Do you think that without flir, with normal lens and the polarizar it can isolate sun and setect just the candle fire? Because then, it would have a lot more FPS, wouldn't it?
Btw thank you for your answers :D

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sun May 26, 2019 2:56 pm
by kwagyeman
The polarizer works great when the light from the sun is reflected off a surface at some angle. It doesn't work looking right at the sun. You'd need to specify exactly how your system is setup. If you just need to remove reflected light from the sun the polarizer will work. Otherwise it will not.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sun May 26, 2019 3:47 pm
by mike58smile
I don't need to look right at the sun, I just want to ignore the reflected sunlight going from window which is right above the field with the candles. The sun light is ussually seen as light stripes on the field.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sun May 26, 2019 6:42 pm
by kwagyeman
Okay, the polarizer may help them. I can't really offer any guarantees. It does work magic when it works however.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Wed May 29, 2019 1:15 pm
by mike58smile
Can I somehow set the maximum detecting value (I know, you can set the minimum - that is pixel and area treshold) so it can ignore the bright areas with bigger area and detect just the object that has small area...? I hope you understanded it

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Wed May 29, 2019 1:45 pm
by kwagyeman
Hi, use the filter method in Python and filter out blobs returned that pass the maximum value you want to ignore. Find blobs returns a list of values. So, just inspect the pixel/area count per blob returned and ignore blobs that have too large a value.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Thu May 30, 2019 8:16 am
by mike58smile
Thank you, I will try that soon, but for now I want to order that polarizer to my H7 camera. I want to know if I need more than one and how can it be attached to the camera. I also ordered wide angle lens with my camera, but it cannot be put on camera, it always get stuck in one position. I think that the screw thred is badly made so it always get stuck. I don't know if I need to order new one, or how to deal with this.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Thu May 30, 2019 11:02 am
by kwagyeman
Hi, the polarizer goes under the lens mount. Please order a new lens mount. We have a stock of them that didn't come from the production run. Lens mounts are available on the store.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Thu May 30, 2019 2:09 pm
by mike58smile
So the lens mount will also solve the problem with putting on ultra wide lens, I mentioned?

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Thu May 30, 2019 3:24 pm
by kwagyeman
Yes, the standard lens mount you have should work with the ultra wide angle lens. It's just that we use really cheap lens mounts which aren't to spec always.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sat Jul 06, 2019 6:31 am
by mike58smile
Hello, I now have Flir Lepton 3.5 as you adviced me, which example program should I use or what should I do to track the candle fire? Thank you.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sat Jul 06, 2019 8:10 pm
by kwagyeman
Hi, please see Examples - > FLIR Lepton -> Target Temperature Tracking. We have about 8 examples to work with.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sat Jul 27, 2019 6:20 am
by mike58smile
I tried that examples, but the temperature of flame is not same in all areas of fire. The best results I got is when I tried to track 40 °C, but it is very close to other objects around. I think the best would be to track not just 40 °C but to compare the temperature of the points that are close together. Is it possible? And if yes then were should I start? If you have better sollution, maybe use neural networking or something else it would be great. Thank you!

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Sat Jul 27, 2019 1:36 pm
by kwagyeman
Hi, what temperature range are you tracking? The flame is definitely hotter than 40C. Have you tried raising the max temperature range? Please post the code you are running and the IDE frame buffer pic.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Thu Aug 15, 2019 10:28 am
by mike58smile
I am sending you the camera photos with different temperature ranges. I have to recognize candle up to 3 metres, so I suppose I want camera to see the biggest candle fire as possible. What should I do? Thank you

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Thu Aug 15, 2019 12:13 pm
by kwagyeman
It looks like you have the basic idea of what to do. What's the problem? I can't really help you figure out what temperature range kin and max works the best. That's something you have to do. But, I think you are on the right path.

If you do everything in grayscale mode you can then use find_blobs() to track the object.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Fri Aug 16, 2019 9:36 am
by mike58smile
The biggest trackable object (I mean the candle) is when using 30 - 40 temperature range. The problem is that it is a very low temperature range for other objects - I mean if I used it to track that canle, it would also track the people or hot computers which can be around. So I am finding a way to somehow have the biggest object to track and also to ignore other objects. Is it possible to use something like multi color code, but instead of different colors it would be different temperatures? Because candle is composed of different temperatures so maybe this can also be a sollution. Or maybe you can come up with better sollution.. Thank you.

Re: Detect a candle fire using OpenMV H7 and FLIR

Posted: Fri Aug 16, 2019 11:08 am
by kwagyeman
Switch to grayscale. The temperature mapping is quite explicit. Each shade of grayscale is a temperature. See the example scripts for how the mapping works. Once you do that set the thresholds for find_blobs() to be extremely precise for an exact temperature range.