Learn practical skills, build real-world projects, and advance your career
import imutils
import cv2
 
# load the input image and show its dimensions, keeping in mind that
# images are represented as a multi-dimensional NumPy array with
# shape no. rows (height) x no. columns (width) x no. channels (depth)
image = cv2.imread("jp.png")
(h, w, d) = image.shape
print("width={}, height={}, depth={}".format(w, h, d))
 
# display the image to our screen -- we will need to click the window
# open by OpenCV and press a key on our keyboard to continue execution
cv2.imshow("Image", image)
cv2.waitKey(0)
width=600, height=322, depth=3
-1
import numpy as np
d = np.arange(1, 10, 2)
print('Numpy array using arange() :\n{}'.format(d))
Numpy array using arange() : [1 3 5 7 9]
a = np.linspace(1,10,5)
print('line space : \n{}'.format(a))
line space : [ 1. 3.25 5.5 7.75 10. ]
s = np.random.randint(10 , 30 , 8) # 8 values between 10 and 30 , 30 excluded
print('random integer : \n{}'.format(s))
random integer : [29 16 13 18 23 14 25 27]
print(np.__version__)
1.17.4