我正在使用另一個人使用OpenNI錄製器模塊錄製的一些數據。不幸的是,他們在錄製過程中意外設置了鏡像功能,所以我遇到了一些問題:1.使用MirrorCap鏡像深度,2.使用AlternateViewPointCap將深度與rgb對齊。我嘗試從我的深度節點訪問這些功能,如下所示:可以更改播放的AlternateViewPointCap或MirrorCap
xn::Context ni_context;
xn::Player player;
xn::DepthGenerator g_depth;
xn::ImageGenerator g_image;
ni_context.Init();
ni_context.OpenFileRecording(oni_filename, player);
ni_context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_depth);
ni_context.FindExistingNode(XN_NODE_TYPE_IMAGE, g_image);
g_depth.GetMirrorCap().SetMirror(false);
g_depth.GetAlternativeViewPointCap().SetViewPoint(g_image);
但是,這並不奏效。即使將鏡像設置爲false,g_depth上的IsMirrored()命令仍然返回true,而alternateviewpointcap不會更改從生成器接收的深度貼圖。
我也試圖這樣做通過模擬節點:
xn::MockDepthGenerator m_depth;
m_depth.CreateBasedOn(g_depth);
m_depth.GetMirrorCap().SetMirror(false);
m_depth.GetAlternativeViewPointCap().SetViewPoint(g_image);
xn::DepthMetaData temp;
g_depth.GetMetaData(temp);
m_depth.SetMetaData(temp);
這也不會影響深度圖我從m_depth得到。我很感激任何和所有的建議,如何使我的顏色和深度信息對齊,不管如何哈克。這些數據很難記錄,我需要以某種方式使用它。
我目前的解決方案是創建模擬深度節點並使用我自己的例程翻轉所有像素,然後使用SetMetaData函數進行設置。然後,我使用OpenCV創建從RGB圖像到深度圖像的透視變換,方法是讓用戶單擊4個點。然後,我將這個變換應用到rgb框架,以使值排列起來。這不是完美的,但它的工作原理 - 但是,爲了其他人可能需要使用這些數據,我想作出更適當的修復。