Ejemplo n.º 1
0
 /// <summary>
 /// Finds the first available ZEDToOpenCVRetriever in the scene, or creates a new one (Singleton).
 /// Note that it's better to have the component in the Scene ahead of time, especially if using multiple ZED cameras.
 /// </summary>
 /// <returns></returns>
 public static ZEDToOpenCVRetriever GetInstance()
 {
     if (!_instance)
     {
         GameObject go = new GameObject("ZED to OpenCV Retriever");
         _instance = go.AddComponent <ZEDToOpenCVRetriever>();
     }
     return(_instance);
 }
Ejemplo n.º 2
0
 void Start()
 {
     //We'll listen for updates from a ZEDToOpenCVRetriever, which will call an event whenever it has a new image from the ZED.
     if (!imageRetriever)
     {
         imageRetriever = ZEDToOpenCVRetriever.GetInstance();
     }
     imageRetriever.OnImageUpdated_LeftGrayscale += ImageUpdated;
 }
Ejemplo n.º 3
0
 private void Awake()
 {
     _instance = this; //Singleton implementation.
 }