{ "cells": [ { "cell_type": "markdown", "id": "5cc5d4bb-cee6-440c-9ab5-d515d264ae59", "metadata": {}, "source": [ "## 1.关于图像特征\n", ">1.统计特征\n", ">2.数学特征(奇异值分解)\n", ">3.卷积特征" ] }, { "cell_type": "markdown", "id": "7e2ab7e5-9636-4c42-9169-e9c999cbf205", "metadata": {}, "source": [ "2.卷积特征" ] }, { "cell_type": "code", "execution_count": 4, "id": "3b5b55d1-b2b6-4ab6-aaff-b41807da2ea4", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import cv2\n", "import numpy as up\n", "#import malplotlib.pyplot as plt\n", "\n", "#读取图片:大矩阵\n", "img = cv2.imread(\"gpu.bmp\")\n", "img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)\n", "#准备小矩阵:算子\n", "img_sobel = cv2.Sobel(\n", " img, \n", " -1,\n", " 1,#一阶微分\n", " 1,\n", " ksize=3,\n", " scale=1.0,\n", " delta=50.0\n", ")\n", " \n", "#显示\n", "#plt.inshow(img_sobel)\n", "cv2.imwrite(\"3.jpg\", img_sobel)" ] }, { "cell_type": "code", "execution_count": null, "id": "dc03a5ea-4b5b-4cac-9db3-cb09fcd7886a", "metadata": {}, "outputs": [], "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 }