Reputation: 8746
I am aware of how to add text / image overlay into a video on iOS with AVFoundation.
Is there some way to do this using position/motion tracking of certain objects / areas in the video?
What exactly is this type of video editing feature called?
Let's say I have a video of a car moving from left to right. I want to place an image of another car at the position of the original car so that as the car in the video is moving from left to right, my image follows on top of that car. I would also want this to be properly skewed as the car moves from left to right.
Another example would be a video of a monitor. And me placing an image on the screen of that monitor.
Please let me know if I need to explain further.
Other than iOS is there some other library which is able to do this? Like ffmpeg?
Upvotes: 0
Views: 580
Reputation: 2505
What you're broadly looking for is Object Recognition, which is a fairly complex topic in it's own right and part of the field of Computer Vision.
AVFoundation includes support for Face Detection and does a fairly reasonable job of it https://developer.apple.com/reference/avfoundation/avmetadatafaceobject but that's about it.
To do what you're trying to do, I'd start with OpenCV (which includes support for iOS) and investigate from there http://opencv.org/
You're not going to find a literal "find me a car" API, what you will find is lots of different algorithms which are implemented that allow you to train them and detect the objects they are trained for. One potential algorithm is using Haar Cascades. There's more detail on working with those and training your own classifier here https://github.com/andrewssobral/vehicle_detection_haarcascades
Upvotes: 1