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
手写过Findhomography(在不显著增加体积情况下,增加一些功能),个人感觉比较有用。能否考虑引入ocvm中
// 对OpenCV的findHomography的重写,利用SVD求解 cv::Mat Findhomography(std::vector<cv::Point2f> src, std::vector<cv::Point2f> target) { // 求解系统为 A*X - B = 0 const int n = src.size(); float x[9] = {0}; cv::Mat A = cv::Mat::zeros(2 * n, 8, CV_32F); cv::Mat B = cv::Mat::zeros(2 * n, 1, CV_32F); cv::Mat X(8, 1, CV_32F, x); for (int i = 0; i < n; i++) { A.at<float>(i, 0) = src[i].x; A.at<float>(i + n, 3) = src[i].x; A.at<float>(i, 1) = src[i].y; A.at<float>(i + n, 4) = src[i].y; A.at<float>(i, 2) = 1; A.at<float>(i + n, 5) = 1; A.at<float>(i, 6) = -src[i].x * target[i].x; A.at<float>(i, 7) = -src[i].y * target[i].x; A.at<float>(i + n, 6) = -src[i].x * target[i].y; A.at<float>(i + n, 7) = -src[i].y * target[i].y; B.at<float>(i, 0) = target[i].x; B.at<float>(i + n, 0) = target[i].y; } cv::solve(A, B, X, cv::DECOMP_SVD); x[8] = 1; cv::Mat H = cv::Mat(3, 3, CV_32F, x).clone(); return H; } ···
The text was updated successfully, but these errors were encountered:
如果你的实现和标准 opencv findHomography 行为保持一致,欢迎 pull request
Sorry, something went wrong.
No branches or pull requests
手写过Findhomography(在不显著增加体积情况下,增加一些功能),个人感觉比较有用。能否考虑引入ocvm中
The text was updated successfully, but these errors were encountered: