Hi all,
Should it be of interest to someone...
I received my HT-301 a month ago now and the feeling I had with the HTI app was pretty bad. Thermviewer tried but that too has problems.
The HTI app just doesn't work, thermviewer does but the pictures taken don't hold the info I had on screen nor does the export allow me to do post-processing.
In short, I have not had a "wow experience" so far and from reading this forum, I'm not alone.
I made inquiries to obtain the SDK to overcome this obstacle. From HTI I got the answer "no" - I sent zrq a pm on this forum but have not yet received a response back.
So I have been looking further and guess what: I found a way to do postprocessing on the images taken with the HT-301
<< sorry if you're already
by now
>>
I started looking for windows apps and found the one from i3-thermalexpert.com called TE_Analist.
Together with the application came a folder with examples wich was nice to analyse the file structure it reads in and it had similarities... so I started working on converting one into the other.
It's WIP , and I started with a WhiteHot image taken from my device.
I found out that this app was using three files:
* the IR image (saved as "..._IR.jpg")
* a Visual picture ( " ..._VIS.jpg") and
* a csv file ("...TEMP.csv")
For the VIS file, I used one from the examples. It doesn't match but who cares. I don't...
The IR.jpg was my jpg saved by thermviewer but from testing the app doesn't seem to use it.
So, to be expected, the interesting file was the csv one.
I wrote a function in powershell that I could launch from the prompt taking my ...temps.txt file as input and generating half of the TEMP.csv file.
Half since the csv is twice as big...
To build the second half I had to save my jpg as an 8-bit bitmap (it's only grey anyway) and grab the pixel values.
This worked!!!
I now have a postprocessing tool allowing me to switch colormap in postprocessing, adapt the ranges & everything.
This second half has not yet been automated though, I'm still crunching on that aspect ( I'm but an amateur-developer) but the concept is working.
This is the powershell function I used:
function SplitFile([string]$srcFile, [int]$w)
{
$acc_val="8", "384"
If (-not ($w -in $acc_val) )
{ "Illegal input: {0}, accepted values are 8 or 384 " -f $w
return}
# First we set the destination filename out of the input filename
# go from file 'C:\...temps.txt' to 'C:\...temp.csv' (.log for testing purposes)
$a_File=$srcFile.split("\")
$cnt=$a_File.Count-1
if ($cnt -eq 0 -Or $a_File[0].Indexof(":") -eq 0 )
{
"Path info missing, incomplete or incorrect (No ':' or '\' found)"
return
}
if ( $a_File[$cnt].Indexof("temps.txt") -eq 0 )
{
"Bad Input File-name (I expected temps.txt at end): {0}" -f $srcFile
return
}
$pos=$a_File[$cnt].Indexof("s.txt")
$a_File[$cnt]="IMG_"+$a_File[$cnt].Substring(0,$pos)+".log"
$destFile=$a_File -join '\'
if (Test-Path $destFile)
{
Remove-Item $destFile
}
# Now start processing the sourcefile
# Start by appending a space at the end, we need it for the chunking to match.
# we're going to chunk it in lines of $n chars, then divide all entries by 100 keeping the resolution to 2 decimals and finally change the
# delimiter from space to comma.
$a = gc $srcFile
$a = $a + " "
$n = $w * 5
$min = 1000
$max= 0
"Reading from: {0}" -f $srcFile
"Writing to: {0}" -f $destFile
"New line every {0} characters or {1} temperature readings" -f $n, $w
do
{
$lijn=$a.substring(0,$n)
$a=$a.Substring($n)
$a_lijn=$lijn.split(" ")
$lijn = ""
$a_lijn | ForEach-Object {
"{0:n2}" -f ($PSItem / 100)
}
for ($i=0; $i -lt $w; $i++)
{
$a_lijn[$i] = "{0:n2}" -f ($a_lijn[$i] / 100)
If ($max -lt $a_lijn[$i]) {$max = $a_lijn[$i]}
If ($min -gt $a_lijn[$i]) {$min = $a_lijn[$i]}
}
$a_lijn -join ',' | out-file -encoding ascii -append $destFile
} while ($a.length -ge $n)
"Highest temperature found: {0}" -f $max
"Lowest temperature found: {0}" -f $min
# now remove the last <CR><LF> from the output file.
$stream = [IO.File]::OpenWrite($destFile)
$stream.SetLength($stream.Length - 2)
$stream.Close()
$stream.Dispose()
}
Any feedback welcome, congrats & booing all fine (as long as you have a good reason for it
)
Cheers!