sxx 1 year ago
parent
commit
1555f186bb

+ 0 - 0
day1/ex01.py


BIN
day2/.ipynb_checkpoints/1-checkpoint.jpg


+ 186 - 2
day2/.ipynb_checkpoints/图像处理与图像特征-checkpoint.ipynb

@@ -1,6 +1,190 @@
 {
- "cells": [],
- "metadata": {},
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "id": "8ce3e644-50a0-479e-8d1d-41072fc8123b",
+   "metadata": {},
+   "source": [
+    "#1.图像与矩阵"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "b91b07f7-7bde-448d-9dec-17f27d6eaafb",
+   "metadata": {},
+   "source": [
+    "图像实际是一个矩阵\n",
+    "1.生成一个矩阵,二维数组\n",
+    "2.保存矩阵为图像文件"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "id": "bd6e505d-9a6c-49ad-b03b-2d4ee7db10dd",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "True"
+      ]
+     },
+     "execution_count": 2,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import numpy  #向量与矩阵运算库(线性代数运算库) 1.19.5\n",
+    "import cv2   #opencv.python opencv-contrib-python:图像处理\n",
+    "#生成数组\n",
+    "img_array=[[[0,255,0,128] for i in range(255)] for j in range(255)]#255*255的图像,图像的像素[0,255,0,128]\n",
+    "#cv2中只支持numpy的格式\n",
+    "img_numpy=numpy.array(img_array)\n",
+    "cv2.imwrite(\"1.jpg\",img_numpy)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "e74e265c-e673-42ec-a887-c3cb13509246",
+   "metadata": {},
+   "source": [
+    "True"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "390ef31f-57ea-4eb3-80f9-4b63fc932bee",
+   "metadata": {},
+   "source": [
+    "#2.图像的属性"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "2a26e2b4-8dbe-428a-9c41-f36e2ac355c6",
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "94d39f47-872f-4eed-b673-b02bf9fae067",
+   "metadata": {},
+   "source": [
+    "#3.图像的像素与通道"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "1698f235-801d-4a7b-bfbf-703f1e11d1c4",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "9576f712-1080-4900-a458-c931ddb544e8",
+   "metadata": {},
+   "source": [
+    "#4.图像操作"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "d28f0be9-fb94-45c9-aaba-2ea9a8cb86df",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "d5987f0e-ff31-49c8-8025-48716df1f8ca",
+   "metadata": {},
+   "source": [
+    "#5.图像的特征"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "64485006-1f38-45ee-b625-dec90ef62c6a",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "920864db-87e6-4834-bfb5-3a0f1129d86b",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "d2f548c6-5760-4043-a988-1f09e9a2fe41",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "4a488080-17c1-4fd4-812c-620804942de7",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "7f4edb11-12d5-4aaf-9a12-f802edfa4e2c",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "a09c764a-62d6-4f83-b28b-5bcef6ed18b6",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "f5d05496-574f-41ba-bb31-bdc92d04939c",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "37f193c9-8fdb-464a-b133-0c2c5b6a1175",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "b0dd834e-a2fa-47fb-96a1-2404201abd86",
+   "metadata": {},
+   "source": []
+  },
+  {
+   "cell_type": "markdown",
+   "id": "87578b41-3eff-4be3-ac9c-5c7f308061c6",
+   "metadata": {},
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3 (ipykernel)",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.9.13"
+  }
+ },
  "nbformat": 4,
  "nbformat_minor": 5
 }

BIN
day2/1.jpg


+ 0 - 0
day2/ex01.py


BIN
day2/gpu.bmp


BIN
day2/sea.jpg


File diff suppressed because it is too large
+ 65 - 17
day2/图像处理与图像特征.ipynb


Some files were not shown because too many files changed in this diff