| 28 | |
| 29 | template<typename T> |
| 30 | float get_l2_distance(std::vector<T> p1, std::vector<T> p2) |
| 31 | { |
| 32 | T sq_sum = 0.0; |
| 33 | for(int d = 0; d < p1.size(); d++) |
| 34 | { |
| 35 | sq_sum = sq_sum + (p1[d] - p2[d]) * (p1[d] - p2[d]); |
| 36 | } |
| 37 | float dis = sqrt(sq_sum); |
| 38 | return dis; |
| 39 | } |
| 40 | |
| 41 | template |
| 42 | float get_pixel<float>(const float * data, int height, int width, int h, int w); |
no test coverage detected