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

  • Home
  • SEARCH
  • 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 8719027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:41:27+00:00 2026-06-13T06:41:27+00:00

I’m using the camshiftdemo.c program that comes bundled with OpenCV 2.3.1: https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/camshiftdemo.c?rev=1429 I was

  • 0

I’m using the camshiftdemo.c program that comes bundled with OpenCV 2.3.1:

https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/camshiftdemo.c?rev=1429

I was wondering how I can use this program to instruct a robot to follow an object of choice? I’m trying to run an experiment to see if it will work, but I obviously need to tweak it a little bit.

The way camshiftdemo works is it draws a red ellipse around the object you chose (by clicking on it with your mouse). As the object moves so does the red ellipse. If the object moves further away the ellipse decreases in size and increases if it comes closer to the camera.

To instruct a robot I was thinking I tell it to move forward if the size of the red eclipse decreases, and move backward if it increases. The robot will move left if the eclipse moves to the left and moves right if the eclipse moves right.

Sounds simple enough, but where in this code is the eclipse being drawn? And what if the object moves back and forth in 10 seconds? Does this mean the robot stays in the same place (i.e. should I introduce a delay in the robots movements?)?

My goal is to get the camshiftdemo.c code to instruct the robot to move {forward,backward, turn left, turn right}.

So how can I get the robot to follow an object, either by using the size of the eclipse or otherwise?

  • 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-13T06:41:28+00:00Added an answer on June 13, 2026 at 6:41 am

    It seems like you are asking for a way to seed the detection of an object into the CamShift tracker.

    Depending on the amount of processing power your robot has, you may want to consider a simpler approach. If you can select the target you are looking for, I would choose something like a tennis-ball as they are a very bright and unique color. Now your object has a known color signature, and you can track it fairly simply using contour processing. Also, if you decide to use color tracking, consider switching to a color space like HSV or YCbCr. This will allow the color detection to be less sensitive to intensity change. Here is one of my older posts on color isolation in OpenCV.

    The main steps you’ll be taking are:

    1. inRange (isolates the object using color thresholds)
    2. findContours (use this to find the object blob; you’ll probably want the biggest one, but you could also filter by circularity if it’s circular)
    3. moments (to find the centroid of the detected object)

    Optionally, you can feed the object centroid into the CamShift tracker, and just use the above mentioned steps as an acquisition mode.

    Hope you find that helpful…

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a

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.