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 6855879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:48:50+00:00 2026-05-27T01:48:50+00:00

I succeeded in using cvDrawContour but when I try to use cvMinRectArea2, it only

  • 0

I succeeded in using cvDrawContour but when I try to use cvMinRectArea2, it only shows one dot. Any ideas? Here’s the source code.

         IplImage *src = cvLoadImage("SignImg.jpg",0);

         IplImage *dst_img = 0;
         IplImage *img = cvCreateImage(cvGetSize(src),8,3);
         CvBox2D rect;

        CvMemStorage *storage = cvCreateMemStorage ();
         CvSeq *contours = 0;

        char a[255];
        sprintf(&a[0],"%s",openFileDialog1->FileName);

        dst_img = cvLoadImage(a,0);

        cvFindContours (src, storage, &contours, sizeof(CvContour), CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE ,cvPoint(0,0));          

        cvCvtColor(dst_img,img,CV_GRAY2BGR);

        cvDrawContours (img, contours, CV_RGB(255,0,0), cvScalarAll(255),1,1,8,cvPoint(0,0));
        rect=cvMinAreaRect2 (contours,0);
        cvEllipseBox(img,rect,cvScalarAll(0),5,8,0);
  • 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-27T01:48:51+00:00Added an answer on May 27, 2026 at 1:48 am

    The right way to use cvDrawContours is shown here:

        for( ; contour != 0; contour = contour->h_next )
        {
            CvScalar color = CV_RGB( rand()&255, rand()&255, rand()&255 );
    
            /* replace CV_FILLED with 1 to see the outlines */
            cvDrawContours( dst, contour, color, color, -1, CV_FILLED, 8 );
        }
    

    If it’s not obvious enough, your variable contours is an array and you need to iterate over it and draw each element! Else you will be drawing only the first element of the array.

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

Sidebar

Related Questions

I'm trying to do asynchronous downloading of files using urllib2 but have no succeeded
I finally succeeded in using Ajax to get SOMETHING sent from one page to
I have just succeeded in creating oAuth authentication for my twitter application using PHP.
I've succeeded in getting WCF Transport security going for our Logon web service using
I tried using Exist and IN. Not only did I not succeed, it didn't
Has anybody here succeeded in running Eclipse under Valgrind ? I'm battling a particularly
According to this question I succeeded to create upload image, but now I need
Has anybody succeeded in sending standalone attachments using the standalone attachment API (if possible
I am using django i18n and I have succeeded in translating strings and variables
Without using p/invoke, from a C++/CLI I have succeeded in integrating various methods of

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.