{ "cells": [ { "cell_type": "markdown", "id": "6aaaa7eb-8f89-4824-b62e-d59861bf289d", "metadata": {}, "source": [ "#1.图像与矩阵" ] }, { "cell_type": "markdown", "id": "833e9956-f6a5-4f50-98e8-0a5a3f44db64", "metadata": {}, "source": [ "import numpy \n", "import cv2\n", "# 生成数组\n", "img_array=[[[0,255,255,50]for i in range(255)]for j in range(255)]#255*255的图像,[0,255,0,128]\n", "img_numpy=numpy.array(img_array)\n", "cv2.imwrite(\"1.jpg\",img_numpy)" ] }, { "cell_type": "markdown", "id": "5b183b6f-732a-469f-82d9-ef8ca56acc8c", "metadata": {}, "source": [] }, { "cell_type": "code", "execution_count": null, "id": "caefe276-90b4-4bfa-9125-89dd831956d7", "metadata": {}, "outputs": [], "source": [ "2.图像的属性" ] }, { "cell_type": "code", "execution_count": null, "id": "777a90e0-773d-4a35-9e03-74ebce15a21f", "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "3.图像的像素和通道" ] }, { "cell_type": "code", "execution_count": null, "id": "710896c5-c6cf-4a4e-b54a-7a7ea9be37bc", "metadata": {}, "outputs": [], "source": [ "4.图像操作" ] } ], "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 }