从openCV函数访问返回值C ++ NDK

时间:2017-12-27 19:05:03

标签: c++ opencv android-ndk

我在OpenCV中使用Knn findNearest函数,它接受以下参数:

Mat response;
Mat dist;

knn->findNearest(testFeature, K, noArray(), response, dist);

从response和dist返回的输出是OutputArray类型。

如何以此格式访问response和dist的结果? 理想情况下,我想转换为Mat int。

1 个答案:

答案 0 :(得分:0)

如果要将mat数据复制到cpp数组中,可以这样做。 我假设您要返回的Mat数据是浮点类型。

this.props.navigation.navigate("B", {"foo":"bar"})

您需要在将其复制到JNIArray后删除outArr。

相关问题