| 28 | } |
| 29 | |
| 30 | static void ShapeToLandmarks( // convert Shape to landmarks (float *) |
| 31 | float* landmarks, // out |
| 32 | const Shape& shape) // in |
| 33 | { |
| 34 | CV_Assert(shape.rows <= stasm_NLANDMARKS); |
| 35 | int i; |
| 36 | for (i = 0; i < MIN(shape.rows, stasm_NLANDMARKS); i++) |
| 37 | { |
| 38 | landmarks[i * 2] = float(shape(i, IX)); |
| 39 | landmarks[i * 2 + 1] = float(shape(i, IY)); |
| 40 | } |
| 41 | // set remaining unused landmarks if any to 0,0 |
| 42 | for (; i < stasm_NLANDMARKS; i++) |
| 43 | { |
| 44 | landmarks[i * 2] = 0; |
| 45 | landmarks[i * 2 + 1] = 0; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | static const Shape LandmarksAsShape( // return a Shape |
| 50 | const float* landmarks) // in |
no outgoing calls
no test coverage detected