tomasz-lewicki / ai-thermometer

Fever screening with IR & RGB cameras and Deep CNNs
152 stars 41 forks source link

Running with web cam and IR cam, not accurate temperature reading #6

Open nickjrz opened 4 years ago

nickjrz commented 4 years ago

Hi,

First of all, thanks for sharing the source code for this project, very helpful. I have been trying to run this code with a web cam instead of using the raspberry pi cam. I have it working with display and face detection, the only issue I am running into is that the temperature readings are not accurate. Would you have any idea what could be causing this behavior?

tomasz-lewicki commented 4 years ago

Hi @nickjrz ,

Commit 9d754093d3fcf76fe9ce421dad255f20c7e582ec introduced a bug which led to incorrect readings. I just pushed 097c9c904fc412f0e25225afdf44eb3ec60b2f82 which fixed that. Let me know if the readings are better now :slightly_smiling_face:

nickjrz commented 4 years ago

Thanks for your quick reply, I will try it today and will keep you updated.

nickjrz commented 4 years ago

So I updated the files and I am still getting readings of 62550 celsius. I found a formula for the lepton thermal cameras temp = slope * (raw -8192) + ambTemp (https://groups.google.com/g/flir-lepton/c/T2NFRkeMyR4?pli=1) maybe this could be used along the calculations on code

tomasz-lewicki commented 4 years ago

Hi,

Is it possible that you're using Lepton 3.0 (S/N: 500-0726-01), instead of Lepton 3.5 (S/N: 500-0771-01) module?

nickjrz commented 4 years ago

as of now I am using the 2.0 model with the purethermal 2 breakout board. I think I only need to add some calibration coefficient in the calculation in order for it to get readings properly.

tomasz-lewicki commented 4 years ago

In order to get the temperature values out-of-the-box you'd have to have one of the radiometric lepton modules (e.g. Lepton 3.5). They come pre-calibrated and stream temperature values in Kelvin.

nickjrz commented 4 years ago

Okay thanks, I guess I just need to figure out how to calibrate it. I tried ordering the 3.5 one but they were out of stock and only had 2.0 so I will keep you updated if I make any progress on this model.

nanogear commented 4 years ago

@nickjrz try to buy the lepton directly to Groupgets or Digikey. Both have the radiometric 3.5 in stock

muralikrishna416 commented 4 years ago

Hai, i want to know small information like without IR Thermal sensor, the camera will open or will not open through the code which you have provided. Because, i am getting an error that (execute 568: Failed to create capture session) and also (opening in blocking mode).

Could you please tell me the problem which i am facing currently...

tomasz-lewicki commented 4 years ago

Without the Lepton camera, the program will just indefinitely wait for IR frames and display no output.

You can run just the RGB object detection with the script here: https://www.github.com/tomek-l/ai-thermometer/tree/master/vis%2Fssd%2Fexample_detect_face_caffe_resnet.py

On Mon, Oct 5, 2020, 10:37 PM muralikrishna416 notifications@github.com wrote:

Hai, i want to know small information like without IR Thermal sensor, the camera will open or will not open through the code which you have provided.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tomek-l/ai-thermometer/issues/6#issuecomment-704038959, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHK36VC67G7HGSLUHDR5NLSJKUHZANCNFSM4RLYGWAA .

nickjrz commented 4 years ago

I am currently waiting for a lepton 3.5 (digikey) to come in, as of now I am still trying to get the 3.0 to work with this application with some sort of calibration.

I also got the code to work with a webcam instead of a raspberry cam v2, instead of creating a pipeline for the vis cam I used cv2.VideoCapture(index # of device) . You can specify same properties as pipeline with set command for cv2

nickjrz commented 4 years ago

I just got the lepton 3.5 and tried it out altogether but readings seem to be a little off. I am getting an average temperature of 32 Celsius. Do I need to let it run for a while for it to warm up?

tomasz-lewicki commented 3 years ago

The freshly merged PR #31 adds:

You should pull the newest master give it a try :slightly_smiling_face: