You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
谢谢博主,已经解决了,在types.hpp大致1847行添加下面代码,确实是windows的原因
inline
RotatedRect::RotatedRect(const Point2f& _point1, const Point2f& _point2, const Point2f& _point3)
{
Point2f _center = 0.5f * (_point1 + _point3);
Vec2f vecs[2];
vecs[0] = Vec2f(_point1 - _point2);
vecs[1] = Vec2f(_point2 - _point3);
double x = std::max(norm(_point1), std::max(norm(_point2), norm(_point3)));
double a = std::min(norm(vecs[0]), norm(vecs[1]));
// check that given sides are perpendicular
// this is the line you need to modify
CV_Assert(std::fabs(vecs[0].ddot(vecs[1])) * a <= FLT_EPSILON * 9 * x * (norm(vecs[0]) * norm(vecs[1])));
// wd_i stores which vector (0,1) or (1,2) will make the width
// One of them will definitely have slope within -1 to 1
int wd_i = 0;
if (std::fabs(vecs[1][1]) < std::fabs(vecs[1][0])) wd_i = 1;
int ht_i = (wd_i + 1) % 2;
float _angle = std::atan(vecs[wd_i][1] / vecs[wd_i][0]) * 180.0f / (float)CV_PI;
float _width = (float)norm(vecs[wd_i]);
float _height = (float)norm(vecs[ht_i]);
center = _center;
size = Size2f(_width, _height);
angle = _angle;
您好,想请教一下使用实例图片Src1.bmp测试时,当角度容差允许值非零时,就会出现程序崩溃的情况,崩溃的程序位于MathToolDlg.cpp 1064行
The text was updated successfully, but these errors were encountered: