Repository: opencv
Issue: Problem in Subdiv2D, not complete triangulation
Labels: bug,category: core,confirmed,Hackathon

##### System information (version)
<!-- Example
- OpenCV => 4.2
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2017
-->

- OpenCV => 4.1.0
- Operating System / Platform => debian10
- Compiler => gcc-8.3

##### Detailed description

I found problem in `Subdiv2d`: in some cases it return only 1 triangle even if 4 points inserted.

Here all input polygon (trapeze):
![out](https://user-images.githubusercontent.com/29674023/76214615-2e16ab80-621e-11ea-9a4e-55dde2346e92.png)


And here what I get after triangulation by `Subdiv2d`:
![tr](https://user-images.githubusercontent.com/29674023/76214619-2fe06f00-621e-11ea-9d50-321181218d84.png)


##### Steps to reproduce

```c++
// main.cpp

#include <cstdlib>
#include <iostream>
#include <opencv2/imgproc.hpp>
#include <vector>

int main() {
  std::vector<cv::Point2f> points{
      {623, 1000}, {620, 1000}, {496, 770}, {473, 671}};

  cv::Rect subdivRect{cv::Point{472, 670}, cv::Point{625, 1002}};

  cv::Subdiv2D subdiv{subdivRect};
  subdiv.insert(points);

  std::vector<cv::Vec6f> out;
  subdiv.getTriangleList(out);

  std::cout << "triangles: " << out.size() << std::endl;

  cv::Vec6f outTr = out[0];
  // clang-format off
  std::cout << '[' << outTr[0] << ", " << outTr[1] << "], "
            << '[' << outTr[2] << ", " << outTr[3] << "], "
            << '[' << outTr[4] << ", " << outTr[5] << "]" << std::endl;
  // clang-format on

  return EXIT_SUCCESS;
}
```

##### Issue submission checklist

 - [ ] I report the issue, it's not a question
   <!--
   OpenCV team works with answers.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with question without real issue statement will be
   closed.
   -->
 - [ ] I checked the problem with documentation, FAQ, open issues,
       answers.opencv.org, Stack Overflow, etc and have not found solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://answers.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [ ] I updated to latest OpenCV version and the issue is still there
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only latest release for each branch.
   The ticket is closed, if the problem is not reproduced with modern version.
   -->
 - [x] There is reproducer code and related data files: videos, images, onnx, etc
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as archite to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->