0

我使用OpenCVfor 在新窗口中显示立体相机的左右图像。现在我想在 Oculus Rift 上看到同样的东西,但是当我连接 Oculus 时,图像并没有变得Characteristic Circled image合适lens inside the Oculus......我需要自己处理图像吗?不是自动的吗?

这是显示窗口的代码:

            cap >> frame; //cap= camera 1 & cap2=camera 2
            cap.read(frame);
            sz1 = frame.size();

            //second camera
            cap2 >> frame2;
            cap2.read(frame2);

            sz2 = frame2.size();

             cv::Mat bothFrames(sz2.height, sz2.width + sz1.width, CV_8UC3);

           // Move right boundary to the left.                
           bothFrames.adjustROI(0, 0, 0, -sz1.width);                 
           frame2.copyTo(bothFrames);

           // Move the left boundary to the right, right boundary to the right.             
           bothFrames.adjustROI(0, 0, -sz2.width, sz1.width);               
           frame.copyTo(bothFrames);

           // restore original ROI.             
           bothFrames.adjustROI(0, 0, sz2.width, 0);

           cv::imencode(".jpg", bothFrames, buf, params);

我还有一个问题。我正在尝试将 OVR 库添加到我的代码中,但出现错误“系统模糊符号”,因为 OVR 库中的某些类使用了相同的命名空间...当我添加

#include "OVR.h"
using namespace OVR;

-.-”

4

1 回答 1

1

该 SDK 旨在执行镜头畸变校正、色差校正(不同颜色光的不同折射率会导致未经校正的图像中出现色边)、时间扭曲以及将来可能进行的其他校正。除非您有手动优化的重量级图形管道,否则最好使用 SDK 渲染选项。

您可以在此处了解 SDK 和不同类型的更正:

http://static.oculusvr.com/sdk-downloads/documents/Oculus_SDK_Overview.pdf

它还解释了如何应用失真校正。SDK 是开源的,因此您也可以阅读源代码以获得更透彻的理解。

要解决您的命名空间问题,请不要切换到 OVR 命名空间!每次你从 OVR 命名空间中引用某些东西时,在它前面加上 OVR:: - 例如,OVR::Math - 毕竟,这就是命名空间的全部意义:p

于 2014-07-03T20:17:22.887 回答