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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:53:52+00:00 2026-06-02T13:53:52+00:00

I made rectangle detection work with contour detection and apply polygon with OpenCv to

  • 0

I made rectangle detection work with contour detection and apply polygon with OpenCv to get location of the rectangle before adjusting the perspective projection. And it’s working great. But some people in my group suggested Hough transformation instead. I wonder if there is any advantage of using Hough transformation for rectangle detection.

Update: I tried both of the methods. In my example, both methods worked fine after Canny edge detection. But since Hough transformation produces lines, we have to assume several things such as length of lines and connectability of the lines and should do additional computations such as searching connected lines and find corner points from the connected lines. Personally, I liked contour method better since its concept is simpler. With the method, you just search contours that can be approximated with closed and convex polygons with 4 corners and adjust the polygons for their perspective projections. That’s about it.

  • 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-02T13:53:57+00:00Added an answer on June 2, 2026 at 1:53 pm

    What sort of results are you getting with contour detection so far? Got any examples?

    Hough transform should work well for rectangle detection IFF you can assume that the sides of the rectangle are the most prominent lines in your image.
    Then you can simply detect the 4 biggest peaks in hough space and you got your rectangle.

    This works for example with a photo of a white sheet of paper in front of a dark background.

    Ideally you would preprocess the image with blur, threshold, morphological operators to remove any small-scale structures before hough transform.

    If there are multiple smaller rectangles or other sorts of prominent lines in your images, contour detection might be the better choice.

    Some general advantages for the hough transform off the top of my head:

    • Hough transform can still work if part of the rectangle is obstructed or out of the frame.
    • Hough transform should be faster than contour detection, I guess?
    • Hough transform will ignore anything that is not a straight line, so you may have greater success with cluttered images. (if the rectangle sides are the most prominent lines)

    In the end it probably depends on the input data. Got any examples?

    Perhaps a combined approach would be best? see
    Combining Hough Transform and Contour Algorithm for detecting Vehicles License-Plates

    I did some experiments in using hough transform to detect rectangles a while back, you can see some preliminary results here:
    http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=14491&start=9

    Unfortunately that is all that exists at the moment, the project is currently on hiatus, eventually I hope to resume it when I am less busy.

    I’d be very interested in your results in comparison.

    (If you are doing perspective correction, also check out proportions of a perspective-deformed rectangle )

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

Sidebar

Related Questions

I made a collision detection in the Update() section, and this is the code:
So I created a button in xaml (made a rectangle > right click >
Basically, I'm doing some sort of image processing using a screen-sized rectangle made of
I made a rounded rectangle in as3 and would like to expand it on
I've made a very simple customView, a gray rectangle with an arbitrary amount of
im making a platform type of game. I made my main character a rectangle
I made a simple button template from the rectangle with Make into control../Button command.
I've made a horizontal menu using a list. I'm trying to get each <li>
I made a JComponent that displays a rectangle of a specified color. (Haven't found
Made this nice little loop for hiding and showing div's, works as a charm

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.