|
@@ -114,12 +114,30 @@
|
|
|
},
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": null,
|
|
|
+ "execution_count": 24,
|
|
|
"id": "9e93da9e-6b85-4483-919e-b1d3a89bb2b7",
|
|
|
"metadata": {},
|
|
|
- "outputs": [],
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "ename": "SyntaxError",
|
|
|
+ "evalue": "invalid syntax (781746806.py, line 2)",
|
|
|
+ "output_type": "error",
|
|
|
+ "traceback": [
|
|
|
+ "\u001b[1;36m Cell \u001b[1;32mIn[24], line 2\u001b[1;36m\u001b[0m\n\u001b[1;33m import = cv2.imread(\"gpu.bmp)\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
"source": [
|
|
|
- "#打开"
|
|
|
+ "#打开\n",
|
|
|
+ "import = cv2.imread(\"gpu.bmp)\n",
|
|
|
+ "\n",
|
|
|
+ "print(img.shape) # 维度\n",
|
|
|
+ "print(img.ndim) # 维数\n",
|
|
|
+ "print(img.size) # 数组元素个数 = 数组元素字节数 / 每个像素的字节数\n",
|
|
|
+ "print(img.itemsize) # 每个像素的字节数\n",
|
|
|
+ "print(img.nbytes) # 数组元素字节数\n",
|
|
|
+ "\n",
|
|
|
+ "print(img.shape[0] * img.shape[1] * img.shape[2]) # 数组元素字节数"
|
|
|
]
|
|
|
},
|
|
|
{
|