【问题标题】:I cannot view components of an array我无法查看数组的组件
【发布时间】:2015-09-25 02:12:46
【问题描述】:

我正在使用以下 openCV 变量:

std::vector<cv::DMatch> best_matches;
std::vector<cv::KeyPoint> tkeypoints[15];

当我按下“。”并尝试获取 best_matches 的组件,例如 best_matches[i].queryIdx 然后 queryIdx 正确出现在建议列表中。

但是,当我尝试获取 tkeypoints 的组件时,例如 tkeypoints[i].angle,我在建议列表中看不到它,如果我尝试这样运行它会出现错误。

为什么我无法访问第二个数组中的组件?

tkeypoints

best_matches

【问题讨论】:

    标签: arrays opencv struct components


    【解决方案1】:

    因为是

    std::vector<cv::KeyPoint> tkeypoints[15];
    

    你应该像这样访问它:

    tkeypoints[i][j].angle    
    

    【讨论】:

      猜你喜欢
      • 2013-03-25
      • 2017-04-20
      • 2016-06-17
      • 1970-01-01
      • 2016-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-05
      相关资源
      最近更新 更多