mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-19 11:21:39 +08:00
Added perf_test and test based on distance and overlap for tracking API
Added OPE tests tracking - Reinitialized random number generator (TrackerMIL and TrackerBoosting) - Removed unused meanSigmaPair Changed sample tracker.cpp with a list of images instead the video file Modified OPE tests tracking - The overlap threshold varies from 0.0 to 1.0 - The location error threshold varies from 0 to 50 Changed name for the tests Removed unused field Enlarged first rect of 10% respect the ground truth Added TRE test TRE test for the temporal robustness evaluation Added SRE Test (spatial robustness evaluation) - Removed the enlargment of the first frame - TRE corrected the computation of the distance and the overlap - TrackerBoosting changed the search factor Fixed last segment in test TRE First stub for regression test Added test for faceocc2 Added perf_test for mil and boosting trackers Modified SANITY_CHECK with ERROR_RELATIVE In xml generated added the ratio between of the correct bounding box (based on dynamic threshold) OPE Test: works with video and not with sequence of images TRE Test: works with video and not with sequence of images SRE Test: works with video and not with sequence of images Perf test: works with video and not with sequence of images Removed unused file sample tracker.cpp: works with video and not with sequence of images
This commit is contained in:
@@ -13,15 +13,17 @@ static bool selectObject = false;
|
||||
static bool startSelection = false;
|
||||
|
||||
static const char* keys =
|
||||
{ "{@tracker_algorithm | | tracker algorithm }"
|
||||
"{@video_name | | video name }" };
|
||||
{ "{@tracker_algorithm | | Tracker algorithm }"
|
||||
"{@video_name | | video name }"
|
||||
"{@start_frame |1| Start frame }" };
|
||||
|
||||
static void help()
|
||||
{
|
||||
cout << "\nThis example shows the functionality of \"Long-term optical tracking API\""
|
||||
"-- pause video [p] and draw a bounding box around the target to start the tracker\n"
|
||||
"Example of <video_name> is in opencv_extra/testdata/cv/tracking/\n"
|
||||
"Call:\n"
|
||||
"./tracker <tracker_algorithm> <video_name>\n"
|
||||
"./tracker <tracker_algorithm> <video_name> <start_frame>\n"
|
||||
<< endl;
|
||||
|
||||
cout << "\n\nHot keys: \n"
|
||||
@@ -69,6 +71,7 @@ int main( int argc, char** argv )
|
||||
|
||||
String tracker_algorithm = parser.get<String>( 0 );
|
||||
String video_name = parser.get<String>( 1 );
|
||||
int start_frame = parser.get<int>( 2 );
|
||||
|
||||
if( tracker_algorithm.empty() || video_name.empty() )
|
||||
{
|
||||
@@ -79,6 +82,7 @@ int main( int argc, char** argv )
|
||||
//open the capture
|
||||
VideoCapture cap;
|
||||
cap.open( video_name );
|
||||
cap.set( CAP_PROP_POS_FRAMES, start_frame );
|
||||
|
||||
if( !cap.isOpened() )
|
||||
{
|
||||
@@ -108,11 +112,19 @@ int main( int argc, char** argv )
|
||||
imshow( "Tracking API", image );
|
||||
|
||||
bool initialized = false;
|
||||
int frameCounter = 0;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
if( !paused )
|
||||
{
|
||||
cap >> frame;
|
||||
|
||||
if( frame.empty() )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
frame.copyTo( image );
|
||||
|
||||
if( !initialized && selectObject )
|
||||
@@ -134,6 +146,7 @@ int main( int argc, char** argv )
|
||||
}
|
||||
}
|
||||
imshow( "Tracking API", image );
|
||||
frameCounter++;
|
||||
}
|
||||
|
||||
char c = (char) waitKey( 2 );
|
||||
|
Reference in New Issue
Block a user