Hello,
I have a P2 Pro and I'm trying to read the raw temp data. Thank you to all members who provided so much info!
TLDR: I get the bottom half of the image (raw data) but there are some issues. I see some clipping zones, and also the first row is completely wrong.
This is the ffmpeg command I use (I'm on a mac, change -f avfoundation to something else if you are on another platform)
ffmpeg -f avfoundation -framerate 25 -pixel_format yuyv422 -video_size 256x384 -i 'USB Camera' -vf 'crop=h=(ih/2):y=(ih/2)' -pix_fmt yuyv422 -f rawvideo - | ffplay -pixel_format gray16le -video_size 256x192 -f rawvideo -framerate 25 -i - -vf 'normalize=smoothing=10, format=pix_fmts=rgb48'
I also wrote a small program to get some readings, and the temp data (min, max, average) are about the same as in the android app. Except the first row (first 256 pixels), which is way off (~78ºC instead of ~20). The same can be also seen with the ffmpeg command shown above (white line on top).
The other obvious issue is the clipping/noise (you can clearly see it in the image, around the fingers). Those clipping patterns/areas are also visible in the greenish wrongly-parsed preview as well, exactly in the same positions but more pronounced.
I am just getting the bottom half of the stream, treating it as 2-bytes per pixel, little endian and that's it. In code I also tried to do some linear AGC scaling but the clipping/noise areas are still there. They do change on each calibration (shutter cycle of the camera)
Any help? I'm I missing something, is there some further processing that has to be done? (Thanks!)
[EDIT]
It looks like the issue is with ffmpeg. Somehow it messes-up the data, not giving actual raw values (or maybe the options I pass are not correct). With opencv I'm able to get proper data.