If a webcam can't deliver RGB32 at the exact chosen native resolution,
SetCurrentMediaType failed and the camera wouldn't open at all. Now it retries
RGB32 without forcing the frame size (MF picks a supported size + converts) and
adopts whatever is negotiated (read back from GetCurrentMediaType), so the app
degrades gracefully instead of hard-failing.
Media Foundation commonly delivers RGB32 bottom-up (negative MF_MT_DEFAULT_STRIDE);
a flat top-down memcpy would make the preview and published feed upside-down.
read_frame now copies row by row honoring the signed stride (flip when negative,
handle padded strides), producing a top-down BGRA frame per the MS Image Stride
spec. Orientation is logged at open.
The pose_detector.tflite is float16-quantized, which tf2onnx 1.16.1/1.17/git-main
all fail to convert (misreads float16 constants -> 'reshape 96 into (16,1,1,24)').
Rather than block on that upstream tool bug for an acquisition-only model,
PoseEstimator::acquire() runs the landmark model over a few candidate ROIs
(scales x vertical positions) and keeps the best presence. Headless on
grace_hopper it reaches 0.730 presence - matching the detector's 0.731 - so
acquisition quality is recovered. Worker now acquire()s until locked, then
single-run tracks via the aux-landmark ROI.
Worker thread creates and drives the Media Foundation source reader, so it must
be COM-initialized (CoInitializeEx MTA) - without it ReadSample can fail; fixes
a likely first-run camera failure. Adds CMakeLists.txt for an MSVC/Visual Studio
build (objective wants MSVC-compatible), auto-copying onnxruntime.dll + the model
next to the exe.
Adds a ShimLog-style trace log next to the exe (startup, camera enumeration,
negotiated capture format + MF_MT_DEFAULT_STRIDE, per-N-frame presence/tracked,
shm CreateFileMapping result, errors) so the first real-hardware run is
diagnosable instead of blind - mirrors how kinect_shim.log drove the shim fixes.
Logs the camera stride so a top-down/bottom-up RGB32 image-flip is immediately
visible.
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.
FramePipeline ties PoseEstimator to the existing C++ core: 33 landmarks ->
core/mapping SkeletonMapper (20 Kinect joints), the image-space segmentation
mask + skeleton -> core/synth DepthRasterizer (articulated packed depth), color
-> passthrough_color, all published via ShmPublisher. PoseEstimator now also
emits world-landmark z (Identity_4) and an image-space mask (inverse-affine
warp). pipeline_probe on grace_hopper: tracking_id=1, 9/20 joints tracked, 56%
body depth pixels, hip at (0,-1.05,2.5)m - the whole tracker brain verified
without a camera. Remaining: Media Foundation capture + Dear ImGui GUI.
Ports blazepose_ref.py to a reusable C++ PoseEstimator: hand-written bilinear
affine ROI warp (no OpenCV dep), ORT landmark inference, landmark/mask decode +
inverse-affine to image space, and next-frame ROI from the aux landmarks for
tracking. Validated headless vs the numpy reference (pose_probe vs dump_ref):
presence matches to 1e-6, visible torso landmarks within ~1-2px, mask logit
within 0.03; only low-confidence off-frame hand/aux landmarks differ.
ShmPublisher mirrors the Python FrameContractPublisher seqlock (write slot
ahead, odd->even sequence, bump published_sequence) over a base pointer, reusing
core/contract structs directly (Windows MapViewOfFile on the app; a heap buffer
in the test). Round-trip test proves the layout+seqlock the shim reader accepts:
frame number, timestamp, skeleton, descriptors, depth+color pixels all verify.
Full pose_detection_cpu + pose_landmark_by_roi reproduced in numpy on the real
TFLite weights (MediaPipe Tasks can't load here - needs libGLESv2). Validated
geometrically on grace_hopper: detection prob 0.74, face/shoulder landmarks land
correctly on the person even with hips off-frame. This is the 1:1 spec for the
C++ port.
Scaffold the zero-Python native tracker. Convert the real MediaPipe BlazePose
landmark weights (from pose_landmarker_full.task) to ONNX and prove the ONNX
Runtime C++ API runs them bit-identically to Python (ort_smoke vs
ort_smoke_ref.py; landmarks match to 6dp, mask <=1.2% prob vs TFLite).
Reproducible setup scripts (setup_models.sh, fetch_ort.sh) and a Linux build.
No binaries committed (ORT + onnx/tflite are fetched/generated).
Single native kinect-tracker.exe: Media Foundation camera enum/capture,
Dear ImGui (Win32+D3D11) device/resolution picker + live preview, pose +
segmentation via ONNX Runtime using the real MediaPipe BlazePose weights
converted from the .task TFLite bundle, native shm writer reusing the
existing C++ core (contract/mapping/synth). No Python, no committed binaries.