Animation #1 - Simple animation using numpy
Yesterday, I wrote a blog post on rotating an image with OpenCV . I will explain how to create a simple animation using the rotate and pan functions of an image. I hope this learning will give you a deeper opportunity to learn more about OpenCV and numpy. Basic concept Add an overlay image to the right of the canvas image. As time goes, rotate the overlay image and move it to the left. You need a bit of math knowledge to create natural animations. Angular Velocity Angular velocity refers to how fast an object rotates or revolves relative to another point, i.e. how fast the angular position or orientation of an object changes with time. I'm going to make an 30 FPS(frame per second) animation. Thus, the time per frame is 1/30 seconds (0.0333). If it takes 2 seconds to rotate the image 360 degrees, the angular velocity is π (radian)/sec. Thus, the angle traveled for 1/30 second is π (radian) / 30, and the distance that the circle rolled is R x π (radian) / 30....