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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:30:15+00:00 2026-05-11T00:30:15+00:00

Given an object on a plain white background, does anybody know if OpenCV provides

  • 0

Given an object on a plain white background, does anybody know if OpenCV provides functionality to easily detect an object from a captured frame?

I’m trying to locate the corner/center points of an object (rectangle). The way I’m currently doing it, is by brute force (scanning the image for the object) and not accurate. I’m wondering if there is functionality under the hood that i’m not aware of.

Edit Details: The size about the same as a small soda can. The camera is positioned above the object, to give it a 2D/Rectangle feel. The orientation/angle from from the camera is random, which is calculated from the corner points.

It’s just a white background, with the object on it (black). The quality of the shot is about what you’d expect to see from a Logitech webcam.

Once I get the corner points, I calculate the center. The center point is then converted to centimeters.

It’s refining just ‘how’ I get those 4 corners is what I’m trying to focus on. You can see my brute force method with this image: Image

  • 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. 2026-05-11T00:30:16+00:00Added an answer on May 11, 2026 at 12:30 am

    There’s already an example of how to do rectangle detection in OpenCV (look in samples/squares.c), and it’s quite simple, actually.

    Here’s the rough algorithm they use:

    0. rectangles <- {} 1. image <- load image 2. for every channel: 2.1  image_canny <- apply canny edge detector to this channel 2.2  for threshold in bunch_of_increasing_thresholds: 2.2.1   image_thresholds[threshold] <- apply threshold to this channel 2.3  for each contour found in {image_canny} U image_thresholds: 2.3.1   Approximate contour with polygons 2.3.2   if the approximation has four corners and the angles are close to 90 degrees. 2.3.2.1    rectangles <- rectangles U {contour} 

    Not an exact transliteration of what they are doing, but it should help you.

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

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You are correct; you would essentially be recreating the filter… May 11, 2026 at 3:30 pm
  • added an answer I'm not sure I follow your logic for using a… May 11, 2026 at 3:30 pm
  • added an answer The main things Validate Request is looking for are <… May 11, 2026 at 3:30 pm

Related Questions

I am a little confused here. I would like to do something like this:
Is it possible to save an ArrayList of custom objects to the application user
I have two insert statements, almost exactly the same, which run in two different
Does anyone know of an algorithm to find if a linked list loops on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.