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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:11:31+00:00 2026-06-17T05:11:31+00:00

I need to solve a problem when I am detecting rectangles with rounded corners

  • 0

I need to solve a problem when I am detecting rectangles with rounded corners using opencv. Basically I’m using the same code sample squares.c:

cvFindContours( gray, storage, &contours, sizeof(CvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE );
while( contours )
{
    double area=fabs(cvContourArea(contours, CV_WHOLE_SEQ));
    if(area < minimum_area || area > maximum_area) {
        contours = contours->h_next;
        continue;
    }               
    result = cvApproxPoly( contours, sizeof(CvContour), storage,
        CV_POLY_APPROX_DP, cvContourPerimeter(contours)*0.05, 0 );
    if( result->total == 4 &&
        fabs(cvContourArea(result,CV_WHOLE_SEQ)) > 1000 &&
        cvCheckContourConvexity(result) )
        {

With this code I can usually detect the image, but I need to adjust the image’s perspective and for that I need to detect the corners of the image, how to do this and the image has rounded corners? The problem happens because the point I need not detected between points, as an example, I created the following image, where the black lines represent the points detected by the existing code and the blue dots are the ones I need?

enter image description here

Thank’s for any help.

  • 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-06-17T05:11:32+00:00Added an answer on June 17, 2026 at 5:11 am

    In OpenCV terms, first find the black rectangle by using FindContours with RETR_EXTERNAL and CHAIN_APPROX_SIMPLE. Now you find the minimal bounding box of this round rectangle by using minAreaRect on the points found by FindContours. To get the corners of this bounding box, use the function BoxPoints on the return (center, (width, height), rotation angle) of minAreaRect. Now you have the four corners of the red line you are after.

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

Sidebar

Related Questions

Okay guys,I need to solve this problem using minimum if else condition.Let me explain
I need to solve a problem within job booking software and am hoping to
I don't like JSF but I need to solve this problem with it, I
I need to solve a locking problem for this scenario: A multi CPU system.
I need to solve such a problem. There is a base class and two
To solve some problem I need to compute a variant of the pascal's triangle
I need to solve a job affectation problem and I would like to find
Well i need some help here i don't know how to solve this problem.
I need a regular expression to solve the following problem (links to similar problems
This the problem in my book that I am trying to solve..I need to

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.