-4

I'm looking for solution to access thermal data of camera. well i used OpenCV and only could got original image. but there is no more data for process like temperature. I tried available library about HikVision cameras and surfed the net for this. but i could not be succeed. also I tried FLIR library but no success.

second solution that I have is converting RGB to temperature but i don't know what to do for this kind of process. Also I know the range of device temperature which is between-20 to 150 degree

looking for something like this:

# cam model: hikvision DS-2TD2615-10

import cv2
import hikvision api library for example

thermal = cv2.VideoCapture()
thermal.open("rtsp://""user:pass@ip:port/Streaming/channels/202/")
ret, frame = thermal.read()

while True:
   ret, frame = thermal.read()

   temp_data = api.read_temperature(frame) # -> array or excel file

   cv2.imshow('frame', frame)  
   if cv2.waitKey(1) & 0xFF == ord('q'):
       break
thermal.release()
cv2.destroyAllWindows()

and my video input is something similar to this pic and for example i want to find out the nose is how much hot just by click on it: input

  • Please provide any code that you have tried so far and add errors you get. Also I am not sure if your question is clear, you are trying to capture a thermal camera image and get what temperature? it is usually shooting pics with inconsistent temperature, you mean temperature of the center, average, or something else? – Ruli Dec 19 '20 at 08:27
  • actually i could not code any thing with any library so there is no code for this part other part of my code is irrelevant to question. no useful source, no example everything is about how to read original frame from camera. there is IR camera that capture environment temperature and i want to use this data. if i could read this data my code allow me to find the required temperature at clicked point. just problem is there is no input – Amir Hossein Mobayen Dec 19 '20 at 09:22
  • 1
    You should consult the support docs from your camera manufacturer for your model to see ho this can be done. – skuzzy Dec 19 '20 at 10:12
  • the problem is that i could not find any sources or documents for python :( – Amir Hossein Mobayen Dec 23 '20 at 07:57

1 Answers1

1

General answer for thermal images from any camera - you can't just convert grayscale level (or color if you already applied pallete to your image) to temperature values. You need to know some coefficients which relates to IR matrix. Some software may embed that data to image file metadata but there is no standard for that. Also, if you resaved your image file without knowing it, you'll probably lose that metadata.

Also, like plain visible-light camera, IR-camera can adapt it's range to current image. So, if you're shooting a human in a room, minimum temperature in your picture will be like 22°С (cold wall or floor), maximum will be like 37°C (hottest part of human body). In that case you'll get 256 gray levels covering range of 15 degrees, so black color is 22°С, white is 37°С (keep in mind proportion is not linear!). You move your camera to a cup of hot tea with like 60°С and your relation of gray level to temperature changes. So, you need to get coefficients for every frame.

It is possible to "fix" temperature range on some cameras but that depends on specific models.

More than that - most cheap thermal cameras don't deal with temperature values at all.

P.S. Oh, I just noticed exact model of your camera. So answer is even stronger "YOU CAN'T". Don't expect capabilities of science or medical thermal camera from that chinese poorly documented surveilance hardware.

Wolfrevok Cats
  • 167
  • 1
  • 7
  • thank you very much. I will look for thermal metadata available in the image. actually, this model camera is given to me by one of which I'm currently working at. fixing temperature is supported by the model and till now the only founded possible way is to work with it if I couldn't extract the metadata. – Amir Hossein Mobayen Jan 18 '21 at 10:16
  • @AmirHosseinMobayen yes, I refreshed my knowlesge about actual IR cameras and I see even cheap models now have temperature measuring capabilities. more or less precise – Wolfrevok Cats Jan 19 '21 at 20:37
  • thanks very much. yes, the actual model has embedded temperature measuring capabilities. either I'm looking for an API to use on my system. so the which is not available or I cant find it :( – Amir Hossein Mobayen Jan 21 '21 at 19:25