LeoDJ / P2Pro-Viewer

A viewer and API for the InfiRay P2 Pro thermal camera module
MIT License
179 stars 24 forks source link

New commands and bug fixes #18

Open Pinoerkel opened 10 months ago

Pinoerkel commented 10 months ago

added some useful P2 Pro commands for

color coding fix that applies when internal camera palettes are set

clientforgit commented 2 months ago

Hi! I'm trying to get rid of one problem with p2pro using your code. The problem is that p2pro calibrates itself after a while (from 5 to 60 seconds) and I need to disable it. I tried disabling shutter auto mode but it didn't help. Can you please tell me where did you get the protocol documentation?

Pinoerkel commented 2 months ago

I think I did not put that part in there on purpose, because it might be irreversibly dangerous when used incautiously. The auto shutter feature can be configured via many parameters, including time and temperature intervals which trigger the automatic shutter in certain cases. It also has a feature to automatically close the shutter on extensive overexposure which might damage the sensor otherwise (e.g. the sun or a welding spot). Turning off the automatic shutter will result in large temperature drifts over time. Your temperatures might be total bogus after a while. Nonetheless, I could extend the code accordingly, if you wish so.

clientforgit commented 2 months ago

Thank you for your response! If turning off the automatic shutter will result temperature drifts can you at least add configuration to time and temperature intervals? (if turning off is not working I want to increase the time interval). But I would be glad if you would add all possible configurations related to the shutter with mentioning or restricting safety boundaries. Also, can we talk about this privately? My telegram: https://t.me/MS_Faust

Pinoerkel commented 2 months ago

Since the owner of this repository is obviously not interested in my pull request, I checked in some modifications for full shutter control in my fork of this repository. Feel free to grab them from there. https://github.com/Pinoerkel/P2Pro-Viewer The parameters have some information and min/max values in the comments. There is a function for getting and printing all parameters and I put another function with an example for setting parameters and a warning notice. Use it at your own risk. Sorry, I do not use Telegram.

clientforgit commented 2 months ago

Thank you very much for your update, it works!

clientforgit commented 2 months ago

Hi! I have a few more questions about the capabilities of protocol:

  1. Can we change the thermal diapason of a camera?
  2. Can we change the white balance, and contrast brightness?
  3. Can we get raw data from the thermal matrix?
Pinoerkel commented 2 months ago
  1. I do not know what you mean by that. But if it is the gain settings: the P2 pro has low and high. With one covering lower temperatures at better noise levels and the other one covering higher temperatures.
  2. You can get 14bit raw values which are stored in the lower half of the output image. See video.py, thermal_data
  3. A monochrome image has no white balance neither does a color gradient mapped version of one in the traditional way. You can however take the raw values and do your own image processing on it e.g. using OpenCV.