Creating OpenCv Logo with OpenCv
OpenCV logo¶
In [177]:
from matplotlib import pyplot as plt
%matplotlib inline
In [178]:
import cv2
In [179]:
# Load an color image in grayscale
ocvimg = cv2.imread('opencv-logo-white.png',1)
plt.imshow(ocvimg)
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.show()
In [180]:
import numpy as np
# Create a black image
img = np.zeros((512,522,3), np.uint8)
In [181]:
img = cv2.ellipse(img,(256,100),(98,98),60,60,360,255,-1)
plt.imshow(img)
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.show()
In [182]:
img = cv2.circle(img,(256,100), 50, (0,0,0), -1)
plt.imshow(img)
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.show()
In [183]:
img = cv2.ellipse(img,(136,300),(98,98),300,60,360,(0,255,0),-1)
img = cv2.circle(img,(136,300), 50, (0,0,0), -1)
img = cv2.ellipse(img,(376,300),(98,98),240,60,360,(0,0,255),-1)
img = cv2.circle(img,(376,300), 50, (0,0,0), -1)
plt.imshow(img)
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.show()
In [184]:
font = cv2.FONT_HERSHEY_SIMPLEX
font = cv2.FONT_HERSHEY_TRIPLEX
cv2.putText(img,'OpenCV',(10,500), font, 4,(255,255,255),2,cv2.LINE_AA)
plt.imshow(img)
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.show()
In [ ]:
In [ ]:
In [ ]:
In [ ]:
Comments
Post a Comment