LoginSignup
2
1

More than 3 years have passed since last update.

いのちの輝きくんの目を回してみる。

Posted at

はじめに

Pythonでいのちを輝かせるという記事(下記にリンクがあります。)があり、
どうしても目を回してみたくなりました。
参考記事の「いのちを輝かせる」画像をベースに、円座標を計算して、目を回した画像を作成し、
OpenCVを用いて動画作成と出力を行いました。

円座標の計算

def get_coordinates(center_x: int, center_y: int, rotate_val: int, speed: int):
    radius = 10
    theta = (rotate_val / speed) * 2 * np.pi
    x = center_x + int(radius * np.sin(theta))
    y = center_y + int(radius * np.cos(theta))
    return x, y

目を回した結果

ソースコード

参考記事

PythonとOpenCVでいのちを輝かせる
https://qiita.com/Takayoshi_Makabe/items/07e4553362fc14d7ddb1

Pythonでグラフのアニメを作る(OpenCVでmp4ファイルを出力編)
https://water2litter.net/rum/post/python_matplotlib_anime_opencv/

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1