Detect a candle fire using OpenMV H7 and FLIR

OpenMV related project discussion.
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Sun May 26, 2019 8:49 am

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.
User avatar
iabdalkader
Posts: 1040
Joined: Sun May 24, 2015 3:53 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby iabdalkader » Sun May 26, 2019 9:18 am

You can definitely use FLIR for this, but note it's limited to 9FPS.
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Sun May 26, 2019 9:48 am

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?
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Sun May 26, 2019 12:15 pm

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.
Nyamekye,
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Sun May 26, 2019 12:27 pm

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
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Sun May 26, 2019 2:56 pm

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.
Nyamekye,
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Sun May 26, 2019 3:47 pm

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.
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Sun May 26, 2019 6:42 pm

Okay, the polarizer may help them. I can't really offer any guarantees. It does work magic when it works however.
Nyamekye,
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Wed May 29, 2019 1:15 pm

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
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Wed May 29, 2019 1:45 pm

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.
Nyamekye,
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Thu May 30, 2019 8:16 am

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.
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Thu May 30, 2019 11:02 am

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.
Nyamekye,
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Thu May 30, 2019 2:09 pm

So the lens mount will also solve the problem with putting on ultra wide lens, I mentioned?
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Thu May 30, 2019 3:24 pm

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.
Nyamekye,
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Sat Jul 06, 2019 6:31 am

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.
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Sat Jul 06, 2019 8:10 pm

Hi, please see Examples - > FLIR Lepton -> Target Temperature Tracking. We have about 8 examples to work with.
Nyamekye,
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Sat Jul 27, 2019 6:20 am

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!
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Sat Jul 27, 2019 1:36 pm

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.
Nyamekye,
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Thu Aug 15, 2019 10:28 am

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
Attachments
flame flir 50 400u.png
flame flir 50 400u.png (6.12 KiB) Viewed 8947 times
flame flir 50 100u.png
flame flir 50 100u.png (6.15 KiB) Viewed 8947 times
flame flir 50 60u.png
flame flir 50 60u.png (6.7 KiB) Viewed 8947 times
flame flir 40 400u.png
flame flir 40 400u.png (6.22 KiB) Viewed 8947 times
flame flir 40 100u.png
flame flir 40 100u.png (6.58 KiB) Viewed 8947 times
flame flir 40 60u.png
flame flir 40 60u.png (6.8 KiB) Viewed 8947 times
flame flir 30 400u.png
flame flir 30 100u.png
flame flir 30 60u.png
flame flir 30 40u.png
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Thu Aug 15, 2019 12:13 pm

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.
Nyamekye,
mike58smile
Posts: 12
Joined: Sun May 26, 2019 8:32 am

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby mike58smile » Fri Aug 16, 2019 9:36 am

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.
User avatar
kwagyeman
Posts: 3514
Joined: Sun May 24, 2015 2:10 pm

Re: Detect a candle fire using OpenMV H7 and FLIR

Postby kwagyeman » Fri Aug 16, 2019 11:08 am

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.
Nyamekye,

Return to “Project Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest