OpenCV-tracking mit optical flow

Ich dies verwenden, um Funktionen als Basis meiner tracking-Algorithmus.

    //1. detect the features
    cv::goodFeaturesToTrack(gray_prev, //the image 
    features,   //the output detected features
    max_count,  //the maximum number of features 
    qlevel,     //quality level
    minDist);   //min distance between two features

    //2. track features
    cv::calcOpticalFlowPyrLK(
    gray_prev, gray, //2 consecutive images
    points_prev, //input point positions in first im
    points_cur, //output point positions in the 2nd
    status,    //tracking success
    err);      //tracking error

cv::calcOpticalFlowPyrLK nimmt-Vektor, der die Punkte aus dem vorherigen Bild als Eingabe und gibt entsprechende Punkte auf das nächste Bild. Angenommen ich habe zufällig pixel (x, y) aus dem vorherigen Bild, wie kann ich berechnen position dieses pixels auf dem nächsten Bild mit OpenCV optical-flow-Funktion?

InformationsquelleAutor der Frage Alex Hoppus | 2012-03-14

Schreibe einen Kommentar