Out of range error in delaunay-triangulation
I'm trying to run the program which is compiled from the code here.
http://www.learnopencv.com/delaunay-t...
I'm using Visual studio 2015 and openCV 3.2. I encounter run error whose message is "OpenCV Error: One of arguments' values is out of range () in cv::Subdiv2D::locate, ..."
Can anyone help solve this problem?
let me guess: you're using another (smaller) image, but the same pointslist ?
No.. I use the exact image and point list file
well, i tried with the code, and points from a kazemi landmarks detector (in opencv3.4), and works flawless for me.
imho, the error is in your data somehow, not nessecarily in the code. (it complains, that one of the points is outside the rect)
(did you make sure, your image is loaded ? please add a check there !)
I checked before and I'm sure the image is successfully loaded in. The error occurs in line 111 which is subdiv.insert(*it) The error occurs in the first iteration when the insert method is called. I print out the point and the content is [207, 242] which is the same as the first line in obama.txt file describes. I also print out rect and the content is [512 * 697 from (0, 0)]. I really don't know why the first point is out of range..
i think, the error comes from here
make a breakpoint in locate(), and debug it.
I discover the bottonRight in subdiv is {x=0.000000000 y=5.605e-45#DEN } subdiv is initialized using subdiv(rect), and I'm sure rect is correct still thinking how to solve it Do you have any idea?
can you add the points file to your question ?
(now, how can x be 0 ? )
I think the problem is not about the point file, but initializing subdiv.
i'm more and more inclined to think that, too. still, if i'd have the data, i'd try.
Here link text