Home Using getVoronoiFacetList but can't get clockwise vertexes
Reply: 0

Using getVoronoiFacetList but can't get clockwise vertexes

user980 Published in March 22, 2018, 1:58 pm

I want to creat voronoi diagram by using opencv(getVoronoiFacetList) , and get the vertexes of each polygon.The code is attached as follows:

void getVoronoi(Mat Image, vector<cv::Point2f> vecCenterList) {
    Rect rect(0, 0,Image.cols, Image.rows); 
    Subdiv2D subdiv(rect); 
    for (size_t i = 0; i < vecCenterList.size(); i++)
    vector<vector<cv::Point2f> > vecPolylist;
    vector<cv::Point2f> centers;
    subdiv.getVoronoiFacetList(std::vector<int>(), vecPolylist, centers); 

But when I check the vertexes' coordinate I find they didn't save in the same direction(clockwise ),you can see in following pictures(index[3] to index[4] in the anti-clockwise ):

the vertexes of polygon153, polygon153

I don't know how to figure out this error, or did I do some wrong operations to cause this error? Thanks for any help!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.321 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO