Fixed point error in fillConvexPoly (Bug #1284)


Added by Andrey Kamaev over 13 years ago. Updated almost 13 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Here is test application source

 1#include <opencv2/core/core.hpp>
 2#include <vector>
 3
 4using namespace cv;
 5using namespace std;
 6
 7int main(int argc, char* argv[])
 8{
 9  vector<Point> line1;
10  vector<Point> line2;
11
12  line1.push_back(Point(1, 1));
13  line1.push_back(Point(5, 1));
14  line1.push_back(Point(5, 8));
15  line1.push_back(Point(1, 8));
16
17  line2.push_back(Point(2, 2));
18  line2.push_back(Point(10, 2));
19  line2.push_back(Point(10, 16));
20  line2.push_back(Point(2, 16));
21
22  Mat gray0(10,10,CV_8U, Scalar(0));
23
24  fillConvexPoly(gray0, line1, Scalar(255), 8, 0);
25
26  int nz1 = countNonZero(gray0);
27
28  fillConvexPoly(gray0, line2, Scalar(0), 8, 1);
29
30  int nz2 = countNonZero(gray0);
31
32  printf("before: %d, after: %d\n", nz1, nz2);
33  //expected  -  before: 40, after: 0
34  //actual    -  before: 40, after: 5
35
36  return 0;
37}

Associated revisions

Revision 0404b298
Added by Vadim Pisarevsky almost 13 years ago

fixed line clipping (ticket #1284)

Revision 5ca1b559
Added by Roman Donchenko over 11 years ago

Merge pull request #1284 from melody-rain:superres_example_2

History

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()
  • Description changed from Here is test application source <pre> #include <opencv2/core/core.h... to Here is test application source <pre><code class="cpp">... More

Updated by Alexander Shishkov almost 13 years ago

  • Assignee deleted (Vadim Pisarevsky)

Updated by Ivan Korolev almost 13 years ago

  • Assignee set to Ivan Korolev

Updated by Ivan Korolev almost 13 years ago

  • Assignee deleted (Ivan Korolev)

Updated by Vadim Pisarevsky almost 13 years ago

thanks for the sample! the problem has been fixed in r7732

  • Status changed from Open to Done
  • Assignee set to Vadim Pisarevsky

Updated by Alexander Shishkov almost 13 years ago

  • Target version set to 2.4.0

Also available in: Atom PDF