element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Blog Track object in movie file and transform into data to be used with arduino servos
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rictrajano
  • Date Created: 6 Feb 2020 8:13 AM Date Created
  • Views 1015 views
  • Likes 2 likes
  • Comments 3 comments
Related
Recommended

Track object in movie file and transform into data to be used with arduino servos

rictrajano
rictrajano
6 Feb 2020

Hello,

 

After doing some research I haven’t found exactly what i’m looking for. Basically I looking for a way to translate movement of an object in a video file (like a recording of a ball jumping up a down) to values that I can use to move servos. I’m more comfortable with arduino so that’s the microcontroller that I’m aiming to use with this project.

I’d like to either be able to move the servos in realtime in sync while playing the video or saving the values and using them later on by themselves.

I imagine something like playing a video, defining what in the video I want to track and having it saving the values of the object position in the screen.

 

Thanks for your help in advance.

  • Sign in to reply

Top Comments

  • BigG
    BigG over 5 years ago +5
    Before you even get to image recognition you need to consider how much memory resource is required just to capture and store one image. Then with a video you need to then recognise that a new image will…
  • Sean_Miller
    Sean_Miller over 5 years ago +4
    If you solely need the coordinate data that you will later do some math on to get your servo values , here's how I'd do it: Shoot your footage with a tripod. Be perpendicular to the action being video…
  • dubbie
    dubbie over 5 years ago +2
    An interesting idea. Maybe you could re-use some ideas from the PixyCam device as it is open source and replace the live input video stream with the recorded video stream. Dubbie
  • Sean_Miller
    Sean_Miller over 5 years ago

    If you solely need the coordinate data that you will later do some math on to get your servo values , here's how I'd do it:

     

    1. Shoot your footage with a tripod.  Be perpendicular to the action being video'd to avoid "into the plane" movement.
    2. Download, install, and open Blender
    3. Click the icon by the View Menu to change the Editor Typeto Movie Clip Editor
    4. Click open to load in your movie.
    5. Find something on what you want to track that stands out.  Hold CTRL and left click it.  This will add our tracker.
    6. Hit the track ahead button or CTRL t so it will advance the movie and track your object.
    7. You can now scrub the view with the icons on the bottom of the page and get the coordinates on the right.  I'd record time, x, and y in a spreadsheet and then make a function to translate that to servo values.

     

    Here is a picture where I just tracked my lawn mower as the camera moved.  You can see a white box at its wheel, a red line showing where the box was, and a blue line where the box is going in time.  The other red dotted sections the track forward button (left) and the coordinates (right).

    image

     

    Sounds like you have a fun project.

     

    See ya',

    Sean

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • BigG
    BigG over 5 years ago

    Before you even get to image recognition you need to consider how much memory resource is required just to capture and store one image. Then with a video you need to then recognise that a new image will arrive every 1/24th of a second (if 24 frames per sec) or even 1/30th of a second (if 30 frames per second). So MCU processing speed and run time memory need to match the camera and image resolution to start things off and then you need additional resource for the image processing to determine if the object you are looking for is present etc.

     

    So, you may be quite limited on options with a standard Arduino - there are new Arduino models just out that should work (e.g https://www.arduino.cc/pro/hardware ). Adafruit's Metro M4 (or any decent ARM Cortex M4 with fpc) should also work too in simpler image recognition cases (https://www.adafruit.com/product/3382 ). SBC's like Raspberry Pi, Beaglebone etc. are probably the better choice here if minimal latency is a requirement for servo movement.

     

    https://www.tensorflow.org/  or https://www.tensorflow.org/lite  are popular choices for SBC's.

     

    Then there are some popular Python based options, which could work on an M4: https://opencv.org/  and SimpleCV

     

    Others picked up from online search include: https://github.com/jesolem/PCV  and a c++ option https://github.com/dtschump/CImg

     

    Otherwise you may be better off using the cloud for the image recognition grunt work. All the major players, like Google, AWS, Azure, IBM offer image recognition api's.

     

    PS. Another consideration/idea is to use a mobile phone to handle the image capture and processing (using tensor flow) and then link with an arduino via BLE to push coordinates across for servo movement... so, basically there are other ways to skin this cat...

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dubbie
    dubbie over 5 years ago

    An interesting idea. Maybe you could re-use some ideas from the PixyCam device as it is open source and replace the live input video stream with the recorded video stream.

     

    Dubbie

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube