Ejemplo n.º 1
0
    /// <summary>
    /// ProcessFrame is the highest level function loop that call the rest of the tracking
    /// </summary>
    private void ProcessFrame()
    {
        timer.Start();                                           // Start a timer to measure fps
        bool success = frame.UpdateFrame(tracker.trackingState); //process frame

        timer.Stop();

        if (processedFrameNo % 100 == 0 && timer.ElapsedMilliseconds != 0)
        {
            Debug.Log(string.Format("ProcessFrame: {0}", timer.ElapsedMilliseconds));
        }
        timer.Reset();
        if (!success)
        {
            //Debug.Log( "Update frame failed" ); // TODO Michael printing
        }
        if (needStarTracker && success)
        {
            tracker.TrackObjects(frame, true);   // TODO may want to use false for update appearance instead
        }

        //		string str = "";
        frame.ComputePfImageFromHistogram();
        //		for (int i = 0; i < 16; i++) {
        //			str += frame.histogram.posterior [i * 16 * 16].ToString();
        //		}
        //		Debug.Log (str);
    }