0

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

4

1 回答 1

0

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

 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();
于 2017-03-10T19:59:04.483 回答