Shining life with Python and OpenCV

First of all, the white image of the background

import numpy as np
import matplotlib.pyplot as plt
import cv2

# back groud
back = np.ones((512, 512, 3), np.uint8) * 255

download.png

Next life body

# red circle
cv2.circle(back, (80, 160), 53, (231, 0, 18), -1)
cv2.circle(back, (160, 186), 47, (231, 0, 18), -1)
cv2.circle(back, (162, 115), 47, (231, 0, 18), -1)
cv2.circle(back, (225, 60), 50, (231, 0, 18), -1)
cv2.circle(back, (330, 90), 65, (231, 0, 18), -1)
cv2.ellipse(back, (380, 170), (76, 36), 0, 0, 360, (231, 0, 18), -1)
cv2.ellipse(back, (370, 250), (45, 55), 0, 0, 360, (231, 0, 18), -1)
cv2.ellipse(back, (352, 350), (70, 65), 0, 0, 360, (231, 0, 18), -1)
cv2.circle(back, (262, 422), 66, (231, 0, 18), -1)
cv2.circle(back, (170, 408), 46, (231, 0, 18), -1)
cv2.ellipse(back, (128, 340), (30, 54), 0, 0, 360, (231, 0, 18), -1)
cv2.circle(back, (95, 258), 60, (231, 0, 18), -1)

plt.imshow(back)
plt.show();

download-1.png

Finally eyes!

# eyes
cv2.circle(back, (68, 152), 28, (255, 255, 255), -1)
cv2.circle(back, (56, 144), 13, (29, 143, 255), -1)

cv2.circle(back, (350, 70), 28, (255, 255, 255), -1)
cv2.circle(back, (360, 60), 13, (29, 143, 255), -1)

cv2.circle(back, (350, 70), 28, (255, 255, 255), -1)
cv2.circle(back, (360, 60), 13, (29, 143, 255), -1)

cv2.ellipse(back, (378, 355), (33, 30), 0, 0, 360, (255, 255, 255), -1)
cv2.circle(back, (392, 350), 15, (29, 143, 255), -1)

cv2.circle(back, (253, 442), 25, (255, 255, 255), -1)
cv2.circle(back, (253, 454), 10, (29, 143, 255), -1)

cv2.circle(back, (253, 442), 25, (255, 255, 255), -1)
cv2.circle(back, (253, 454), 10, (29, 143, 255), -1)

cv2.circle(back, (105, 275), 26, (255, 255, 255), -1)
cv2.circle(back, (103, 263), 12, (29, 143, 255), -1)

plt.imshow(back)
plt.show();

download-2.png

The birth of a wonderfully shining life! Celebration Osaka Expo: qiitan-cry:

Recommended Posts

Shining life with Python and OpenCV
Neural network with OpenCV 3 and Python 3
Capturing images with Pupil, python and OpenCV
Binarization with OpenCV / Python
Hello World and face detection with OpenCV 4.3 + Python
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
Feature matching with OpenCV 3 and Python 3 (A-KAZE, KNN)
Programming with Python and Tkinter
Encryption and decryption with Python
"Apple processing" with OpenCV3 + Python3
Python and hardware-Using RS232C with Python-
Image editing with python OpenCV
Camera capture with Python + OpenCV
[Python] Using OpenCV with Python (Basic)
Face detection with Python + OpenCV
python with pyenv and venv
Using OpenCV with Python @Mac
Works with Python and R
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
[Python] Webcam frame size and FPS settings with OpenCV
Reading, displaying and speeding up gifs with python [OpenCV]
Communicate with FX-5204PS with Python and PyUSB
Environment construction of python and opencv
Robot running with Arduino and python
Install Python 2.7.9 and Python 3.4.x with pip.
[Python] Using OpenCV with Python (Image Filtering)
AM modulation and demodulation with python
[Python] font family and font with matplotlib
Scraping with Node, Ruby and Python
[Python] Using OpenCV with Python (Image transformation)
Scraping with Python, Selenium and Chromedriver
[Python] Using OpenCV with Python (Edge Detection)
Scraping with Python and Beautiful Soup
JSON encoding and decoding with python
Hadoop introduction and MapReduce with Python
Easy Python + OpenCV programming with Canopy
[GUI with Python] PyQt5-Drag and drop-
Life game with Python! (Conway's Game of Life)
Reading and writing NetCDF with Python
Try face recognition with python + OpenCV
Cut out face with Python + OpenCV
Face recognition with camera with opencv3 + python2.7
I played with PyQt5 and Python3
Load gif images with Python + OpenCV
Reading and writing CSV with Python
Find image similarity with Python + OpenCV
Use OpenCV with Python 3 in Window
Multiple integrals with Python and Sympy
Convert video to black and white with ffmpeg + python + opencv
Draw an illustration with Python + OpenCV
Coexistence of Python2 and 3 with CircleCI (1.0)
Track baseball balls with Python + OpenCV
Easy modeling with Blender and Python
Graph Based Segmentation with Python + OpenCV
Draw shapes with OpenCV and PIL
Sugoroku game and addition game with python
FM modulation and demodulation with Python
Draw arrows (vectors) with opencv / python
Basic study of OpenCV with Python
Automatic image interpolation with OpenCV and Python (Fast Marching Method, Navier-Stokes)
Create a striped illusion with gamma correction for Python3 and openCV3