| 138 | // to undo the effects of searching on the ROI, not on the actual image. |
| 139 | |
| 140 | Shape RoiShapeToImgFrame( // return shape in image frame |
| 141 | const Shape& shape, // in: shape in roi frame |
| 142 | const Image& face_roi, // in |
| 143 | const DetectorParameter& detpar_roi, // in: detpar wrt the ROI |
| 144 | const DetectorParameter& detpar) // in: detpar wrt the image |
| 145 | { |
| 146 | Shape outshape(shape.clone()); |
| 147 | if (IsLeftFacing(detpar.eyaw)) |
| 148 | outshape = FlipShape(outshape, face_roi.cols); |
| 149 | if (Valid(detpar.rot) && detpar.rot) |
| 150 | { |
| 151 | const MAT rotmat = |
| 152 | getRotationMatrix2D(cv::Point2f(float(detpar_roi.x), |
| 153 | float(detpar_roi.y)), |
| 154 | detpar.rot, 1.); |
| 155 | TransformShapeInPlace(outshape, rotmat); |
| 156 | } |
| 157 | return ShiftShape(outshape, detpar.x - detpar_roi.x, |
| 158 | detpar.y - detpar_roi.y); |
| 159 | } |
| 160 | |
| 161 | void PossiblySetRotToZero( // this is to avoid rotating the image unnecessarily |
| 162 | double& rot) // io |
no test coverage detected