| 917 | #endif |
| 918 | |
| 919 | DetectorParameter FlipDetPar( // mirror image of detpar |
| 920 | const DetectorParameter& detpar, // in |
| 921 | int imgwidth) // in |
| 922 | { |
| 923 | DetectorParameter detpar_new(detpar); |
| 924 | |
| 925 | detpar_new.x = imgwidth - detpar.x; |
| 926 | detpar_new.y = detpar.y; |
| 927 | detpar_new.width = detpar.width; |
| 928 | detpar_new.height = detpar.height; |
| 929 | const bool valid_leye = Valid(detpar.lex); |
| 930 | const bool valid_reye = Valid(detpar.rex); |
| 931 | |
| 932 | detpar_new.lex = detpar_new.ley = |
| 933 | detpar_new.rex = detpar_new.rey = |
| 934 | detpar_new.mouthx = detpar_new.mouthy = INVALID; |
| 935 | |
| 936 | if (valid_leye) |
| 937 | { |
| 938 | detpar_new.rex = imgwidth - detpar.lex; |
| 939 | detpar_new.rey = detpar.ley; |
| 940 | } |
| 941 | if (valid_reye) |
| 942 | { |
| 943 | detpar_new.lex = imgwidth - detpar.rex; |
| 944 | detpar_new.ley = detpar.rey; |
| 945 | } |
| 946 | if (Valid(detpar.mouthx)) |
| 947 | { |
| 948 | detpar_new.mouthx = imgwidth - detpar.mouthx; |
| 949 | detpar_new.mouthy = detpar.mouthy; |
| 950 | } |
| 951 | return detpar_new; |
| 952 | } |
| 953 | |
| 954 | |
| 955 | bool InRect( // is the center of rect within the enclosing rect? |
no test coverage detected