【问题标题】:How to get the WebcamTexture of the camera in Kudan AR (Unity3D)如何在 Kudan AR (Unity3D) 中获取摄像头的 WebcamTexture
【发布时间】:2017-03-10 01:41:36
【问题描述】:

我目前正在开发一个 AR 应用程序,我需要从相机中获取对象的颜色。我需要获取相机的网络摄像头纹理,但我不知道怎么做,因为 Kudan AR 有它自己的相机。你知道怎么做吗?非常感谢!

【问题讨论】:

    标签: unity3d colors augmented-reality kudan


    【解决方案1】:

    您需要创建一个网络摄像头纹理并播放它,然后您可以创建一个 texture2D 并获取网络摄像头纹理的像素以获取您的颜色。

     WebCamTexture cam;
    
    // Open the Camera on the desired device / pc cam 
        cam = new WebCamTexture();
        cam.Play();
       currentTexture =new Texture2D(cam.width, cam.height, TextureFormat.RGB24, false);
    

    要获取网络摄像头像素,您可以执行类似的操作

           cam.GetPixels();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-11
      • 2017-03-15
      • 2021-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多