Hello guys, Im trying to build a small Image identification Project following this guy's steps. He's using a script where he calls from a method that return a cropped texture from the active camera (which in this case is not AR) and returns it in a 32 bits color format, and classifies the texture everytime the pixels are updated.
This is the part of the code that I want to do but with AR Camera:
public class CameraImage : MonoBehaviour {
WebCamTexture webcamTexture;
RawImage image;
void Start() {
//delay initialize camera
webcamTexture = new WebCamTexture();
image = GetComponent<RawImage>();
image.texture = webcamTexture;
webcamTexture.Play();
}
public Color32[] ProcessImage(){
//crop
var cropped = TextureTools.CropTexture(webcamTexture);
//scale
var scaled = TextureTools.scaled(cropped, 112, 112, FilterMode.Bilinear);
//run detection
return scaled.GetPixels32();
}
}
Someone then said to try the "CopyToTexture" method from Image but its not working... I am sorry if this question is quite basic but I'm still not very familiar with the whole Vuforia structure and capabilities.
Thank you so much for helping me out, If you find any helpful tutorial guide for this kind of things, pleave leave it in here as I'd love to know more about it!
(PS: Is there a way to put the code above in a more proper format in this forum? Tried using the general code tag but didnt work)
Take a look here: https://library.vuforia.com/content/vuforia-library/en/articles/Solution/Working-with-the-Camera.html#How-To-Access-the-Camera-Image-in-Unity