"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

How To Access the Camera Image in Unity

 

I use the script attached in the following link. 

https://developer.vuforia.com/library/articles/Solution/How-To-Access-the-Camera-Image-in-Unity

This post seem very old. Many class , attribute doesn't exist now.

How to access the camera Image (without augmentation)?

 

I tried following : 

Texture2D texture2D = textureGameObject.GetComponent<Renderer>().material.mainTexture as Texture2D ; 

(textureGameObject is the  BackgroundPlane gameObject, the grandson of ARCamera prefab in Vuforia.)

 

I can get this texture easily in Mac OSX , But this get nothing on IOS 9.1.

What is the right way to access the camera Image (without augmentation)?

 

Thanks!!

 

 

craziestdavid

Mon, 11/23/2015 - 18:31


I modify the script for Vuforia 5 , then it works.

using UnityEngine;
using System.Collections;
using Vuforia ;  // have to use this 
public class CameraImageAccess : MonoBehaviour
{

	private Image.PIXEL_FORMAT m_PixelFormat = Image.PI

AlessandroB

Thu, 11/26/2015 - 14:21

The following script is a variation of the code snippet found in the original article, but using the latest Vuforia SDK 5.0 API:

Also, note that you may want to try different Frame Formats, e.g. one of RGB888 or RGB565:

I don't know whether it's late or not, but I got it working with this version of your script using vuforia 7. I used RGBA8888 as PIXEL_FORMAT (line 9) and I stored the pixel results (line 74, pixels[0], pixels[1], pixels[2]) in a Color32 variable .

rafaelsistrade

Fri, 02/23/2018 - 14:43

Hello, bugaboostudio.

How do you have done this part: I stored the pixel results (line 74, pixels[0], pixels[1], pixels[2]) in a Color32 variable?

I used this exemple: http://www.imgportal.net/imgresources/?page_id=287

But i keep getting this error: