iT邦幫忙

1

如何使用C#語言,讀取GIF圖中的某個物品的座標軸

  • 分享至 

  • xImage

GIF圖內是全身人像,要讀取人像的關節座標

mobone iT邦新手 5 級 ‧ 2023-06-01 12:16:35 檢舉
可以參考看看OpenPose
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
JamesDoge
iT邦高手 1 級 ‧ 2023-06-01 20:09:19
using System;
using System.Runtime.InteropServices;

public class Program
{
    [DllImport("openpose.dll", CallingConvention = CallingConvention.Cdecl)]
    public static extern IntPtr opWrapper_create(int threadNumber, uint poseMode);

    [DllImport("openpose.dll", CallingConvention = CallingConvention.Cdecl)]
    public static extern void opWrapper_dispose(IntPtr wrapperPtr);

    [DllImport("openpose.dll", CallingConvention = CallingConvention.Cdecl)]
    public static extern void opWrapper_configure(IntPtr wrapperPtr, IntPtr opWrapperStruct);

    [DllImport("openpose.dll", CallingConvention = CallingConvention.Cdecl)]
    public static extern void opWrapper_start(IntPtr wrapperPtr);

    [DllImport("openpose.dll", CallingConvention = CallingConvention.Cdecl)]
    public static extern void opWrapper_stop(IntPtr wrapperPtr);

    public static void Main()
    {
        // 創建OpenPose包裝器
        IntPtr wrapperPtr = opWrapper_create(1, 0);

        // 配置OpenPose參數
        // 這裡你需要根據OpenPose的文檔設置相應的參數
        // IntPtr configPtr = ...; // 這裡是你的配置數據的指針
        // opWrapper_configure(wrapperPtr, configPtr);

        // 啟動OpenPose處理
        opWrapper_start(wrapperPtr);

        // 處理GIF圖中的每一

幀
        // 在這裡你需要使用OpenPose的相關函數進行圖像處理和人體關節座標提取
        // ...

        // 停止OpenPose處理
        opWrapper_stop(wrapperPtr);

        // 釋放OpenPose包裝器
        opWrapper_dispose(wrapperPtr);
    }
}

我要發表回答

立即登入回答