Exemple #1
0
        internal static bool TrackNextFrame(int frameId, uint[] pixels, List <NativeTrackedObject> managedTrackedObjects)
        {
            int rv = TrackerNextFrame(frameId, pixels);

            for (int i = 0; i < s_NumTrackedObjects; i++)
            {
                var trackingInfo = new NativeTrackedObjectInfo();
                var psfInfo      = new NativePsfFitInfo();
                var residuals    = new double[35 * 35];

                TrackerGetTargetState(i, trackingInfo, psfInfo, residuals);

                managedTrackedObjects[i].LoadFromNativeData(trackingInfo, psfInfo, residuals);
            }

            return(rv == 0);
        }
        internal void LoadFromNativeData(NativeTrackedObjectInfo trackingInfo, NativePsfFitInfo psfInfo, double[] residuals)
        {
            Center = new ImagePixel(trackingInfo.CenterX, trackingInfo.CenterY);
            LastKnownGoodPosition = new ImagePixel(trackingInfo.LastGoodPositionX, trackingInfo.LastGoodPositionY);
            LastKnownGoodPsfCertainty = trackingInfo.LastGoodPsfCertainty;
            IsLocated = trackingInfo.IsLocated == 1;
            IsOffScreen = trackingInfo.IsOffScreen == 1;
            m_TrackingFlags = TranslateTrackingFlags((NativeTrackerNotMeasuredReasons)trackingInfo.TrackingFlags);

            m_NativePsfFit.LoadFromNativePsfFitInfo(psfInfo, residuals);
        }
Exemple #3
0
 // DLL_PUBLIC long TrackerGetTargetState(long objectId, NativeTrackedObjectInfo* trackingInfo, NativePsfFitInfo* psfInfo, double* residuals);
 private static extern int TrackerGetTargetState(int objectId, [In, Out] NativeTrackedObjectInfo trackingInfo, [In, Out] NativePsfFitInfo psfInfo, [In, Out] double[] residuals);
Exemple #4
0
        internal static bool TrackNextFrame(int frameId, uint[] pixels, List<NativeTrackedObject> managedTrackedObjects)
        {
            int rv = TrackerNextFrame(frameId, pixels);

            for (int i = 0; i < s_NumTrackedObjects; i++)
            {
                var trackingInfo = new NativeTrackedObjectInfo();
                var psfInfo = new NativePsfFitInfo();
                var residuals = new double[35 * 35];

                TrackerGetTargetState(i, trackingInfo, psfInfo, residuals);

                managedTrackedObjects[i].LoadFromNativeData(trackingInfo, psfInfo, residuals);
            }

            return rv == 0;
        }