| 292 | } |
| 293 | |
| 294 | void stasm_force_points_into_image( // force landmarks into image boundary |
| 295 | float* landmarks, // io |
| 296 | int ncols, // in |
| 297 | int nrows) // in |
| 298 | { |
| 299 | for (int i = 0; i < stasm_NLANDMARKS; i++) |
| 300 | { |
| 301 | landmarks[i * 2] = Clamp(landmarks[i * 2], 0.0f, float(ncols-1)); |
| 302 | landmarks[i * 2 + 1] = Clamp(landmarks[i * 2 + 1], 0.0f, float(nrows-1)); |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | void stasm_convert_shape( // convert stasm_NLANDMARKS points to given number of points |
| 307 | float* landmarks, // io: return all points zero if can't do conversion |
no test coverage detected