라벨이 animation인 게시물 표시

Image Processing #10 - Zoom in animation

이미지
 I like to make various effects using OpenCV. If I knew how to use image processing programs such as video editing programs and Photoshop, I would probably have used these programs. But I am a programmer and I can hardly use these programs. So I enjoy using OpenCV to implement the effects I want. Zoom in Suppose you want to zoom in to a specific area in the original high-resolution image as shown below.   The final image area is marked with a box. And the display will use images of this box size. If you zoom in while maintaining the original resolution of image, the resolution will be much lower because you will need to zoom in on the gradually smaller image. This method is also possible, but I don't want the image resolution to be lowered. So at first, we will start zooming in by reducing the original image to the size of the box image. During zoom-in, the size of the image will gradually become similar to the size of the box, and the final image will be the box image. T...

Animation #3 - Make snowing gif animation using OpenCV, PIL

이미지
The method of making gif animation is omitted because it was explained earlier. In this post, we use the random module to create a random number of snow particles and then shake them to the ground over time. Unlike the previous post, there is no image to prepare in advance. Create snowing animation import cv2 import numpy as np from PIL import Image from PIL import ImageDraw import time , os import argparse from random import * parser = argparse . ArgumentParser(description = "OpenCV Example" ) parser . add_argument( "--maxcnt" , default = 5 , type = int, help = "X axis snow max count" ) parser . add_argument( "--mincnt" , default = 1 , type = int, help = "X axis snow min count" ) parser . add_argument( "--size" , default = 5 , type = int, help = "snowball size(diameter)" ) args = parser . parse_args() count = 0 FPS = 5 SLEEP = 2.0 / FPS height = ...

Animation #2 - Make gif animation using OpenCV, PIL

이미지
In a previous post, you learned how to create simple animations using OpenCV and numpy. In this post, I'll show you how to create animations that move your eyes and save them as gif files. Prepare the following images in advance. These files can be downloaded from the following repo: https://github.com/raspberry-pi-maker/OpenCV The animation loops indefinitely, but in the first loop we made a gif file. The thing to watch for is moving the pupil image to the count1.bmp image. Masking function process_masking is a function often used in the previous example. However, this function has changed slightly from the previous one.The reason for this is that when the pupil moves out of the eye region, it should not be drawn. The previous masking function does not have this feature.  <Result of using original masking function> Therefore, in order to avoid drawing pupils outside the eye area, the image background color and masking process must be done once again. The bold ...