Пример #1
0
    protected virtual void DoCreate()
    {
        if (started_)
        {
            return;
        }

        // Create Smart
#if UNITY_ANDROID || UNITY_IOS
        smart_ = new smartar.Smart(licenseFileName);
#elif UNITY_EDITOR || UNITY_STANDALONE_WIN
        smart_ = new smartar.Smart(licenseKeyString, (uint)licenseKeyString.Length);
#else
        smart_ = new smartar.Smart(null);
#endif
        smartInitFailed_ = smart_.isConstructorFailed();

        if (smartInitFailed_)
        {
            return;
        }

        // Create LandmarkDrawer
        landmarkDrawer_ = new smartar.LandmarkDrawer(smart_);

        // Create Recognizer
        recognizer_ = new smartar.Recognizer(smart_, recognizerSettings.recognitionMode, recognizerSettings.sceneMappingInitMode);
        ConfigRecognizer(recognizerSettings, true);

        // Create native instance
        if (smartar.Utility.isMultiCore() && recognizerSettings.useWorkerThread)
        {
            bool isTargetTracking = recognizerSettings.recognitionMode == smartar.RecognitionMode.RECOGNITION_MODE_TARGET_TRACKING;
            numWorkerThreads_ = isTargetTracking ? 2 : 1;
        }
        else
        {
            numWorkerThreads_ = 0;
        }

        // Init fields for LandmarkDrawer
        landmarkBuffer_  = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(smartar.Landmark)) * smartar.Recognizer.MAX_NUM_LANDMARKS);
        nodePointBuffer_ = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(smartar.NodePoint)) * smartar.Recognizer.MAX_NUM_NODE_POINTS);
        initPointBuffer_ = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(smartar.InitPoint)) * smartar.Recognizer.MAX_NUM_INITIALIZATION_POINTS);

        // Init fields for development
        recogCountBuf_ = new ulong[numWorkerThreads_];
        recogTimeBuf_  = new ulong[numWorkerThreads_];
    }
Пример #2
0
 public CameraImageDrawer(Smart smart)
 {
     self_ = sarSmartar_SarCameraImageDrawer_SarCameraImageDrawer(smart.self_);
 }
Пример #3
0
 public LandmarkDrawer(Smart smart)
 {
     self_ = sarSmartar_SarLandmarkDrawer_SarLandmarkDrawer(smart.self_);
 }
Пример #4
0
 public StillImageListener(string captureImagePath, smartar.Smart smart)
 {
     m_CaptureImagePath = captureImagePath;
     m_Smart            = smart;
 }
Пример #5
0
 public LearnedImageTarget(Smart smart, StreamIn stream, string customerID = null, string customerKey = null)
 {
     self_ = sarSmartar_SarLearnedImageTarget_SarLearnedImageTarget(smart.self_, stream.self_, customerID, customerKey);
 }
Пример #6
0
 public SceneMapTarget(Smart smart, StreamIn stream)
 {
     self_ = sarSmartar_SarSceneMapTarget_SarSceneMapTarget(smart.self_, stream.self_);
 }
Пример #7
0
 public FileStreamOut(Smart smart, string filePath)
 {
     self_ = sarSmartar_SarFileStreamOut_SarFileStreamOut(smart.self_, filePath);
 }
Пример #8
0
 public AssetStreamIn(Smart smart, string filePath)
 {
     self_ = sarSmartar_SarAssetStreamIn_SarAssetStreamIn(smart.self_, filePath);
 }
Пример #9
0
 public SarImage(Smart smart)
 {
     self_ = sarSmartar_SarImage_SarImage(smart.self_);
 }
Пример #10
0
 public SensorDevice(Smart smart)
     : this(smart, IntPtr.Zero)
 {
 }
Пример #11
0
 public ScreenDevice(Smart smart)
 {
     self_ = sarSmartar_SarScreenDevice_SarScreenDevice(smart.self_);
 }