|
@@ -2,27 +2,26 @@
|
|
|
"cells": [
|
|
|
{
|
|
|
"cell_type": "code",
|
|
|
- "execution_count": 5,
|
|
|
+ "execution_count": 2,
|
|
|
"id": "96bd3881-21dd-4a8f-9843-24d70a350ed3",
|
|
|
"metadata": {},
|
|
|
"outputs": [
|
|
|
{
|
|
|
- "ename": "NameError",
|
|
|
- "evalue": "name 'img_array' is not defined",
|
|
|
- "output_type": "error",
|
|
|
- "traceback": [
|
|
|
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
|
|
- "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
|
|
|
- "Cell \u001b[1;32mIn[5], line 4\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mcv2\u001b[39;00m\n\u001b[0;32m 3\u001b[0m ing_array \u001b[38;5;241m=\u001b[39m[[[\u001b[38;5;241m0\u001b[39m,\u001b[38;5;241m225\u001b[39m,\u001b[38;5;241m0\u001b[39m,\u001b[38;5;241m128\u001b[39m]\u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m255\u001b[39m)]\u001b[38;5;28;01mfor\u001b[39;00m j \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m255\u001b[39m)]\n\u001b[1;32m----> 4\u001b[0m ing_numpy \u001b[38;5;241m=\u001b[39m numpy\u001b[38;5;241m.\u001b[39marray(\u001b[43mimg_array\u001b[49m)\n\u001b[0;32m 5\u001b[0m cv2\u001b[38;5;241m.\u001b[39mimwrite(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m1.jpg\u001b[39m\u001b[38;5;124m\"\u001b[39m,img_numpy)\n",
|
|
|
- "\u001b[1;31mNameError\u001b[0m: name 'img_array' is not defined"
|
|
|
- ]
|
|
|
+ "data": {
|
|
|
+ "text/plain": [
|
|
|
+ "True"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "execution_count": 2,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
}
|
|
|
],
|
|
|
"source": [
|
|
|
"import numpy\n",
|
|
|
"import cv2\n",
|
|
|
"img_array =[[[0,225,0,128]for i in range(255)]for j in range(255)]\n",
|
|
|
- "ing_numpy = numpy.array(img_array)\n",
|
|
|
+ "img_numpy = numpy.array(img_array)\n",
|
|
|
"cv2.imwrite(\"1.jpg\",img_numpy)"
|
|
|
]
|
|
|
},
|