| 1128 | |
| 1129 | template <typename T> |
| 1130 | bool SimplePinholeCameraModel::ImgFromCam( |
| 1131 | const T* params, const T& u, const T& v, const T& w, T* x, T* y) { |
| 1132 | if (w < std::numeric_limits<T>::epsilon()) { |
| 1133 | return false; |
| 1134 | } |
| 1135 | |
| 1136 | const T f = params[0]; |
| 1137 | const T c1 = params[1]; |
| 1138 | const T c2 = params[2]; |
| 1139 | |
| 1140 | // No Distortion |
| 1141 | |
| 1142 | // Transform to image coordinates |
| 1143 | *x = f * u / w + c1; |
| 1144 | *y = f * v / w + c2; |
| 1145 | |
| 1146 | return true; |
| 1147 | } |
| 1148 | |
| 1149 | bool SimplePinholeCameraModel::CamFromImg( |
| 1150 | const double* params, double x, double y, double* u, double* v) { |
nothing calls this directly
no outgoing calls
no test coverage detected