DJI Mavic, Air and Mini Drones
Friendly, Helpful & Knowledgeable Community
Join Us Now

DJI Thermal Images Processing (converter to .tiff) SOLVED!

Miro_Rava

Well-Known Member
Joined
Jul 17, 2023
Messages
54
Reactions
22
Age
23
Location
Italy
Hi Guys, I want to share my findings, here I made a simple tool with gui that let you convert any type of DJI thermal image into a Tiff image with one band containing temperature in celsius.

I made it using the DJI thermal SDK and python.

It is Hosted on my website and packaged as a self extracting .exe with 7zip,

I needed to package it because it needs part of the Dji sdk as dependency.

just download it, run(extract) where you want, and after extraction open the GUI that is the file called: "DJI Image Processor.exe"


1702410906183.png

It works with all dji models supported by the DJI Thermal SDK

This is the link: https://miro-rava.com/documents/DJI_Image_Processor.exe

Note: The section called"DJI Air 2 -Frame Extractor" was used for another purpose: (extracting geotagged frames from Air 2 videos giving as input a starting altitude)

contact me for the source code or any information!
 
Hello, I just tried converting a folder with H2OT thermal jpegs and I doesn`t seem to be working. A cmd panel opens for one second and then closes, so nothing is happening. It would be really helpful if it would work. Thanks.
 
Hello, I just tried converting a folder with H2OT thermal jpegs and I doesn`t seem to be working. A cmd panel opens for one second and then closes, so nothing is happening. It would be really helpful if it would work. Thanks.
Sorry for the late reply, it is strange, could you explain what you did in detail?
Does the GUI open?
Can you send me a sample image so the I can test if on machine it works?
I Will try to fix the issue and write you back as soon as possible!

Ps: i didn't add any error messages in case something does not work, but I will try to add them so it is better for debugging problems
 
Hello, I just tried converting a folder with H2OT thermal jpegs and I doesn`t seem to be working. A cmd panel opens for one second and then closes, so nothing is happening. It would be really helpful if it would work. Thanks.
Did you rename the Images before using this tool? If soo, then it is a simple fix from my side
 
I've just updated the file with some debug info in case of wrong images or changed name schemes, now it should work regardless of the naming of the files

just delete your previous download and use the same link to download it again.

Let me know if it works
 
Hello,
Sorry for the late answer too. I have just tested the app and it is working perfectly. Thanks a lot for the help!
 
Hello,

I tried downloading the program to convert Mavic 3 Thermal images and I seem to only get blank white tiffs as a result. My settings were default except distance = 20 and Maintain RTK data checked. Do you have any suggestions?

Thank you for your hard work!
 
Hi, this is normal, they are supposed to look like totally white,
Even if they look white they contain data inside, each pixel contains the actual temperature reading in Celsius of that pixel as a floating point.
To explore these white tiffs it's possible to use an image viewer like ImageJ or maybe you can use them to produce an orthophoto with Pix4d mapper or Agisoft Metashape Pro.

This tool that I created is useful because the temperature value is contained in the original dji thermal Jpg as an encrypted embedded value in the Metadata of the image, so it is not easily accessible with any other program, but with this you can now extract a tiff with plain temperature value for each pixel.

Only to reiterate, radiometric tiffs often appear all white in the normal windows image viewer (it is made only to see rgb values)

If you have any questions fell free to ask, I will happily reply to you as soon as possible!

Have a nice day!
 
  • Like
Reactions: kellerbaum
I tried importing the tiff files into Metashape to create the orthomosaic and it worked great! Thank you for the explanation and the excellent tool.

Have a wonderful day!
 
I tried importing the tiff files into Metashape to create the orthomosaic and it worked great! Thank you for the explanation and the excellent tool.

Have a wonderful day!
Glad that it worked!
I don't know if you do this, but to obtain more accuracy in Metashape, you can also import rgbs alongside the thermal tiffs, and select a multi camera system when importing them.
If you do this you can obtain a really accurate orthomosaic and change the palette also after before exporting.

If you are interested in this procedure I can explain you my usual workflow since I daily drive Metashape for this type of projects
 
Glad that it worked!
I don't know if you do this, but to obtain more accuracy in Metashape, you can also import rgbs alongside the thermal tiffs, and select a multi camera system when importing them.
If you do this you can obtain a really accurate orthomosaic and change the palette also after before exporting.

If you are interested in this procedure I can explain you my usual workflow since I daily drive Metashape for this type of projects
Hi!

I am interested in your workflow for processing the photos as multi camera system. When I upload my RGBs and converted tiffs to Metashape, it won't recognize them as a multi-camera system, and they don't share the exact same location. I'm concerned if converting to tiff somehow modifies the RTK coordinates.
 
Hi!

I am interested in your workflow for processing the photos as multi camera system. When I upload my RGBs and converted tiffs to Metashape, it won't recognize them as a multi-camera system, and they don't share the exact same location. I'm concerned if converting to tiff somehow modifies the RTK coordinates.
This is my workflow for Metashape:

  • Convert the Tiffs with my tool (if you want to keep RTK accuracy turn on the option in my tool)
  • prepare this kind of folder structure:
    • MAIN_FOLDER:
      • Rgb_image_wide_1.jpg
      • Rgb_image_wide_2.jpg
      • Rgb_image_wide_3.jpg
      • Rgb_image_wide_4.jpg
      • Ecc...
      • THERMAL_IMAGES_FOLDER:
        • Tiff_image_1
        • Tiff_image_2
        • Tiff_image_3
        • Tiff_image_4
        • Ecc...
  • Open metashape pro and go to Workflow ->Add folder: add the MAIN_FOLDER
  • In the windows that pops up select: Multi-Camera System:
1705317342463.png
  • Press OK (don’t worry if the tiff all appear white and you only see the wide rgb)
  • Go to Workfolw and Align photos with this settings:
1705317401254.png
(choose accuracy depending on your needs)​
  • Press OK and wait for alignment
  • Save your project in .psx format
  • After Alignment go to Workflow -> Build Dem: use this settings:
1705317465310.png
(chose quality depending on your needs)​
  • Press OK and wait for DEM building finish
  • After DEM building go to workflow -> Build Orthomosaic:
1705317521017.png
  • Press OK and wait for process to finish
  • After the Orthomosaic is built , to view it , click on the ortho panel:
1705317584779.png
  • Then open the Tool Menu -> Set Raster Transform: this window will pop up:
1705317632135.png
Under output bands, in the “expression” field, write: B4
also MAKE SURE THAT “Enable Transform” IS CHECKED!
  • Click APPLY, then go to Palette (upper left)
1705317685459.png
(note that the graph you will see displayed will be different from mine)​
  • Click on the two circling arrows near the AUTO button
  • Then click AUTO (you can also manually tweak the temperature range)
  • Finally click APPLY

You should now see the thermal orthophoto as an orthomosaic with radiometric data!

Let me know if this helps or you find problems in the procedure,

Also, regarding the RTK accuracy, each pair of rgb and tiff image will probably have a little different gps coordinates, because in the meantime the drone was moving the two photos were taken with some delta time between them.
This can explain why the RTK data of the thermal images will not be equal to the rgb images for each pair.

I hope this procedure helps, if you have problems let me know!
 
Hello,
I try to convert images from Mavic 3 T (EU) but the application tell me the images are not DJI Thermal Images.
I'm on a MacBook with Parallels Desktop.

Thanks for your help!
 

Attachments

  • Capture d’écran 2024-01-14 à 23.47.35.png
    Capture d’écran 2024-01-14 à 23.47.35.png
    93.8 KB · Views: 10
Hi, This is strange, can you describe better in what sense you are on a macbook with parallel desktop?
My application runs only on windows, maybe this is the problem.
or maybe the photos are the problem, you can try to send some sample photos directly to me and I will try if on my machine it works and let you know!

if you cannot attach the photos here you can send them at this email: [email protected]

I hope that this helps!
 
Hi, This is strange, can you describe better in what sense you are on a macbook with parallel desktop?
My application runs only on windows, maybe this is the problem.
or maybe the photos are the problem, you can try to send some sample photos directly to me and I will try if on my machine it works and let you know!

if you cannot attach the photos here you can send them at this email: [email protected]

I hope that this helps!
Thank you Miro, i just have send a mail with the two pictures.

Parallels Desktop enables you to add Windows, Linux, or another operating system to your Mac by creating a virtual machine (VM)—a virtual PC inside your Mac.

Thanks for your help! ;)
 
  • Like
Reactions: Miro_Rava
Hi, I've just sent you an email in response,
I tried to convert you pictures and my program works, I think that the problem must be related to the different environment, even if that seems strange to me, if what you are using is a virtual machine it should work just fine.

One supposition I have is that the error you have is raised when the DJI SDK exe wasn't able to convert the image, either because the image is not a real rjpeg or either because the DJI SDK exe cannot be launched by the main application.
This might be because the dji sdk exe requires some additional packages that usually comes preinstalled in windows but not in your virtual machine.

Let me know if this clears your ideas or if I can help in some other way.
 
Thank you Miro, i just have send a mail with the two pictures.

Parallels Desktop enables you to add Windows, Linux, or another operating system to your Mac by creating a virtual machine (VM)—a virtual PC inside your Mac.

Thanks for your help! ;)
Hi, I've just sent you an email in response,
I tried to convert you pictures and my program works, I think that the problem must be related to the different environment, even if that seems strange to me, if what you are using is a virtual machine it should work just fine.

One supposition I have is that the error you have is raised when the DJI SDK exe wasn't able to convert the image, either because the image is not a real rjpeg or either because the DJI SDK exe cannot be launched by the main application.
This might be because the dji sdk exe requires some additional packages that usually comes preinstalled in windows but not in your virtual machine.

Let me know if this clears your ideas or if I can help in some other way.

Another option it could be Exiftool that doesn't execute correctly,
Are you using the option to maintain RTK accuracy? because this option uses exiftool, try turning this of if you are using it, maybe it will run. If still it outputs an error then I will try to dig deeper and find why
 
Another option it could be Exiftool that doesn't execute correctly,
Are you using the option to maintain RTK accuracy? because this option uses exiftool, try turning this of if you are using it, maybe it will run. If still it outputs an error then I will try to dig deeper and find why
Ok, thank you for your quick response, I'll try some tests tomorrow after work.
I'll tell you the results ;)
 
  • Like
Reactions: Miro_Rava
This is my workflow for Metashape:

  • Convert the Tiffs with my tool (if you want to keep RTK accuracy turn on the option in my tool)
  • prepare this kind of folder structure:
    • MAIN_FOLDER:
      • Rgb_image_wide_1.jpg
      • Rgb_image_wide_2.jpg
      • Rgb_image_wide_3.jpg
      • Rgb_image_wide_4.jpg
      • Ecc...
      • THERMAL_IMAGES_FOLDER:
        • Tiff_image_1
        • Tiff_image_2
        • Tiff_image_3
        • Tiff_image_4
        • Ecc...
  • Open metashape pro and go to Workflow ->Add folder: add the MAIN_FOLDER
  • In the windows that pops up select: Multi-Camera System:
  • Press OK (don’t worry if the tiff all appear white and you only see the wide rgb)
  • Go to Workfolw and Align photos with this settings:
(choose accuracy depending on your needs)​
  • Press OK and wait for alignment
  • Save your project in .psx format
  • After Alignment go to Workflow -> Build Dem: use this settings:
(chose quality depending on your needs)​
  • Press OK and wait for DEM building finish
  • After DEM building go to workflow -> Build Orthomosaic:
  • Press OK and wait for process to finish
  • After the Orthomosaic is built , to view it , click on the ortho panel:
  • Then open the Tool Menu -> Set Raster Transform: this window will pop up:
Under output bands, in the “expression” field, write: B4
also MAKE SURE THAT “Enable Transform” IS CHECKED!
  • Click APPLY, then go to Palette (upper left)
(note that the graph you will see displayed will be different from mine)​
  • Click on the two circling arrows near the AUTO button
  • Then click AUTO (you can also manually tweak the temperature range)
  • Finally click APPLY

You should now see the thermal orthophoto as an orthomosaic with radiometric data!

Let me know if this helps or you find problems in the procedure,

Also, regarding the RTK accuracy, each pair of rgb and tiff image will probably have a little different gps coordinates, because in the meantime the drone was moving the two photos were taken with some delta time between them.
This can explain why the RTK data of the thermal images will not be equal to the rgb images for each pair.

I hope this procedure helps, if you have problems let me know!
Thank you for this! Very helpful, and creates a beautiful orthomosaic, but unfortunately when I open it in ArcGIS it shows pixel DN instead of radiometric data...
 

DJI Drone Deals

New Threads

Forum statistics

Threads
134,673
Messages
1,597,398
Members
163,162
Latest member
4IKI
Want to Remove this Ad? Simply login or create a free account