feat(tracker-native): native Windows app - MF camera + Win32 GUI + shm publish
win_camera: Media Foundation device + native-resolution enumeration and RGB32 capture. win_main: plain Win32 GUI (device/resolution dropdowns, Start/Stop, StretchDIBits live preview with mask+landmark overlay) + CreateFileMappingW on kinect_virtual_frames + a worker thread wiring capture -> PoseEstimator (bootstrap+track) -> FramePipeline -> publish. build_win.sh cross-compiles a static kinect-tracker.exe with MinGW-w64 x64 (ORT header needs -D_stdcall=__stdcall; x64 ignores the calling convention so the win ORT DLL ABI matches). PoseEstimator path made ORTCHAR_T/wchar-portable; M_PI -> local const. Builds clean; exe is PE32+ GUI x86-64.
This commit is contained in:
1 parent
41534b07d1
commit
31178f1675
6 files changed
+643
-6
No files matched your search
@@ -5,10 +5,14 @@
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
namespace kinect_tracker {
|
||||
namespace {
|
||||
|
||||
constexpr float kPi = 3.14159265358979323846f;
|
||||
|
||||
float Sigmoid(float v) { return 1.0f / (1.0f + std::exp(-v)); }
|
||||
|
||||
struct Affine2x3 {
|
||||
@@ -49,7 +53,13 @@ PoseEstimator::PoseEstimator(const char* landmark_model_path) {
|
||||
Ort::SessionOptions so;
|
||||
so.SetIntraOpNumThreads(1);
|
||||
so.SetGraphOptimizationLevel(ORT_ENABLE_ALL);
|
||||
#ifdef _WIN32
|
||||
const std::string p(landmark_model_path);
|
||||
const std::wstring wp(p.begin(), p.end());
|
||||
session_ = std::make_unique<Ort::Session>(*env_, wp.c_str(), so);
|
||||
#else
|
||||
session_ = std::make_unique<Ort::Session>(*env_, landmark_model_path, so);
|
||||
#endif
|
||||
input_.resize(static_cast<size_t>(kLandmarkInput) * kLandmarkInput * 3);
|
||||
}
|
||||
|
||||
@@ -71,7 +81,7 @@ Roi PoseEstimator::roi_from_points(float cx, float cy, float ex, float ey) {
|
||||
r.cx = cx;
|
||||
r.cy = cy;
|
||||
r.size = 2.0f * std::hypot(dx, dy) * 1.25f;
|
||||
r.angle = static_cast<float>(M_PI) * 0.5f - std::atan2(-dy, dx);
|
||||
r.angle = kPi * 0.5f - std::atan2(-dy, dx);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user