2012-12-09 47 views
0

我正在開發一個Kinect應用程序。我有兩個線程,一個用於讀取關節的值(包含20個關節的x,y,z座標),另一個用於讀取深度值(每幀76800個短值)。我從按下開始按鈕開始記錄這些值,直到按下結束按鈕。我期望寫出相同數量的關節和深度的框架,但我總是以很多關節框架結束。我捕獲了150深度幀,但捕獲了180幀,我認爲這是因爲深度寫入緩衝區的數據量。關節每幀只寫60個花車,但深度爲76800短褲。如何同步線程以捕獲相同數量的幀?

我如何從每個捕獲等量的幀?

112/11/9 4:19:58: SKELETON 

112/11/9 4:19:58: DEPTH 

112/11/9 4:19:58: SKELETON 

112/11/9 4:19:58: SKELETON 

112/11/9 4:19:58: DEPTH 

112/11/9 4:19:58: SKELETON 

112/11/9 4:19:59: DEPTH 

112/11/9 4:19:59: DEPTH 

112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: DEPTH 

112/11/9 4:19:59: DEPTH 

112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: DEPTH 

112/11/9 4:19:59: SKELETON 


112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: SKELETON 


112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: DEPTH 

112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: DEPTH 

112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: DEPTH 


112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: DEPTH 

112/11/9 4:19:59: DEPTH 

112/11/9 4:19:59: SKELETON 

112/11/9 4:19:59: SKELETON 


112/11/9 4:19:59: DEPTH 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: DEPTH 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: DEPTH 

112/11/9 4:20:0: DEPTH 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: DEPTH 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: DEPTH 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: DEPTH 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: DEPTH 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: DEPTH 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: DEPTH 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:0: SKELETON 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:1: DEPTH 

112/11/9 4:20:1: SKELETON 

112/11/9 4:20:2: DEPTH 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: DEPTH 

112/11/9 4:20:2: DEPTH 

112/11/9 4:20:2: DEPTH 

112/11/9 4:20:2: DEPTH 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: DEPTH 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: DEPTH 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: DEPTH 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: SKELETON 

112/11/9 4:20:2: DEPTH 

112/11/9 4:20:3: DEPTH 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: DEPTH 

112/11/9 4:20:3: DEPTH 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: DEPTH 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: DEPTH 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: SKELETON 


112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: DEPTH 

112/11/9 4:20:3: DEPTH 


112/11/9 4:20:3: DEPTH 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: DEPTH 

112/11/9 4:20:3: SKELETON 

112/11/9 4:20:3: DEPTH 

112/11/9 4:20:4: SKELETON 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: SKELETON 

112/11/9 4:20:4: SKELETON 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: SKELETON 

112/11/9 4:20:4: SKELETON 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: SKELETON 

112/11/9 4:20:4: SKELETON 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: DEPTH 

112/11/9 4:20:4: SKELETON 

112/11/9 4:20:4: SKELETON 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: DEPTH 


112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: DEPTH 


112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: SKELETON 


112/11/9 4:20:5: SKELETON 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:5: DEPTH 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: DEPTH 

112/11/9 4:20:6: DEPTH 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: DEPTH 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: SKELETON 


112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: DEPTH 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: DEPTH 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: DEPTH 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: SKELETON 

112/11/9 4:20:6: DEPTH 

112/11/9 4:20:6: DEPTH 
N 
112/11/9 4:20:7: SKELETON 

112/11/9 4:20:7: DEPTH 

112/11/9 4:20:7: DEPTH 

112/11/9 4:20:7: SKELETON 

112/11/9 4:20:7: SKELETON 

112/11/9 4:20:7: DEPTH 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: SKELETON 

112/11/9 4:20:8: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: DEPTH 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:9: SKELETON 

112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: SKELETON 


112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:10: DEPTH 

112/11/9 4:20:10: SKELETON 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: DEPTH 

112/11/9 4:20:11: SKELETON 

112/11/9 4:20:11: DEPTH 
N 
112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: SKELETON 

112/11/9 4:20:12: DEPTH 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: DEPTH 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:13: SKELETON 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: SKELETON 

112/11/9 4:20:14: DEPTH 

112/11/9 4:20:15: SKELETON 

112/11/9 4:20:15: DEPTH 

112/11/9 4:20:15: SKELETON 

112/11/9 4:20:15: DEPTH 

112/11/9 4:20:15: SKELETON 

112/11/9 4:20:15: DEPTH 

112/11/9 4:20:15: DEPTH 

112/11/9 4:20:15: SKELETON 

112/11/9 4:20:15: SKELETON 

112/11/9 4:20:15: DEPTH 
+0

您使用哪些事件來捕獲數據? 「AllFramesReady」與單個事件可能會幫助您同步數字。還可以看看CodePlex上的「Kinect Toolbox」項目;它提供了一個錄音機。 –

+0

謝謝,但我正在開發C++和AllFramesReady不可用作爲C++中的事件 – user667222

回答

0

具有由鎖和條件變量保護的共享表:

此日誌還示出了不相等叫每個線程的數目 (用25至30 FPS超高動力學捕獲深度和座標)保持已捕獲的每種類型的幀數。如果其中一個線程發現它已經捕獲了比另一個更多的幀,就讓它阻塞在條件變量上。當任何線程完成獲取幀時,它會增加其類型的計數並廣播條件變量。