Shop OBEX P1 Docs P2 Docs Learn Events
Camera tracking — Parallax Forums

Camera tracking

Mattdude45Mattdude45 Posts: 5
edited 2010-06-25 21:03 in BASIC Stamp
Hello, does anybody know an easy way to track a person/object. I am trying to make a turret that will aim at a person/moving object and shoot when its on the target.
Thanks

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-06-24 03:27
    Shoot them with what, exactly?

    -Phil
  • FranklinFranklin Posts: 4,747
    edited 2010-06-24 03:56
    www.youtube.com/watch?v=RxBa5bQfTGc

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • IroneIrone Posts: 116
    edited 2010-06-24 04:05
    How Ya Doin'? You need stereo! If you mount two Ping sensors on a board about 300 mm apart (around 12 inches) and slant them together 3 degrees each·they meet around 3 meters away. (about 115 inches) When you rotate your turret and both sensors give you the same distance the object is square with the center of the board. The problem is 3 meters is the maximum distance for the Ping.

    Casey

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I fish, therefore I lie!
  • Mattdude45Mattdude45 Posts: 5
    edited 2010-06-24 05:00
    So are you saying that it would only be able to see if an object is exactly 3 meters away? what if it was closer, but in the center?
  • IroneIrone Posts: 116
    edited 2010-06-24 05:27
    How Ya Doin'? The Ping sends out a high frequency chirp somewhat like the bat does. After it sends it it looks for its return. Then the BS2 calculates the time it takes and you multiply it by the speed of sound. Your turret moves one sensor closer to your object and then when the second one catches up the time equals the same. It is like moving an equalateral triangle with the point moving toward your object. The closest reading·on the datasheet is·2 cm. (around .8 inches)· You will not get this because the Pings are 300 mm apart but less than an inch will be too close for you. Can you give me about how far apart are the sensors and your object?

    Casey

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I fish, therefore I lie!
  • Mattdude45Mattdude45 Posts: 5
    edited 2010-06-24 05:37
    I am trying to get the most range possible so the farther the better. I am planning to use this in airsoft battles. so I also need it to be very responsive.
  • IroneIrone Posts: 116
    edited 2010-06-24 06:01
    How Ya Doin'? OOOH, you are shooting down competitors planes! Sounds like fun! I am just a newbie here and there may be other non contact sensors somewhat like Ping only with farther max distances. Most of the setups are 10 hertz which may be enough for you but you need to see the other planes before 3 meters. I have worked with plane geometry and trigonometry for most of my life. (I am a machinist)·If you need help along this sort you may e-mail me at any time and I will try my darndest to help. Have fun!

    Casey

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I fish, therefore I lie!
  • Mattdude45Mattdude45 Posts: 5
    edited 2010-06-24 13:01
    Thanks for the response. But I'm still wondering if it would be able to see objects exactly 3m in front of it, but not see anything that is closer than 3m.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-06-24 13:42
    If I'm reading the data sheet right, at about a 40" PING mounting height you'll have a 20 degree cone, SO..... it works up to 14.25" minimum detection distance with a 300mm PING separation.

    See attached PDF

    if I'm wrong about 20 degrees, I can change and update the drawing very easily.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • Mattdude45Mattdude45 Posts: 5
    edited 2010-06-24 13:45
    Oh that helps a lot. Thanks
  • hover1hover1 Posts: 1,929
    edited 2010-06-24 19:36
    In regards to accuracy over many feet, I think you will have to rely on something like OpenCV. I believe the video posted by Franklin, (which I had posted in an earlier thread with the same question), is using OpenCV, but it takes a PC to power it.

    You should check out what Hanno is doing with Viewport on the Propeller and OpenCV with blob recognition at:

    ·http://hannoware.com/viewport/

    Jim
  • IroneIrone Posts: 116
    edited 2010-06-25 21:03
    How Ya Doin'? See I told you someone with more experience than myself would help. I wonder if he knows I like to fish? Anyhow I have two attachments that better explain how to track an object. In the 17 degrees off picture the green side sees the object closer than the blue side. This means you have to turn the turret clockwise. In the dead on picture the object lines up with the center of the turret and square with the board. You must also calculate for your farthest signal and leave time for the sensor to read it or you will have crosstalk. (the green sensor listining to the signal the blue sensor is putting out) The sensors will work anyplace in the rippled area for a reading of distance.

    Casey

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I fish, therefore I lie!
Sign In or Register to comment.