파이썬과 OpenCV로 생명을 빛내라.

19360 단어 파이썬OpenCV

우선 배경의 흰색 이미지


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

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

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



다음 생명 본체


# 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();



마지막으로 눈!


# 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();



훌륭하게 빛나는 생명의 탄생입니다! 축 오사카 박람회

추가 (2021/09/27)



프로야구 데이터 시각화 사이트 을 만들었습니다. 아직 퀄리티는 낮습니다만, 향후 조금씩 버전 업시켜 나갈 예정입니다. 야구를 좋아하는 분은 꼭 놀러와주세요 ⚾️

좋은 웹페이지 즐겨찾기