25 October 2023
Breaking Through the Barrier of Image and Video Manipulation in Elixir
This blog is going to cover my journey trying to find sources on video manipulation. The goal is to help make the journey easier for future developers interested in learning about image and video manipulation. The main goal of my research was motion tracking specifically, but this information should be helpful for any research into video manipulation.
Getting Started
When it comes to image manipulation using Elixir, the most difficult part can be getting started. When I began looking into video manipulation and motion tracking, it was clear that there were resources available, but every article I could find was in Python. It was while looking into how to manipulate videos that I found out about Evision. This seemed like my next big clue. Evision is used to convert functions from opencv and python to elixir.
First I checked to see if I could find anything about Evision and motion tracking, but not much luck there, but that’s ok. Because although I was having trouble searching for ideas for motion tracking with elixir, there were plenty of articles on how to move forward using opencv. The first thing that became apparent when looking at articles on motion tracking: there were a lot of terms I did not know and there were a lot of differing opinions on how to achieve what I wanted to build.
Further Understanding
This became the next goal: trying to understand the terminology used in the articles I was finding and understanding the values being passed to each photo manipulation function. A good starting point is the hexdocs on Evision and Open CV’s documentation. One thing you will probably notice if you research image manipulation: there are a lot of different techniques and calculations available to try to achieve the same goal. Each source will have their own opinions on which methods are the best. My advice in order to best decide which technique is to ask yourself about the final goals of your application. What pieces of the image are you interested in manipulating? How accurate do your results need to be? How large of a variation will there be between the images you are planning on manipulating?
After you have answered these questions I would compile some images that are similar to your use case and just try the different functions and adjust the variables to find the best solution for your use case. Many of the image manipulation functions through Evision are very flexible, which is great, but it leads to a lot of trial and error when it comes to understanding how they function and how to fine tune them to your needs.
Final Thoughts
My main conclusion is this: video manipulation does not have to be hard. There are openings to get started. I was not nor am I still an expert on video manipulation, but I was still able to build a motion tracking application with the right resources. My hope is that this blog will encourage others to start their journey into video manipulation in Elixir. Elixir has great potential as a language for video and image manipulation and I would love to see more people creating applications with it in the future. If you’re interested in learning about more about video manipulation techniques and are interested in buidling a motion tracking app checkout my talk:
Motion Commotion: Motion Tracking with Bumblebee and LiveView