2

I would like to extract csv temperature values from a ravi file. The ravi files were filmed by an Optris PI 400/450.

I have seen this problem asked before here: How can I get data from 'ravi' file? however I am still stuck. Here is my situation: I have 1260 ravi files, and I need to get csv frames every second for each file (each ravi is about 1:30 long), which means I need 113,400 CSV files (approximately).

What I have tried so far:

  • Turning the ravi file into a YUV and then extracting temperature data: I used ffmpeg to turn the ravi file into a YUV420p file, which I then decoded into frames. I then used the code here: Decoding a YUV image in Python OpenCV to decode the data. I ended up with this result:result of the code (it is supposed to be a keyboard.)

  • I have also tried the code in the link above (How can I get data from 'ravi' file?) however I don't think the question was fully answered, as I was not able to replicate the results. I have sent an email to the poster of the question but no luck.

  • I turned the ravi files into avi frames which seemed to work, but most of the avi frames were not representing the data correctly: supposed to be a thermal image of a keyboard

I think the YUV method is the way to go, but I am unsure on how to decode the YUV file properly to get the correct temperature values. Another thing that would be nice-to-have would be images of each frame (in any image file format), but I guess that would be easy to do once I had the csv files for every frame.

Additional information:

Let me know in the comments if more information is needed.

Paul Bekaert
  • 81
  • 1
  • 10
  • Last time I have posted an answer about [Extracting Temperatures from .ravi](https://stackoverflow.com/questions/67340899/extracting-temperatures-from-ravi-file-in-matlab), the OP commented that for getting the temperature, you have to use a calibration file that comes with the camera you buy. – Rotem Oct 02 '21 at 13:09
  • 1
    I added a Python code sample to my answer [Extracting Temperatures from .ravi](https://stackoverflow.com/a/67356437/4926757). The sample may help you in the first stage - reading the raw pixels data from the RAVI file. I hope someone else helps you converting the data to temperature. – Rotem Oct 02 '21 at 21:31
  • 1
    Your code worked! If you leave that code on this question I will mark it as correct. I have another question however: Am I able to get the pixel data from the normalized data? I'll have a look online, but thanks for your help! – Paul Bekaert Oct 04 '21 at 09:10
  • 2
    Your question is about Converting to CSV, so I don't want to post my code, that just reads the frames into NumPy arrays... **2.** You can't get the pixel data from the normalized data, because, because the normalized data is integers in range [0, 255] and pixel data range is [-32768, 32767]. The normalized data is only used for displaying the image (the normalization is used as a very basic contrast enhancement). – Rotem Oct 04 '21 at 10:32

0 Answers0