SDKs.DjiImage.Net45 1.5.1

dotnet add package SDKs.DjiImage.Net45 --version 1.5.1
NuGet\Install-Package SDKs.DjiImage.Net45 -Version 1.5.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SDKs.DjiImage.Net45" Version="1.5.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SDKs.DjiImage.Net45 --version 1.5.1
#r "nuget: SDKs.DjiImage.Net45, 1.5.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SDKs.DjiImage.Net45 as a Cake Addin
#addin nuget:?package=SDKs.DjiImage.Net45&version=1.5.1

// Install SDKs.DjiImage.Net45 as a Cake Tool
#tool nuget:?package=SDKs.DjiImage.Net45&version=1.5.1
SDKs.DjiImage

https://github.com/Jazous/SDKs-DjiImage

1、Nuget 安装
PM> Install-Package SDKs.DjiImage.Net45
2、下载 DJI TSDK 添加到项目中

https://www.dji.com/cn/downloads/softwares/dji-thermal-sdk

dji_thermal_sdk_v1.5_20240507.zip

下载后解压,并将对应 tsdk-core\lib 目录下的 libv_list.ini*.dll*.so 文件拷贝到执行程序根目录下

3、使用例子
byte[] data = System.IO.File.ReadAllBytes("3_M3TD.JPG");

using (var rjpg = RJPEG.TryParse(data))
{
    if (rjpg != null)
    {
        //获取整张图片的最高温、最低温和平均温度
        Console.WriteLine($"rjpeg:MinTemp={rjpg.MinTemp} ,MaxTemp={rjpg.MaxTemp} ,AvgTemp={rjpg.AvgTemp}");

        //获取指定矩形范围内的最高温、最低温和平均温度
        var rect = rjpg.GetRect(100, 100, 200, 200);
        Console.WriteLine($"rect:MinTemp={rect.MinTemp} ,MaxTemp={rect.MaxTemp} ,AvgTemp={rect.AvgTemp}");

        //设置调色板风格
        rjpg.SetPseudoColor(PseudoColor.DIRP_PSEUDO_COLOR_HOTIRON);
        //设置亮度
        rjpg.SetBrightness(60);

        //保存设置后的伪彩色照片
        using (var fs = System.IO.File.OpenWrite("3_M3TD_HOTIRON.JPG"))
        {
            rjpg.SaveTo(fs);
            fs.Flush();
        }
    }
}

注:运行报错 System.BadImageFormatException 时,需要项目属性设置相应的目标平台, release_x64 目标平台选择 x64release_x86 目标平台选择 x86.NET FrameworkAnyCPU 默认是 x86

Product Compatible and additional computed target framework versions.
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5.2

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.1 56 6/24/2024
1.4.3 61 6/15/2024
1.4.2 209 4/11/2023
1.4.1 256 2/10/2023
1.4.0 269 1/30/2023
1.3.2 261 11/9/2022

1、添加设置调色板风格 SetPseudoColor 方法;2、添加设置亮度 SetBrightness 方法;3、添加 SaveTo 保存设置后的伪彩色照片;4、适配DJI TSDK 1.5版本的环境温度获取。