オブジェクトトラッカー

オブジェクトトラッカーは、モデルの実行間の中間フレームで検出されたオブジェクトを追跡し、既存のオブジェクトを新しい検出と照合します。 これにより、異なるフレーム内の同じオブジェクトについて認識が複製される可能性が低減されます。 また、モデルよりもオブジェクトの場所を頻繁に更新することで、よりスムーズな操作を提供できます。

次のコード スニペットは LSTrackerManager、 (LSTrackerManagerImpl によって実装された ) 検出を使用した追跡の例を示し ていますLSModelManager (LSModelManagerParallel によって実装されたもの ) 。

import android.graphics.Bitmap;

import com.here.see.common.util.permission.AuthorizationException;
import com.here.see.livesense.manager.LSModelManagerParallel;
import com.here.see.livesense.manager.LSTrackerManagerImpl;
import com.here.see.livesense.domain.Recognition;
import com.here.see.livesense.tracker.TrackedRecognition;

import java.io.IOException;
import java.util.List;

public class RecognitionWithTracking {
    private LSModelManagerParallel managerParallel;
    private LSTrackerManagerImpl trackerManager;

    public void init() {
        // Initialize manager and tracker
        managerParallel = new LSModelManagerParallel(new ManagerListener() {
            @Override
            public void onError(int i, Throwable throwable) {
                android.util.Log.e("Recognition", "Error in inference with modelId: " + i, throwable);
            }

            @Override
            public void onRecognitions(int modelId, int imageId, List<Recognition> list, long runTime) {
                // Process new detections
            }
        });
        trackerManager = new LSTrackerManagerImpl();
        managerParallel.setTrackerManager(trackerManager);
        managerParallel.addModel(LiveSenseModel.ROAD_BASICS, new RoadBasicsModel.Options(), 0.45f);

    }

    public void close() {
        managerParallel.close();
        if (trackerManager != null) {
            trackerManager.close();
        }
    }

    /**
     * @param frame          RGBA8888 image
     * @param frameRotation  Clockwise rotation to reach frame's natural orientation as a multiple of 90 degrees
     */
    public List<TrackedRecognition> recognizeWithTracking(Bitmap frame, byte[] frameLuminance, int frameRotation) {
        // Perform detection
        managerParallel.offerImage(frame, frameRotation);
        // Return current list of tracked recognitions for further processing/display
        return trackerManager.getTrackedObjects();
    }
}

」に一致する結果は 件です

    」に一致する結果はありません