我有兩個向量像如何使用特徵庫計算曼哈頓距離?
int main(int argc, char *argv())
{
.........
Vector3f center(0.4,0.1,0.3) ;
Vector3f point(0.1,0.2,0.7);
.......
}
如何計算使用本徵庫曼哈頓距離是多少?我正在使用VS2010。
我有兩個向量像如何使用特徵庫計算曼哈頓距離?
int main(int argc, char *argv())
{
.........
Vector3f center(0.4,0.1,0.3) ;
Vector3f point(0.1,0.2,0.7);
.......
}
如何計算使用本徵庫曼哈頓距離是多少?我正在使用VS2010。
只要您知道曼哈頓距離是什麼(儘管我之前沒有看到用於3D矢量的術語),這並不困難 - 只需在Eigen API文檔中查看相關功能, LL然後發現了以下工作:
Vector3f center(0.4,0.1,0.3) ;
Vector3f point(0.1,0.2,0.7);
Vector3f diff = center - point;
float manh_dist = diff.cwiseAbs().sum();
非常感謝。它工作正常。 – user2036891
只要獲得兩點之間的大小? – Rapptz