| 116 | } |
| 117 | |
| 118 | Shape ImgShapeToRoiFrame( // return shape in ROI frame |
| 119 | const Shape& shape, // in: shape in image frame |
| 120 | const DetectorParameter& detpar_roi, // in: detpar wrt the ROI |
| 121 | const DetectorParameter& detpar) // in |
| 122 | { |
| 123 | Shape outshape(ShiftShape(shape, detpar_roi.x - detpar.x, |
| 124 | detpar_roi.y - detpar.y)); |
| 125 | if (Valid(detpar.rot) && detpar.rot) |
| 126 | { |
| 127 | const MAT rotmat = getRotationMatrix2D(cv::Point2f(float(detpar_roi.x), |
| 128 | float(detpar_roi.y)), |
| 129 | -detpar.rot, |
| 130 | 1.); |
| 131 | TransformShapeInPlace(outshape, rotmat); |
| 132 | } |
| 133 | return outshape; |
| 134 | } |
| 135 | |
| 136 | // In StartShapeAndRoi we selected a ROI and possibly rotated that ROI. |
| 137 | // The search was done on that ROI. Now de-adjust the search results |
no test coverage detected