예제 #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);
        }
예제 #2
0
        public void LoadFromNativePsfFitInfo(NativePsfFitInfo psfInfo, double[] residuals)
        {
            XCenter    = psfInfo.XCenter;
            YCenter    = psfInfo.YCenter;
            FWHM       = psfInfo.FWHM;
            IMax       = psfInfo.IMax;
            I0         = psfInfo.I0;
            X0         = psfInfo.X0;
            Y0         = psfInfo.Y0;
            MatrixSize = psfInfo.MatrixSize;
            IsSolved   = psfInfo.IsSolved == 1;

            m_R0           = psfInfo.R0;
            m_R02          = psfInfo.R02;
            m_IsAsymmetric = psfInfo.IsAsymmetric == 1;

            m_IBackground = psfInfo.I0;
            m_IStarMax    = psfInfo.IMax - psfInfo.I0;

            m_Residuals = residuals;
        }
예제 #3
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);
        }
예제 #4
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);
예제 #5
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;
        }
예제 #6
0
        public void LoadFromNativePsfFitInfo(NativePsfFitInfo psfInfo, double[] residuals)
        {
            XCenter = psfInfo.XCenter;
            YCenter = psfInfo.YCenter;
            FWHM = psfInfo.FWHM;
            IMax = psfInfo.IMax;
            I0 = psfInfo.I0;
            X0 = psfInfo.X0;
            Y0 = psfInfo.Y0;
            MatrixSize = psfInfo.MatrixSize;
            IsSolved = psfInfo.IsSolved == 1;

            m_R0 = psfInfo.R0;
            m_R02 = psfInfo.R02;
            m_IsAsymmetric = psfInfo.IsAsymmetric == 1;

            m_IBackground = psfInfo.I0;
            m_IStarMax = psfInfo.IMax - psfInfo.I0;

            m_Residuals = residuals;
        }