We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static cv::Mat transform(cv::Mat src, float angle, float scale){ cv::Mat dst; cv::Point center(src.cols/2, src.rows/2); cv::Mat rot_mat = cv::getRotationMatrix2D(center, angle, scale); cv::warpAffine(src, dst, rot_mat, src.size()); return dst; }
这里边的center是否该用 cv::Point2f center((float)src.cols / 2, (float)src.rows / 2);
cv::Point2f center((float)src.cols / 2, (float)src.rows / 2);
The text was updated successfully, but these errors were encountered:
对,改成float最好。 不改其实也行,因为旋转不一定要绕着中心,随便绕哪个点,后面transform的时候这个点最终的位移公式都一样。选中心主要是怕旋转的时候图像转出去被截断了。
Sorry, something went wrong.
嗯,这样在template是奇数长宽的时候也ok了,本来会有问题
No branches or pull requests
这里边的center是否该用
cv::Point2f center((float)src.cols / 2, (float)src.rows / 2);
The text was updated successfully, but these errors were encountered: