1.安装Ubuntu
2.安装opencv和imutils
3.学习编写加载图片代码
# import the necessary packages
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)
效果:
1.图片信息:width=533, height=300, depth=3
2.显示图片:

4261

被折叠的 条评论
为什么被折叠?



