2

我正在使用 opencv | ndk | cdt in android, eclipse Juno 发布。我将项目路径设置如下。

${NDK}\sources\cxx-stl\gnu-libstdc++\4.6\include
${NDK}\sources\cxx-stl\gnu-libstdc++\4.6\libs\armeabi-v7a\include
${NDK}/platforms/android-14/arch-arm/usr/include

但是当我使用向量时,它显示了一些错误。正如下面的代码所示,向量对象匹配,不能使用某些方法,例如 match.at(0) 甚至 match[0] 都是错误的。但是方法matches.empty() 或matches.push_back() 效果很好。如此迷茫。

cpp源代码:

vector< DMatch > matches;
matcher.match( descriptors_object, descriptors_scene, matches );

double max_dist = 0; double min_dist = 100;

//-- Quick calculation of max and min distances between keypoints
for(vector<DMatch>::iterator it = matches.begin(), it < matches.end(), it ++){

}

for( int i = 0; i < descriptors_object.rows; i++ )
{
    double dist = matches[i].distance;
    if( dist < min_dist ) min_dist = dist;
    if( dist > max_dist ) max_dist = dist;
}

另外,上面的代码:

//-- Quick calculation of max and min distances between keypoints
for(vector<DMatch>::iterator it = matches.begin(), it < matches.end(), it ++){

}

当按 F3 去定义向量时,eclipse 显示向量语法错误!!!并让我选择去的位置。

任何建议将不胜感激。谢谢

4

0 回答 0