| 17 | } |
| 18 | |
| 19 | static void InterPoint( // interpolate a point from two nearby oldshape points |
| 20 | Shape& shape, // io |
| 21 | const Shape& oldshape, // in |
| 22 | int i, // in: shape point |
| 23 | double ratio, // in: interpolation ratio, 0 to 1 |
| 24 | int i1, // in: oldshape point 1 |
| 25 | int i2) // in: oldshape point 2 |
| 26 | { |
| 27 | if (!PointUsed(oldshape, i1) && !PointUsed(oldshape, i2)) |
| 28 | { |
| 29 | shape(i, IX) = 0; |
| 30 | shape(i, IY) = 0; |
| 31 | } |
| 32 | else if (!PointUsed(oldshape, i1)) |
| 33 | { |
| 34 | shape(i, IX) = oldshape(i2, IX) + 1; // +1 is arb, to disambiguate point |
| 35 | shape(i, IY) = oldshape(i2, IY) + 1; |
| 36 | } |
| 37 | else if (!PointUsed(oldshape, i2)) |
| 38 | { |
| 39 | shape(i, IX) = oldshape(i1, IX) + 1; |
| 40 | shape(i, IY) = oldshape(i1, IY) + 1; |
| 41 | } |
| 42 | else |
| 43 | { |
| 44 | CV_Assert(ratio >= 0 && ratio <= 1); |
| 45 | shape(i, IX) = ratio * oldshape(i1, IX) + (1-ratio) * oldshape(i2, IX); |
| 46 | shape(i, IY) = ratio * oldshape(i1, IY) + (1-ratio) * oldshape(i2, IY); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | static Shape Shape77As20( // return an approximated BioID 20 point shape |
| 51 | const Shape& shape) // in: Stasm 77 point shape |
no test coverage detected