leswright1977 / PyThermalCamera

Python Software to use the Topdon TC001 Thermal Camera on Linux and the Raspberry Pi
Apache License 2.0
180 stars 35 forks source link

maxtemp appears incorrect at times #1

Open sycophantic opened 11 months ago

sycophantic commented 11 months ago

In the attached screenshot you can see the maxtemp is incorrect. I'm not sure the source, I looked at the code and it seems correct.

TC00120230716-195805

oskude commented 11 months ago

i think instead of this:

lomax = thdata[...,1].max()
posmax = thdata[...,1].argmax()
mcol,mrow = divmod(posmax,width)
himax = thdata[mcol][mrow][0]
lomax=lomax*256
maxtemp = himax+lomax
maxtemp = (maxtemp/64)-273.15
maxtemp = round(maxtemp,2)

we need to do this:

wat = np.add(thdata[...,0], np.multiply(thdata[...,1], 256))
maxtemp = wat[...].max()
posmax = wat[...].argmax()
mcol, mrow  = divmod(posmax, width)
maxtemp = (maxtemp/64) - 273.15