質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

C++

C++はC言語をもとにしてつくられた最もよく使われるマルチパラダイムプログラミング言語の1つです。オブジェクト指向、ジェネリック、命令型など広く対応しており、多目的に使用されています。

Kinect

Kinect(キネクト)はマイクロソフトから発売されたジェスチャー・音声認識によって 操作ができるデバイスです。

Azure

Azureは、マイクロソフトのクラウド プラットフォームで、旧称は Windows Azureです。PaaSとIaaSを組み合わせることで、 コンピューティング・ストレージ・データ・ネットワーキング・アプリケーションなど多くの機能を持ちます。

Q&A

解決済

1回答

1914閲覧

Microsoft.Azure.Kinect.BodyTrackingのサンプルコードがVisualStudioでビルドできません。

ken4

総合スコア1

Visual Studio

Microsoft Visual StudioはMicrosoftによる統合開発環境(IDE)です。多種多様なプログラミング言語に対応しています。

C++

C++はC言語をもとにしてつくられた最もよく使われるマルチパラダイムプログラミング言語の1つです。オブジェクト指向、ジェネリック、命令型など広く対応しており、多目的に使用されています。

Kinect

Kinect(キネクト)はマイクロソフトから発売されたジェスチャー・音声認識によって 操作ができるデバイスです。

Azure

Azureは、マイクロソフトのクラウド プラットフォームで、旧称は Windows Azureです。PaaSとIaaSを組み合わせることで、 コンピューティング・ストレージ・データ・ネットワーキング・アプリケーションなど多くの機能を持ちます。

0グッド

0クリップ

投稿2021/10/13 18:10

前提・実現したいこと

ここに質問の内容を詳しく書いてください。
Azure Kinect DKのBodyTrackingのサンプルコードをVisual Sudio2019にコピー
して、ソリューションエクスプローラーからNugetパッケージの管理を開きMicrosoft.Azure.Kinect.BodyTrackingをインストールして、ソリューションのビルドを行いましたが以下のエラーメッセージが出てしまいます。

発生している問題・エラーメッセージ

エラーメッセージ
LNK2019 未解決の外部シンボル _k4abt_tracker_create が関数 _main で参照されました BodyTracking1 1行

該当のソースコード

ソースコード #include <stdio.h> #include <stdlib.h> #include <k4a/k4a.h> #include <k4abt.h> #define VERIFY(result, error) \ if(result != K4A_RESULT_SUCCEEDED) \ { \ printf("%s \n - (File: %s, Function: %s, Line: %d)\n", error, __FILE__, __FUNCTION__, __LINE__); \ exit(1); \ } \ int main() { k4a_device_t device = NULL; VERIFY(k4a_device_open(0, &device), "Open K4A Device failed!"); // Start camera. Make sure depth camera is enabled. k4a_device_configuration_t deviceConfig = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL; deviceConfig.depth_mode = K4A_DEPTH_MODE_NFOV_UNBINNED; deviceConfig.color_resolution = K4A_COLOR_RESOLUTION_OFF; VERIFY(k4a_device_start_cameras(device, &deviceConfig), "Start K4A cameras failed!"); k4a_calibration_t sensor_calibration; VERIFY(k4a_device_get_calibration(device, deviceConfig.depth_mode, deviceConfig.color_resolution, &sensor_calibration), "Get depth camera calibration failed!"); k4abt_tracker_t tracker = NULL; k4abt_tracker_configuration_t tracker_config = K4ABT_TRACKER_CONFIG_DEFAULT; VERIFY(k4abt_tracker_create(&sensor_calibration, tracker_config, &tracker), "Body tracker initialization failed!"); int frame_count = 0; do { k4a_capture_t sensor_capture; k4a_wait_result_t get_capture_result = k4a_device_get_capture(device, &sensor_capture, K4A_WAIT_INFINITE); if (get_capture_result == K4A_WAIT_RESULT_SUCCEEDED) { frame_count++; k4a_wait_result_t queue_capture_result = k4abt_tracker_enqueue_capture(tracker, sensor_capture, K4A_WAIT_INFINITE); k4a_capture_release(sensor_capture); // Remember to release the sensor capture once you finish using it if (queue_capture_result == K4A_WAIT_RESULT_TIMEOUT) { // It should never hit timeout when K4A_WAIT_INFINITE is set. printf("Error! Add capture to tracker process queue timeout!\n"); break; } else if (queue_capture_result == K4A_WAIT_RESULT_FAILED) { printf("Error! Add capture to tracker process queue failed!\n"); break; } k4abt_frame_t body_frame = NULL; k4a_wait_result_t pop_frame_result = k4abt_tracker_pop_result(tracker, &body_frame, K4A_WAIT_INFINITE); if (pop_frame_result == K4A_WAIT_RESULT_SUCCEEDED) { // Successfully popped the body tracking result. Start your processing size_t num_bodies = k4abt_frame_get_num_bodies(body_frame); printf("%zu bodies are detected!\n", num_bodies); k4abt_frame_release(body_frame); // Remember to release the body frame once you finish using it } else if (pop_frame_result == K4A_WAIT_RESULT_TIMEOUT) { // It should never hit timeout when K4A_WAIT_INFINITE is set. printf("Error! Pop body frame result timeout!\n"); break; } else { printf("Pop body frame result failed!\n"); break; } } else if (get_capture_result == K4A_WAIT_RESULT_TIMEOUT) { // It should never hit time out when K4A_WAIT_INFINITE is set. printf("Error! Get depth frame time out!\n"); break; } else { printf("Get depth capture returned error: %d\n", get_capture_result); break; } } while (frame_count < 100); printf("Finished body tracking processing!\n"); k4abt_tracker_shutdown(tracker); k4abt_tracker_destroy(tracker); k4a_device_stop_cameras(device); k4a_device_close(device); return 0; } ### 試したこと ここに問題に対して試したことを記載してください。 1 「VisualStudioで外部ライブラリを読み込めるようにする方法」を参考に 実施しましたが改善が得られませんでした。 ### 補足情報(FW/ツールのバージョンなど) ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

試されているのは、こちらのサンプルでしょうか?

■ クイック スタート: 体をトラッキングする Azure Kinect アプリケーションの作成 | Microsoft Docs
https://docs.microsoft.com/ja-jp/azure/Kinect-dk/build-first-body-app

おそらく、32bit 版のライブラリが提供されていない為ではないでしょうか?
ビルド構成を Debug x86Debug x64 に変えて試して下さい。

変更前)ビルド構成:Debug x86
Debug x86

変更後)ビルド構成:Debug x64
Debug x64

<参考>
■ Using Body Tracking functions won't compile
https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1018

投稿2021/10/13 20:11

cx20

総合スコア4633

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ken4

2021/10/14 09:52

エラーが消えました。ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問