How can I get data from 'ravi' file?
I don't know your camera make, but expect the video file to contain raw sensor values as 16-bit unsigned int, which is maybe just named YUV422 in the video header, because they fit the same 16 bits per pixel.
These values you can convert to real valued temperature via a particular non-linear calibration curve. If the RAVI-format is a single file format (as opposed to some legacy IR-cameras with raw-AVI + calibration table) then you should find the location of the few floating point constants and/or table, which make up the equation.
It's possible to reverse engineer the logic, but better ask the correct equation from the manufacturer. For example, what you find on the internet, could be just a legacy version of the calibration curve. Most manufacturers offer calibration libraries together with their devices. Some, out-of-product cycle devices could be a pain to negotiate, but you should get at least a white paper on the topic.
If you use OpenCV, you need to read YUV422-frames raw (16bpp, not 24bpp) and just reinterpret their context as uint16 before applying look up table.
// sample C++ code employing private content of OpenCV library
// Particularly container_avi.private.hpp and container_avi.cpp
void mainactual()
{
cv::AVIReadContainer reader;
reader.initStream(cv::String("C:/tello/intro2.avi"));
cv::frame_list frames;
// initializes the stream
reader.parseRiff( frames );
std::cout << "Number of frames: " << frames.size() << std::endl;
int w=reader.getWidth();
int h=reader.getHeight();
std::cout << "size " << cv::Size(w,h) << std::endl;
// a frame in the middle
cv::frame_iterator it=frames.begin() + frames.size()/2;
std::vector< char> data = reader.readFrame( it );
// In your case, data here is supposed to be
// uncompressed YUV422 which is w * h * 2 bytes per frame
// You might need to modify
// bool AVIReadContainer::parseStrl(char stream_id, Codecs codec_)
// to accept your FCC
//
//
//if ( data.size()!=w*h*2 )
//{
// // error
//}
// My video is MJPEG, so I'm confident to just to decode it
cv::Mat img = cv::imdecode( data, cv::IMREAD_UNCHANGED );
cv::imshow("image", img ); // looks fine
cv::waitKey( 0 );
reader.close();
}
EDIT: Tested brake disk.ravi, looks like below. Modified the parser to accept uncompressed YUV2 format and added a hack according to https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/Aviriff/ns-aviriff-avioldindex
dwOffset
Specifies the location of the data chunk in the file. The value should be specified as an offset, in bytes, from the start of the 'movi' list; however, in some AVI files it is given as an offset from the start of the file.
Not sure what the scrabble is, but looks like a brake disc.
cv::Mat img;
if ( data.size()==w*h*2 )
{
std::cout << data.size() << " " << w*h*2 << std::endl;
cv::Mat t( h, w, CV_16UC1, &data[0] );
// img(y,x) = (float)t(y,x)/10.0 - 100.0
t.convertTo( img, CV_32F, 0.1, -100.0 );
}else
return;
double mi,ma;
cv::minMaxLoc( img, &mi, &ma );
std::cout << "range: [" << mi << ", " << ma << "]" << std::endl;
cv::Mat gray;
img.convertTo( gray, CV_8U ); // [0, 255] range saturated
cv::Mat bigger;
cv::resize(gray,bigger,cv::Size(4*w,4*h),0,0,cv::INTER_LINEAR );
cv::Mat jet;
cv::applyColorMap( bigger, jet, cv::COLORMAP_JET );
cv::imshow("image", jet ); // looks fine
cv::waitKey( 0 );
reader.close();