Commit 974799ac authored by Vincent Rabaud's avatar Vincent Rabaud

- fix possible crash introduced by cvRound

parent 72728b44
......@@ -388,7 +388,8 @@ public:
private:
static inline int angle2Wedge(float angle)
{
return cvRound((angle / 360) * kNumAngles);
static float scale = float(kNumAngles) / 360.0f;
return std::min(int(std::floor(angle * scale)), kNumAngles - 1);
}
void generateRelativePattern(int angle_idx, int /*sz*/, cv::Mat & relative_pattern)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment