Author Topic: RPi/SBC/Topdon TC001/clone Tester request (Thermal Camera Redux v0.9.3) Github  (Read 15184 times)

0 Members and 1 Guest are viewing this topic.

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
UPDATE:

2024-01-27: Version 0.9.3 modifications have been pushed to github to optionally build with dynamic border layout.
2024-01-25: Version 0.9.2 modifications have been pushed to github to optionally lock out camera's colormap auto-ranging.
2024-01-18: Version 0.9.1 modifications have been pushed to github for weak and single threaded/single core hardware.

"Thermal Camera Redux" is being posted to Github. 

All future updates will be available there free, for personal, non-commercial use.

No Microsoft, Apple or similar app stores required.  :)

Vive la Open Source !!!

https://github.com/92es/Thermal-Camera-Redux



UPDATE: The Python script has been abandoned in favor of a port to C/C++ for optimization and threading concerns.

I have been modifying Les Wright's PyThermalCamera python script on Debian 11 and would like to know if there are any RaspPi/Topdon TC001 users out there that would like to test the potential RasbPi bug fixes and new features.

I think I may have fixed the Fullscreen transitioning issues in addition to the following additional mods.

- Added Fahrenheit temp displays and toggle key to switch between F and C
- Floating MIN/MAX temps no longer get written off screen past the display edges.
- Floating MIN/MAX temps don't overwrite HUD menu text (but the target dots will to retain X,Y location).
- Added MIN/MAX temp labels.
- Added Frames Per Second display to HUD menu.
- Added ability to cycle backwards in addition to forwards through the color maps for quicker access.
- Added some speed optimizations in the animation loop.
- Added ability to have more scale modes based on your display size.  Note: larger scales require more CPU cycles.
- Added Fullscreen to cycling scale modes when max scale is exceeded.
- Scaling in Fullscreen mode automatically transitions to scaled resize windows when appropriate.
- Added window manager borders for additional move/resize, show/hide controls.
- Added some toggle keys.
- Some various visual changes to enhance readability.
- Fixed some minor issues.

If anyone is interested in testing the modded script, please let me know through PM or post in this thread.

NOTE: Min temp does not overwrite HUD text, but the blue dot in the upper left corner is free to float over the HUD menu according to its target location.



NOTE: If the HUD menu is turned off, the text moves close to the dot but does not get written off the top of the screen.  It slides slightly lower than the dot to stay in view on screen.



Thanks much to Les Wright for doing the heavy lifting on the Python script.  I have been looking for a thermal camera solution that doesn't tie me to a smart phone app and a lot of $$$.
« Last Edit: January 29, 2024, 12:00:34 am by G28 »
 
The following users thanked this post: Amish Technician

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #1 on: November 15, 2023, 06:22:37 am »
After making yesterday's post, I realized there were some intermittent bugs in the calculation of the Min/Max/Avg temps and respective screen locations.  You can see the Min temp is higher than the crosshair temp in the original picture.

Fixing those bugs in Python is resources prohibitive, so I ported the code to C/C++ to get more optimizations.  The C++ OpenCV libraries are multi-threaded versus the single threaded Python library.  Processor utilization has gone down and frame rates are native for the Topcon TC001 (even with the bug fixes).

Here are both of the frames (top=image, bottom=thermal).  The C++ library has twice as many color maps plus the initial map so @ 23 in total.

Will be adding some more features with the extra headroom and possibly some frame manipulations (image rotate/flips, single/dual frame display, frame swap, etc.).

The thermal frame appears to have its merit.

Python is now in the rear view mirror.

« Last Edit: November 15, 2023, 06:26:45 am by G28 »
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #2 on: November 17, 2023, 06:29:44 am »
Another update. 
    Added a few extra display formats (see picts below) as well as a handful of interpolation methods.
    Scaled fonts to grow/shrink with image scaling.
    Added ability to disable all graphical overlays.
    Added another thread to parallel thermal data harvesting and image preparation.
    Added hot key to reset all configurations to default.
    Did some prerf profiling and optimizations from the perf results.
    Will probably add a user defaults config file.
    Will be adding data logging over time for graphed analysis.
    Found some v4l2 APIs that should allow application control of the camera's following User Controls.

    Does anyone know what APIs control emissivity settings of the TC001 ?

    Any other feature ideas ?

    Tracking temp with mouse or arrow keys to move center crosshair temp ?

Code: [Select]
User Controls:
                     brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=0
                       contrast 0x00980901 (int)    : min=0 max=100 step=1 default=50 value=50
                     saturation 0x00980902 (int)    : min=0 max=100 step=1 default=64 value=64
                            hue 0x00980903 (int)    : min=-180 max=180 step=1 default=0 value=0
        white_balance_automatic 0x0098090c (bool)   : default=1 value=1
                          gamma 0x00980910 (int)    : min=100 max=500 step=1 default=300 value=300
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=1 value=1
0: Disabled
1: 50 Hz
2: 60 Hz
      white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=10 default=4600 value=4600 flags=inactive
                      sharpness 0x0098091b (int)    : min=0 max=100 step=1 default=50 value=50
         backlight_compensation 0x0098091c (int)    : min=0 max=1 step=1 default=0 value=0


Single Image Frame:


Single Thermal Frame:


Dual Horizontal Image / Thermal Frames:


Dual Vertical Image / Thermal Frames:
« Last Edit: November 17, 2023, 06:35:37 am by G28 »
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #3 on: November 17, 2023, 09:51:11 am »
And another update. 

Here is a feature to monitor/log multiple user locations of interest at once (in addition to the existing monitoring points).

Add more monitoring points by clicking on the display.

This could be useful when doing bench work with the camera on a fixed stand and fixed work piece.

 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #4 on: November 20, 2023, 05:57:50 am »
Not much more to add other than some more threading and rendering profiling optimizations.

High/Low alarm snapshots and recordings will probably go in next.

Time to put it to good use.

 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #5 on: November 21, 2023, 06:58:14 am »
Today's new feature.

Added optional colormap scale (right side of the screen) and controls to lock/unlock colormap auto-ranging.

« Last Edit: November 21, 2023, 10:38:52 am by G28 »
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #6 on: November 22, 2023, 09:58:14 am »
Added movable horizontal and vertical temperature rulers.


 

Offline ZigmundRat

  • Regular Contributor
  • *
  • Posts: 126
  • Country: us
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #7 on: November 23, 2023, 05:15:11 pm »
Thanks for sharing this and posting the updates. Following with some interest  :popcorn:
 
The following users thanked this post: G28

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Portrait and Landscape Rotations in 90 degree increments
« Reply #8 on: December 02, 2023, 06:33:51 pm »
Added Portrait and Landscape video rotations in 90 degree increments to all of the scaling and layout formats to compensate for the camera orientation (USB port location top/bottom/left/right) and cable management.

Window height/width ratios and graphics overlays adjust accordingly to current rotation.

Added 5 user defined color maps in addition to all of the OpenCV C++ stock color maps.

Added realtime crosshair temp tracking indicator ">" to the color map gradient bar along with a few distributed temps along the gradient scale for reference.

Portrait Rotations:



Landscape Rotations:

« Last Edit: December 02, 2023, 06:47:16 pm by G28 »
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Twilight Color Map
« Reply #9 on: December 02, 2023, 06:53:11 pm »
FWIW, the "Twilight" color map does a great job of literally illuminating uninsulated walls.

 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Coming next ...
« Reply #10 on: December 02, 2023, 08:35:56 pm »
After using the camera, taking snapshots and videos, I still routinely have questions afterwards about the captured data. 

Since static images can't answer those questions (what is the temp gradient over there, what would it look like with a different colormap or interpolation method, etc.), it appears post processing analysis would address those questions.

Should be able to take stills and videos of the raw data frames and then offline, play them back through the app doing everything to the captured stills/streams as if they were live from the camera, recreating the exact thermal environment that existed when the stills/streams were captured.  It will allow one to recreate almost anything one forgot to do when it was live.

This offline post processing will facilitate examination of temps anywhere on the screen, switching between C/F, application of any color map, threshold, onscreen display, layout formats, scaling/fullscreen, interpolation method, blur setting, contrast setting, take composited snapshots, composited recordings with varied configurations, etc.

This feature is probably more important for documentation than pre-composited stills and videos.
« Last Edit: December 02, 2023, 08:52:44 pm by G28 »
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #11 on: December 02, 2023, 11:09:52 pm »
Thanks for sharing this and posting the updates. Following with some interest  :popcorn:

If you have a Topdon TC001 or equivalent, you are welcome to try the app on Linux.
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #12 on: December 04, 2023, 06:07:13 am »
Offline post processing of raw stills is up and running. 

Offline post processing of looped raw video clips will be next.

Can now go back and pull data not captured in the .png snapshots.
 

Offline Amish Technician

  • Contributor
  • Posts: 30
  • Country: gb
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #13 on: December 05, 2023, 07:04:48 pm »
I'm also following with some interest, thanks for posting.

I have a Topdon TC001 and various RaspPi's and I'm interested in giving this a try. Where can I find it, is it on github or somewhere like that?
 
The following users thanked this post: 5U4GB, G28

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Another update
« Reply #14 on: December 06, 2023, 03:19:26 am »
- Both offline raw still and video post processing is working, but the raw video could use some stream compression.
- Updated temp marker locations to be centered in the scaled/interpolated pixels vs the North West corner.
- Added left mouse button drag functionality to position the horizontal and vertical temp rulers.
- In honor of James Doohan locking himself into the pattern buffer in an infinite loop, I added "Freeze Frame" functionality to the live video camera feeds and offline raw video playback.  This allows one to change configuration options on the frozen frame (live or playback), analyze and take snapshots.


 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #15 on: December 06, 2023, 03:47:22 am »
I'm also following with some interest, thanks for posting.

I have a Topdon TC001 and various RaspPi's and I'm interested in giving this a try. Where can I find it, is it on github or somewhere like that?

PM Sent
 
The following users thanked this post: Amish Technician

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Another Update
« Reply #16 on: December 07, 2023, 03:42:28 am »
Increased the number of colormaps to 37

Adding default startup configurations.

Added initial pass of optional Histogram Equalization filtering for monochrome colormaps. 

Somewhat underwhelming but may have some utility.    :-[



« Last Edit: December 07, 2023, 05:49:40 am by G28 »
 

Offline ZigmundRat

  • Regular Contributor
  • *
  • Posts: 126
  • Country: us
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #17 on: December 07, 2023, 02:40:53 pm »
Don’t have one yet, but it’s on my short list :) Still following, I just don’t have the time or space at the moment (still settling in after moving house). Any suggestions for what the minimum platform would be? There are many rPi versions now.
« Last Edit: December 07, 2023, 02:47:23 pm by ZigmundRat »
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Re: RasbPi and Topdon TC001 (guinea pig) Tester requested
« Reply #18 on: December 07, 2023, 06:52:43 pm »
Don’t have one yet, but it’s on my short list :) Still following, I just don’t have the time or space at the moment (still settling in after moving house). Any suggestions for what the minimum platform would be? There are many rPi versions now.

I am using it on a Debian 11 PC with a 14' USB cable and tripod.  No reason why you can't use a Linux PC/Laptop (or Linux VM Guest).  Sooner or later I will try it on a ProxMox Linux guest.

I don't have a RasbPi, but we may have a RasbPi guinea pig tester providing that feedback soon. 

It is built with OpenCV 4.5.1 (latest version is 4.8.0) and some of the features require minimum versions of OpenCV such as the Histogram Equalization API.

I will probably be adding 2D and maybe 3D plots soon if I can find/decide on a descent plotting library.  More features tend to require more CPU cycles. 

Could also dump the data in a suitable format for use with MATLAB/GNU Octave plotting.

Octave Example Plots:


P.S.

FWIW, the Topdon USA site had the TC001 for $195 a couple of weeks ago, but they appear to have jumped back to $230.
« Last Edit: December 07, 2023, 08:33:39 pm by G28 »
 

Offline ZigmundRat

  • Regular Contributor
  • *
  • Posts: 126
  • Country: us
Fair enough. I have plenty of laptops available. It would be neat if it were possible to get this running on a pico in some fashion. It will be interesting to see if it will run on a Pi 4, probably no problem on a Pi 5 but I don't have one yet. My goal is just to have something self-contained that doesn't need to be plugged in.
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Fair enough. I have plenty of laptops available. It would be neat if it were possible to get this running on a pico in some fashion. It will be interesting to see if it will run on a Pi 4, probably no problem on a Pi 5 but I don't have one yet. My goal is just to have something self-contained that doesn't need to be plugged in.

You would still need a reasonable display.
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Thermal Camera Redux - Feature Update
« Reply #21 on: December 08, 2023, 02:12:17 am »
Added an enhanced mode to the horizontal and vertical rulers.

In addition to displaying 7 vertical and horizontal temps that can be dragged around the screen, a hairline average temp reference horizontal and vertical (black) line has been added. 

In addition to that reference (black) line, another plot (white) line is added representing all of the temps (256 + 192) for the current row and column, on, above or below the average temp reference line.  This reference line is drawn centered under the '+' temp markers in the ruler.

This allows one to visually see relative spikes and dips relative to the average baseline along both rulers as they move around the screen.

« Last Edit: December 08, 2023, 03:00:34 am by G28 »
 

Offline ZigmundRat

  • Regular Contributor
  • *
  • Posts: 126
  • Country: us
The standard LCD display for the pi 3/4 is 800x480 (with HDMI an option). How does that resolution fit with the application? I’m afraid I’m not familiar with the original Python app either.

With the LCD, it’s under 10W with a pi3. I’m not sure how much the TC001 consumes, but I think this portable operation should be possible. A reasonably sized LiPo battery should provide 2 hours or more of continuous operation.
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
The standard LCD display for the pi 3/4 is 800x480 (with HDMI an option). How does that resolution fit with the application? I’m afraid I’m not familiar with the original Python app either.

With the LCD, it’s under 10W with a pi3. I’m not sure how much the TC001 consumes, but I think this portable operation should be possible. A reasonably sized LiPo battery should provide 2 hours or more of continuous operation.

Ya killing me !!!  Back to building a ship in a bottle.   ;D

I rebuilt with a max screen resolution of 800 x 480 and get a max scale factor of 2X.

Here is native resolution @ 1X scale.



Here is 2X scale with and without the onscreen display.



This one has some random user defined temp locations added.



The ruler's display with 7 x 7 temps would have to be paired down by at least half, maybe 4 x 4 temps or 3 x 3 temps.

The software could be configured to conditionally compile out features for paired down use cases.

Double wide and double high layout displays would have to be done in 1X scaling to fit 800x480.

I am running @ 2560x1600 and get up to 8X scale with that resolution.

Fonts could be scaled smaller, but you may need to get out your spectacles.
« Last Edit: December 08, 2023, 04:43:13 am by G28 »
 

Offline G28Topic starter

  • Regular Contributor
  • *
  • Posts: 74
  • Country: us
    • Thermal Camera Redux
Quote from: ZigmundRat
The standard LCD display for the pi 3/4 is 800x480 (with HDMI an option). How does that resolution fit with the application? I’m afraid I’m not familiar with the original Python app either.

With the LCD, it’s under 10W with a pi3. I’m not sure how much the TC001 consumes, but I think this portable operation should be possible. A reasonably sized LiPo battery should provide 2 hours or more of continuous operation.

I spent a little time fine tuning the font and marker scaling for 1X and 2X scale.  Need to get a smaller resolution monitor to test on, but it looks like the 7 x 7 rulers will work on both resolutions.

The images have the one of the new ruler modes.  The pictured mode shows current row temp plots relative to Min/Avg/Max temps.

Ruler modes now have:

    - Single moveable temp
    - 7 x 7 movable temps
    - 7 x 7 movable temps with Horizontal (current row) Min/AvgMax temp plots
    - 7 x 7 movable temps with Vertical (current column) Min/AvgMax temp plots
    - 7 x 7 movable temps with both Horizontal and Vertical (current row and column) Min/AvgMax temp plots


1X Scale:


2X Scale:
« Last Edit: December 08, 2023, 09:44:30 pm by G28 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf