- 论坛徽章:
- 0
|
- void Homography33::compute() {
- if (valid) return;
- std::vector<cv::Point2f> sPts;
- std::vector<cv::Point2f> dPts;
- for (int i = 0; i<4; i++) {
- sPts.push_back(cv::Point2f(srcPts[i].first, srcPts[i].second));
- }
- for (int i = 0; i<4; i++) {
- dPts.push_back(cv::Point2f(dstPts[i].first - cxy.first, dstPts[i].second - cxy.second));
- }
- cv::Mat homography = cv::findHomography(sPts, dPts);
- for (int c = 0; c<3; c++) {
- for (int r = 0; r<3; r++) {
- H(r, c) = homography.at<double>(r, c);
- }
- }
- valid = true;
- }
复制代码 就是这个函数返回会发生内存错误,把cv::Mat homography = cv::findHomography(sPts, dPts);删掉就不会了,难道是Mat析构函数出问题了?感觉不会啊,
求大神指点 |
|