Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7545199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:52:01+00:00 2026-05-30T08:52:01+00:00

I am using NetBeans 7.1 on Ubuntu 11.04 and would like to obtain triangles

  • 0

I am using NetBeans 7.1 on Ubuntu 11.04 and would like to obtain triangles from a set of points using OpenCV. I build the Delaunay triangulation as follows.

CvMemStorage *storage;
size_t      ptIndex;
CvSubdiv2D* subdiv;

storage = cvCreateMemStorage(0);
subdiv =  cvCreateSubdivDelaunay2D( boundRect, storage );
for (ptIndex = 0; ptIndex<numPts; ptIndex++)
    cvSubdivDelaunay2DInsert(subdiv, points[ptIndex]);

That part seems to work OK. It runs and the resulting storage looks like this.

storage 0xb287a90
signature 1116274688
bottom 0x2a2d57a0
prev 0x0
next 0x2a2e5730
top 0x2cc947d0
prev 0x2cc84840
next 0x0
parent 0x0
signature
bottom
top
parent
block_size
free_space
block_size 65408
free_space 0

I have look at the documentation for these functions here but cannot find any function for extracting the triangles.

I would be most grateful if someone could tell me how to extract the triangles.

Peter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:52:02+00:00Added an answer on May 30, 2026 at 8:52 am

    You can iterate edges like this:

    CvMemStorage* storage = cvCreateMemStorage();
    CvSubdiv2D* subdivision = cvCreateSubdivDelaunay2D(rect, storage);
    for (int i = 0; i < points.size(); ++i)
    {
        cvSubdivDelaunay2DInsert(subdivision, points[i].Point);
    }
    
    cvCalcSubdivVoronoi2D(subdivision);
    CvSeqReader reader;
    CvSeq* seq = (CvSeq*) subdivision->edges;
    cvStartReadSeq(seq, &reader);
    for (int i = 0; i < seq->total; ++i)
    {
        CvQuadEdge2D* edge = (CvQuadEdge2D*)reader.ptr;
        if (CV_IS_SET_ELEM(edge))
        {
           // TODO: implement some edge related logic here...   
        }
        CV_NEXT_SEQ_ELEM(seq->elem_size, reader);
    }
    
    if (storage != 0)
    {
        cvReleaseMemStorage(&storage);
    }
    

    Then you can use cvSubdiv2DGetEdge with CV_NEXT_AROUND_LEFT as type parameter it will iterate on the edges from the same facet (triangle)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using OpenCV 2.3.1 to develop Delaunay triangulation code on NetBeans 6.9 on
I am using NetBeans 7.0.1 to develop C++ applications using OpenCV 2.4.0 on Ubuntu
I'm using Netbeans on Linux (Ubuntu 9.04) to build a C project. How do
I am using OpenCV 2.4 with NetBeans 7.0.1 on Ubuntu 11.10. When I try
I am using Netbeans 7.1 on Ubuntu 11.04. The following call set< Triangle >
I am using OpenCV 2.3.1 with C++ on NetBeans 7.1 on Ubuntu 11.04 (Gnome).
I am using Netbeans 6.9 on Ubuntu 11.04. I am developing a console op.and
When using Netbeans' features for generating event handlers from a GUI, for example, while
I'm trying to build an application in PHP using my Ubuntu laptop. I'm having
I am running java code using Netbeans IDE in Ubuntu 12.04. I am trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.