Please select Into the mobile phone version | Continue to access the computer ver.
H20T R-JPEG Images
8108 32 2020-7-10
Uploading and Loding Picture ...(0/1)
o(^-^)o
JonoMcG
lvl.2
South Africa
Offline

Good day All,

I've been working on trying to decode the R-JPEG images captured by the new DJI Zenmuse H20T thermal camera so that one can extract the temperature information from the images without needing to go through DJI Thermal Analysis Tools.

It seems crazy to me that DJI has not provided any way for a user to even export the actual temperature measurements for each pixel from their software into a different format (like a .csv or .tiff). The DJI Thermal Analysis Tool is extremely basic and very limiting for any proffessional inspection reporting using the thermal images.

I've managed to figure out that the raw thermal sensor values are stored within the APP3 segment of the Jpeg image as 16-bit unsigned integer pixels. I can export this out as a 16-bit .tiff image. However, these values are only the raw sensor values and does not give one the actual temperature measurements (the values in this image range from 18073 - 21222). Whereas when the same image is opened in DJI Thermal Analysis the temperatures range from 7.5°C to 27.7°C (depending on settings for emissivity, distance etc.).


Flir uses a formula like this to convert the raw sensor value to temperature: Temperature (in Kelvin) = (B / Log(R1/(R2*(S+O))+F))
S = 16 Bit Raw sensor value
T = object temperature in Kelvins
R1 = Planck R1 constant
R2 = Planck R2 constant
B = Planck B constant
F= Planck F constant
O = Planck O (offset) constant.
The specific calibration data above can be decoded from the Flir R-JPEG file using ExifTool. The guys there managed to reverse engineer the Flir format.


It seems like there could be some calibration data stored within the APP4 segment of the image. I am hoping that if we can decode this we would be able to use the calibration data to correct the raw sensor values to give actual temperature readings. Unfortunately my experience with reverse engineering binary data is next to nothing. Is there anybody else who has experience or any ideas with how to retrieve the calibration data (and subsequently the temperature info) from within the image?


On another note if DJI Support can give any insight into whether they have any planned support for getting the temperature information out of the image any other non-proprietary format?


I've uploaded the original H20T R-JPEG image as well as the converted raw sensor 16-bit .tiff image to the following OneDrive folder for anyone who wants to download and play around with it: https://hawk62aviation-my.sharepoint.com/:f:/g/personal/jonathan_hawk62aviation_onmicrosoft_com/ErzBhLPJjKpLvljPM6k6d4gBCm6gjeZNPjLBF7LS8_0Vaw
2020-7-10
Use props
rdosdcuatrogmail.com
lvl.1

Spain
Offline

hi JonoMCG unfortunately I have the same problem, DJI's solution is to wait for a terra update.  Have you been able to advance any further on this topic?  Who do you think could help us?
2020-7-10
Use props
rdosdcuatrogmail.com
lvl.1

Spain
Offline

I cant download the image not show link.
2020-7-10
Use props
JonoMcG
lvl.2
South Africa
Offline

I've posted the question on ExifTool's forum: https://exiftool.org/forum/index.php?topic=11401.msg61059#msg61059. They are the ones that managed to decode Flir's R-JPEG images so I'm sure they'd be able to do the same for DJI's R-JPEG images. I haven't had any more luck decoding it myself. Hoping somebody with more experience will jump on board.

Find it very frustrating that DJI would limit the use of their professional thermal camera so much. It's also very misleading to people to openly advertise that it is radiometric without letting people know that you cannot get temperature information out from the images except when looking at the images in their very basic and poorly designed DJI Thermal Analysis Tool.

What exactly did they say about Terra? Are they planning to allow users to convert the images from within Terra or only view them similar to the DJI Thermal Analysis Tool?

I've also updated the link in the previous post. It should work now. If not the images can also be downloaded from my post on ExifTool's forum.
2020-7-10
Use props
rdosdcuatrogmail.com
lvl.1

Spain
Offline

They want to improve DJI thermal analisis tools and add in terra an option to perform orthomosaics.  I count myself as your frustrated.  the camera is awesome and works really well but without being able to export images you cannot get its full potential.
If you want add me to telegram  @SamyNeutron
2020-7-11
Use props
AndreTaps
New

United Kingdom
Offline

Hi Guys,

I can now convert the R-JPEG images to .tiff. You can send me a personal message for more info.

Cheers
2020-11-19
Use props
MW_POE
lvl.2

United States
Offline

We would like to connect with an active developer community for the m300 platform. We need custom software including thermal analysis as you discussed. If interested message me. Let’s start a sub message group perhaps.
2020-11-20
Use props
fans663a4b75
lvl.3
Flight distance : 52 ft
  • >>>
Italy
Offline

Please help me too to convert R-JPG and use into pix4d or metashape.
2020-11-28
Use props
DrMrdalj
lvl.4
Flight distance : 1265978 ft
  • >>>
Serbia
Offline

Would anyone be so kind to share info on exporting M300 RJPG inspection findings in any report other then an screenshot?
2020-12-2
Use props
DrMrdalj
lvl.4
Flight distance : 1265978 ft
  • >>>
Serbia
Offline

I am VERY disappointed with all the software and marketing decisions in Enterpise and Agriculture DJI platforms - H20T “radiometric” capability is the last example... There is no export option in DJI Analysis Tool, there is no TIFF in recording options... in many ways it is step backward from XT2 if you are not exclusively  into security.. Onother great example is that T16 and T20 spraying drones can not import KML or any other external mission geometry (not even plot boundary) and there is no such option even in DJI Terra - all spraying missions has to be drawn by hand in the app or “automatically” in the Terra.... Even when mission is automatically created there is no inspector tool for waypoints, so you can dread the altitude/height of the waypoint...  Then, if you happen to use P4RTK or M210RTKv2 there is full KML support for mapping missions
So many gotchas that seem intentional...
2020-12-2
Use props
JonoMcG
lvl.2
South Africa
Offline

RE: H20T R-JPEG Images

DrMrdalj Posted at 12-2 18:08
I am VERY disappointed with all the software and marketing decisions in Enterpise and Agriculture DJI platforms - H20T “radiometric” capability is the last example... There is no export option in DJI Analysis Tool, there is no TIFF in recording options... in many ways it is step backward from XT2 if you are not exclusively  into security.. Onother great example is that T16 and T20 spraying drones can not import KML or any other external mission geometry (not even plot boundary) and there is no such option even in DJI Terra - all spraying missions has to be drawn by hand in the app or “automatically” in the Terra.... Even when mission is automatically created there is no inspector tool for waypoints, so you can dread the altitude/height of the waypoint...  Then, if you happen to use P4RTK or M210RTKv2 there is full KML support for mapping missions
So many gotchas that seem intentional...

Good day All,

I have created the following  Windows command line tool that I use to convert the DJI R-JPEG images to .tiff temperature images (similar to the FLIR tiff format). The temperatures within the converted tiff images are equal to the pixel value / 10. You can use these images within Agisoft or Pix4D to process radiometric thermal orthophotos.

You can download the utility from the following OneDrive link: DJI H20T command line converter

There's a README file within the folder that gives you instructions on how to run it. It's a bit of a hack but it has been getting the job done for myself. The code is created from reverse engineering DJI's Thermal Analysis Tool. Anyone can read me about the source code / methodology on the following ExifTool forum thread: Exif Tool Forum Thread

Feel free to get the source code and improve the utility from the above Exif Tool Forum.
2020-12-3
Use props
fans48c0c119
lvl.1
Flight distance : 250459 ft
Spain
Offline

JonoMcG Posted at 12-3 09:21
Good day All,

I have created the following  Windows command line tool that I use to convert the DJI R-JPEG images to .tiff temperature images (similar to the FLIR tiff format). The temperatures within the converted tiff images are equal to the pixel value / 10. You can use these images within Agisoft or Pix4D to process radiometric thermal orthophotos.

Hello!

Your tool looks pretty good. I will test it more, but I have a question. Is it possible to convert not just a single picture but a whole folder at the same time?

Thanks in advance!
2020-12-10
Use props
JonoMcG
lvl.2
South Africa
Offline

fans48c0c119 Posted at 12-10 10:09
Hello!

Your tool looks pretty good. I will test it more, but I have a question. Is it possible to convert not just a single picture but a whole folder at the same time?

Not directly using the command line tool at the moment. I use the command line tool within a python script to iterate over a folder of images, exporting out each image individually:

For example:
import subprocess, osdirectory = "." #current folderfor root, dirs, files in os.walk(directory):   for f in files:
      if f.endswith("T.JPG"):
         file_path = os.path.join(root, f)
         p = subprocess.Popen(['C:\dev\Python\DJI_R-JPEG-converter-cmd-tool\dist\main\main.exe', '-o', folders['thermal_tiff'], file_path])
         p.wait()



It wouldn't be difficult to modify the command line script to be able to do this. I don't have time at the moment but anybody else is free to do so and share the modified version. All the python source code is shared on the Exiftool forum: https://exiftool.org/forum/index.php?topic=11401




2020-12-11
Use props
dseguradogmail.com
lvl.1
Flight distance : 1640 ft
Peru
Offline

AndreTaps Posted at 2020-11-19 02:24
Hi Guys,

I can now convert the R-JPEG images to .tiff. You can send me a personal message for more info.

Heyy Andretap!! Can you help me? I need to convert as well the format to .tiff
My email: david@linnaero.com
Thank you so much!!!
1-3 10:54
Use props
djiuser_hJNGGpRe8Isr
lvl.1

Australia
Offline

JonoMcG Posted at 2020-12-3 09:21
Good day All,

I have created the following  Windows command line tool that I use to convert the DJI R-JPEG images to .tiff temperature images (similar to the FLIR tiff format). The temperatures within the converted tiff images are equal to the pixel value / 10. You can use these images within Agisoft or Pix4D to process radiometric thermal orthophotos.

Hi Jono,

Thank you for creating this tool! I've just been testing it on my H20T images and have encountered a problem on my end. I ran the code (screenshot attached), and from the input image (screenshot attached) I have generated a blank image (screenshot attached).

Are you able to tell me what I am doing wrong here?

Thanks!

Elie
2-8 19:37
Use props
djiuser_hJNGGpRe8Isr
lvl.1

Australia
Offline

EDIT: opened in ArcGIS and can read tiff files. Thanks!
2-8 19:38
Use props
djiuser_hJNGGpRe8Isr
lvl.1

Australia
Offline

JonoMcG Posted at 2020-12-11 00:57
Not directly using the command line tool at the moment. I use the command line tool within a python script to iterate over a folder of images, exporting out each image individually:

For example:

Hi Jono,

Your script for extracting temp data from H20T photos has saved my life! I'm trying to use your python script for batch processing folders but can't get it to work for me. I am not too knowledgeable about python, I was wondering if I'd interpreted your code correctly?

import subprocess, osdirectory = "path to "main.exe file" :   for f in files:
      if f.endswith("T.JPG"):
         file_path = os.path.join(root, f)
         p = subprocess.Popen(['path to main.exe file', '-o', folders['thermal_tiff'], path to input photos])
         p.wait()

Is this correct?
2-9 19:09
Use props
CHEW_33
lvl.1

Japan
Offline

JonoMcG Posted at 2020-12-3 09:21
Good day All,

I have created the following  Windows command line tool that I use to convert the DJI R-JPEG images to .tiff temperature images (similar to the FLIR tiff format). The temperatures within the converted tiff images are equal to the pixel value / 10. You can use these images within Agisoft or Pix4D to process radiometric thermal orthophotos.

Hi, thank you very much for your efforts. I have tried on using your DJI H20T command line converter but I have been returned with failed execution message. Would you advise me on this error?
3-11 23:03
Use props
MMD
lvl.2
Flight distance : 106631 ft
  • >>>
Bosnia and Herzegovina
Offline

Hello,

I have problem running the script in cmd. When i run the command line i got message "Thiss app can't run on your PC..." can anyone help me with this?
4-20 01:36
Use props
Zeke13z
lvl.1
United States
Offline

Hi @JonoMcG!

After seeing your reply to DJI stating the M2EA images were similar to the H20T in their formatting, I was wondering if you had made any changes to the software you have created to accommodate the M2EA?

Second and the reason I'm asking the above question: I downloaded your tool and attempted to use it with the M2EA images and received this error. Would you have any idea what might've caused this?


4-20 13:40
Use props
JonoMcG
lvl.2
South Africa
Offline

Zeke13z Posted at 4-20 13:40
Hi @JonoMcG!

After seeing your reply to DJI stating the M2EA images were similar to the H20T in their formatting, I was wondering if you had made any changes to the software you have created to accommodate the M2EA?

Hi, no unfortunately not yet. It looks like the R-JPEG image format stored by the M2EA is of a completely different format to the H20T images. The .dlls used to do the conversion is different and therefore the utility I made won't work on the M2EA (same as the old DJI Thermal Analysis Tool).

DJI has released a new v2 of their Thermal Analysis tool that is compatible with the M2EA. This tool seems to use different .dlls to do the conversion of the M2EA images. If I find the time I might try look into doing some reverse engineering on the v2 Thermal Analysis Tool to see if I can figure out the function calls and parameters that are made to this .dll to be able to convert the M2EA images. If anybody else on this forum has time or experience in reverse engineering I'd appreciate the help..

Alternatively DJI has stated in an email to me that they will make their Thermal SDK (TSDK) compatible with the M2EA images in the future. No timeframe given though. Once they release the Thermal SDK one would be able to do the conversions though and I'd be able to update the utility.
4-26 00:24
Use props
JonoMcG
lvl.2
South Africa
Offline

For anyone converting H20T or XTS images and running into issues with my old script: DJI has released a Thermal SDK that makes these conversions fairly easy.. I'd suggest switching to using their official SDK to do conversions to the R-JPEG images for these cameras.

https://forum.dji.com/forum.php?mod=viewthread&tid=230321
4-26 00:28
Use props
Zeke13z
lvl.1
United States
Offline

JonoMcG Posted at 4-26 00:24
Hi, no unfortunately not yet. It looks like the R-JPEG image format stored by the M2EA is of a completely different format to the H20T images. The .dlls used to do the conversion is different and therefore the utility I made won't work on the M2EA (same as the old DJI Thermal Analysis Tool).

DJI has released a new v2 of their Thermal Analysis tool that is compatible with the M2EA. This tool seems to use different .dlls to do the conversion of the M2EA images. If I find the time I might try look into doing some reverse engineering on the v2 Thermal Analysis Tool to see if I can figure out the function calls and parameters that are made to this .dll to be able to convert the M2EA images. If anybody else on this forum has time or experience in reverse engineering I'd appreciate the help..

Thanks for the reply Jono. I'm sure I (or other members from here or other groups) would be more than willing to send you some photos if needed.  The work you're doing is incredible for this community.  I'd love to help, but that's unfortunately not my area of expertise.  I will be following.
4-27 11:33
Use props
iidancom
lvl.1

Offline

I am comparing the values I get from the tiff with what DJI therml analysis tools provide and there are significantly different
I can provide the samples
my mail is i@idan.com
Joe
7-18 10:34
Use props
djiuser_UDfpmmQJw2DY
lvl.1

France
Offline

Hello everyone,
I need to convert images acquired with my h20t camera but I can't...

I used different scripts but I always have the same result.
I also used the scripts of exiftool forum.

All time, I have a black image in output, would you have an idea to help me? Thanks!
7-23 03:43
Use props
djiuser_3D8kpKM33jRl
New

Oman
Offline

JonoMcG Posted at 4-26 00:28
For anyone converting H20T or XTS images and running into issues with my old script: DJI has released a Thermal SDK that makes these conversions fairly easy.. I'd suggest switching to using their official SDK to do conversions to the R-JPEG images for these cameras.

https://forum.dji.com/forum.php?mod=viewthread&tid=230321

Could you please share the link of dji sdk
7-23 03:50
Use props
djiuser_kMIg5993HklS
lvl.2
United States
Offline

djiuser_3D8kpKM33jRl Posted at 7-23 03:50
Could you please share the link of dji sdk

https://www.dji.com/downloads/softwares/dji-thermal-sdk
7-23 17:33
Use props
Bruno SDS
lvl.2

France
Offline

djiuser_hJNGGpRe8Isr Posted at 2-8 19:37
Hi Jono,

Thank you for creating this tool! I've just been testing it on my H20T images and have encountered a problem on my end. I ran the code (screenshot attached), and from the input image (screenshot attached) I have generated a blank image (screenshot attached). [view_image][view_image][view_image]

Salut, problème similaire pour moi, c'est à dire une belle image noire. C'est vraiment frustrant !
Je désespère de pouvoir utiliser les images en rjpeg de la H20T.
Si quelqu'un à une solution à proposer, j'en serai ravi .

Merci par avance à la communauté
7-25 11:20
Use props
Bruno SDS
lvl.2

France
Offline

djiuser_hJNGGpRe8Isr Posted at 2-8 19:37
Hi Jono,

Thank you for creating this tool! I've just been testing it on my H20T images and have encountered a problem on my end. I ran the code (screenshot attached), and from the input image (screenshot attached) I have generated a blank image (screenshot attached). [view_image][view_image][view_image]

Salut,

si tu obtiens cette image noire, c'est tout simplement un Tiff qui n'a pas de prévisualisation. Pour voir si ça fonctionne, ouvre ton fichier sous Qgis ou autre logicel de SIG en mode raster. Nornalement tu devrais obtenir une image en niveau de gris
7-31 23:33
Use props
GeoFlow
lvl.1

Germany
Offline

JonoMcG Posted at 4-26 00:28
For anyone converting H20T or XTS images and running into issues with my old script: DJI has released a Thermal SDK that makes these conversions fairly easy.. I'd suggest switching to using their official SDK to do conversions to the R-JPEG images for these cameras.

https://forum.dji.com/forum.php?mod=viewthread&tid=230321

Hi Jono, thanks for the information and your script. But the two things are not comparable. Your script is much better than Thermal SDK from DJI. With Thermal SDK you can't create TIFF files, can you? I always get only an export in RAW format. How do you process these RAW files? Can you simply convert them into a TIFF format? All my post-processing (python) is based on the availability of TIFF files.

8-6 04:39
Use props
djiuser_xKUQu5ufzV4i
lvl.1

United States
Offline

Any news on getting SDK to support Mavic 2 Enterprise Advanced?
10-26 04:36
Use props
hoss_
Second Officer
Flight distance : 47572 ft
United States
Offline

djiuser_xKUQu5ufzV4i Posted at 10-26 04:36
Any news on getting SDK to support Mavic 2 Enterprise Advanced?

Here is a link to the beta: https://drive.google.com/drive/f ... _b31p1J?usp=sharing
10-27 20:13
Use props
Guillaume89
lvl.3
Flight distance : 270476 ft
  • >>>
Martinique
Offline

JonoMcG Posted at 2020-12-3 09:21
Good day All,

I have created the following  Windows command line tool that I use to convert the DJI R-JPEG images to .tiff temperature images (similar to the FLIR tiff format). The temperatures within the converted tiff images are equal to the pixel value / 10. You can use these images within Agisoft or Pix4D to process radiometric thermal orthophotos.

Hi thanks a lot for sharing this tool.

However, when I run this command, the created tiff files does not contain any location information, do you a tip about it ?

Regards,
11-16 07:38
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules