52 vertices = rbbox.reshape((4, 2)).astype(np.float32)
54 rotationMatrix = cv.getPerspectiveTransform(vertices, self.
_targetVertices)
55 cropped = cv.warpPerspective(image, rotationMatrix, self.
_inputSize)
60 cropped = cv.cvtColor(cropped, cv.COLOR_BGR2GRAY)
62 return cv.dnn.blobFromImage(cropped, size=self.
_inputSize, mean=127.5, scalefactor=1 / 127.5)