The official Microsoft.Kinect SDK v2 only works with .NET Framework (not .NET Core/.NET 8). To work around this, we've implemented a bridge architecture:
Kinect Hardware <--> KinectBridge (.NET Framework 4.8) <--> HueGraphics API (.NET 8)
HTTP/JSON
The KinectBridge is a lightweight .NET Framework console app that:
- Connects directly to Kinect v2 hardware using Microsoft.Kinect SDK
- Captures depth + color streams
- Maps them to 3D point clouds with colors
- Exposes data via HTTP API on port 5555
Your .NET 8 API communicates with the bridge via HTTP.
- Download from: https://www.microsoft.com/en-us/download/details.aspx?id=44561
- Install the Kinect for Windows SDK 2.0
- Restart your computer
- Connect Kinect v2 sensor to USB 3.0 port
- Connect power adapter
- Wait for Windows to recognize the device
cd src/kinect-bridge
dotnet buildThe bridge will be built to: src/kinect-bridge/bin/Debug/net48/KinectBridge.exe
You need to run 3 processes for full Kinect functionality:
cd src/kinect-bridge/bin/Debug/net48
./KinectBridge.exeYou should see:
======================================
Kinect v2 Bridge for .NET 8
======================================
[OK] HTTP server started on port 5555
Bridge running on http://localhost:5555
Endpoints:
GET http://localhost:5555/status
POST http://localhost:5555/initialize
POST http://localhost:5555/start
POST http://localhost:5555/stop
GET http://localhost:5555/frame
Press Ctrl+C to exit
cd src/backend/HueGraphics.API
dotnet runcd src/client
npm run dev- Start all 3 processes (bridge, API, frontend)
- Open http://localhost:3000 in your browser
- Navigate to "Kinect Live Capture" in the sidebar
- Click "Initialize Sensor"
- This tells the bridge to connect to Kinect hardware
- Check bridge console for initialization logs
- Click "Start Streaming"
- Point cloud data will stream in real-time
- Use mouse to rotate/zoom/pan
- Click "Stop Streaming" when done
Error: "No Kinect sensor found"
- Ensure Kinect is plugged into USB 3.0 port
- Check Device Manager for "Kinect" devices
- Reinstall Kinect SDK 2.0 Runtime
Error: "Port 5555 already in use"
- Kill existing process:
taskkill /F /IM KinectBridge.exe - Or run bridge on different port:
KinectBridge.exe 5556- Then update
KinectService.csline 30 to match
- Then update
Error in API logs: "Cannot connect to KinectBridge at http://localhost:5555"
- Ensure bridge is running (check Process 1 above)
- Check firewall isn't blocking localhost:5555
- Try manually:
curl http://localhost:5555/status
- Check bridge console for frame capture logs
- Verify "Start Streaming" was clicked
- Open browser DevTools (F12) -> Console tab for errors
- Check API logs for polling errors
- Bridge downsamples to every 2nd point by default
- Adjust in
Program.csline 357: changei += 2toi += 3ori += 4 - Reduce browser window size
- Close other applications
1. Kinect Hardware
↓ (USB 3.0)
2. KinectBridge (Port 5555)
- Captures depth stream (512x424)
- Captures color stream (1920x1080)
- Maps depth → 3D points
- Maps color → points
↓ (HTTP JSON)
3. HueGraphics API (Port 5000)
- Polls bridge every 33ms (~30 FPS)
- Caches latest frame
- Serves via SSE stream
↓ (Server-Sent Events)
4. React Frontend (Port 3000)
- Receives frame updates
- Renders with Three.js
- Interactive 3D visualization
Bridge (Port 5555):
POST /initialize- Initialize Kinect sensorPOST /start- Start capturing framesPOST /stop- Stop capturingGET /status- Get sensor status (FPS, frame count, etc.)GET /frame- Get latest point cloud frame
HueGraphics API (Port 5000):
POST /api/kinect/initialize- Proxy to bridgePOST /api/kinect/start- Proxy to bridge + start pollingPOST /api/kinect/stop- Proxy to bridge + stop pollingGET /api/kinect/status- Get cached statusGET /api/kinect/frame- Get cached frameGET /api/kinect/stream- SSE stream (not yet fully tested)
For convenience, create a batch file to start all 3 processes:
start-kinect-dev.bat:
@echo off
echo Starting Kinect Development Environment...
start "Kinect Bridge" cmd /k "cd src\kinect-bridge\bin\Debug\net48 && KinectBridge.exe"
timeout /t 2
start "Backend API" cmd /k "cd src\backend\HueGraphics.API && dotnet run"
timeout /t 3
start "Frontend SPA" cmd /k "cd src\client && npm run dev"
echo All processes started!
echo Close the terminal windows to stop.The current implementation uses polling for frame delivery:
- Frontend polls API every 33ms (~30 FPS)
- API polls bridge every 33ms
- Bridge captures from Kinect hardware continuously
- Total latency: ~66-100ms
This polling approach is simple, reliable, and works well for the bridge architecture.
- Test with physical Kinect device
- Optimize point cloud downsampling rate (configurable in bridge)
- Add configuration for bridge URL/port
- Add frame recording/playback features
- Consider WebSocket for lower latency (optional optimization)