diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index b881eff..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.analysis.autoImportCompletions": true -} \ No newline at end of file diff --git a/1/4.ipynb b/1/4.ipynb index 78f82d4..86bce9d 100644 --- a/1/4.ipynb +++ b/1/4.ipynb @@ -2,51 +2,27 @@ "cells": [ { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "hellohellohello\n" - ] - } - ], + "outputs": [], "source": [ "print(\"hello\" * 3)" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "x = 2, y = 3.000000\n" - ] - } - ], + "outputs": [], "source": [ "print(\"x = %d, y = %f\" % (2, 3.0))" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(2-3j)\n" - ] - } - ], + "outputs": [], "source": [ "x = 3 + 2j\n", "y = -1j\n", @@ -55,26 +31,9 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "abcdefg\n", - "bc\n", - "bcdefg\n", - "abc\n", - "abcdef\n", - "ef\n", - "efg\n", - "abcdefg\n", - "aceg\n", - "gfedcba\n" - ] - } - ], + "outputs": [], "source": [ "strs = \"abcdefg\"\n", "print(strs[0:7:1])\n", @@ -91,17 +50,9 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "较小值为: 5.7\n" - ] - } - ], + "outputs": [], "source": [ "def minimal(x, y):\n", " if x > y:\n", diff --git a/1/5.py b/1/5.py index 3b14152..89cf8d9 100644 --- a/1/5.py +++ b/1/5.py @@ -1,9 +1,9 @@ import cv2 -lenna = cv2.imread(r"img\Lenna.png") +lenna = cv2.imread(r"src.jpg") print(type(lenna)) cv2.namedWindow("Lena", cv2.WINDOW_AUTOSIZE) cv2.imshow("Lena", lenna) cv2.waitKey(0) cv2.destroyWindow("Lena") -cv2.imwrite(r"img\test_imwrite.png", lenna, (cv2.IMWRITE_PNG_COMPRESSION, 5)) +cv2.imwrite(r"1\imwrite.png", lenna, (cv2.IMWRITE_PNG_COMPRESSION, 5)) diff --git a/1/6.py b/1/6.py index bb83d43..7087944 100644 --- a/1/6.py +++ b/1/6.py @@ -3,7 +3,7 @@ import matplotlib.pyplot as plt plt.rcParams["font.family"] = ["SimHei"] plt.rcParams["axes.unicode_minus"] = False -img_BGR = cv2.imread(r"img\iris.jpg") +img_BGR = cv2.imread(r"src.jpg") img_RGB = cv2.cvtColor(img_BGR, cv2.COLOR_BGR2RGB) plt.imshow(img_RGB) plt.show() diff --git a/1/img/Lenna.png b/1/img/Lenna.png deleted file mode 100644 index 1538e24..0000000 Binary files a/1/img/Lenna.png and /dev/null differ diff --git a/1/img/iris.jpg b/1/img/iris.jpg deleted file mode 100644 index 847face..0000000 Binary files a/1/img/iris.jpg and /dev/null differ diff --git a/2/1.py b/2/1.py index d1ece85..b1b8b89 100644 --- a/2/1.py +++ b/2/1.py @@ -21,7 +21,7 @@ def histogram_equalization(im): if __name__ == "__main__": - im = cv.imread(r"E:\OneDrive\Code\Python\2\iris.jpg", cv.IMREAD_GRAYSCALE) + im = cv.imread(r"src.jpg", cv.IMREAD_GRAYSCALE) im1 = global_linear_transmation(im, 0, 150) im2 = global_linear_transmation(im, 100) im3 = global_linear_transmation(im, 50, 150) diff --git a/2/2.py b/2/2.py index aaa6c63..d26111b 100644 --- a/2/2.py +++ b/2/2.py @@ -10,7 +10,7 @@ def gamma_trans(img, gamma=1.0): if __name__ == "__main__": - im = cv.imread(r"E:\OneDrive\Code\Python\2\iris.jpg", cv.IMREAD_GRAYSCALE) + im = cv.imread(r"src.jpg", cv.IMREAD_GRAYSCALE) im1 = gamma_trans(im, 0.5) im2 = gamma_trans(im, 1.5) plt.figure() diff --git a/2/3.py b/2/3.py index cda9dc5..793fc78 100644 --- a/2/3.py +++ b/2/3.py @@ -2,7 +2,7 @@ import cv2 as cv from matplotlib import pyplot as plt import numpy as np -img = cv.imread(r"E:\OneDrive\Code\Python\2\iris.jpg", 0) +img = cv.imread(r"src.jpg", 0) fil1 = 1 / 16 * np.array([[1, 2, 1], [2, 4, 2], [1, 2, 1]]) fil2 = 1 / 9 * np.array([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) fil3 = 1 / 10 * np.array([[1, 1, 1], [1, 2, 1], [1, 1, 1]]) diff --git a/2/4.py b/2/4.py index e1e4e51..b9400ce 100644 --- a/2/4.py +++ b/2/4.py @@ -33,7 +33,7 @@ def addGaussianNoise(src, means, sigma): if __name__ == "__main__": - im = cv.imread(r"E:\OneDrive\Code\Python\2\iris.jpg", cv.IMREAD_GRAYSCALE) + im = cv.imread(r"src.jpg", cv.IMREAD_GRAYSCALE) im1 = addSaltAndPepper(im, 0.1) im11 = cv.blur(im1, (3, 3)) im12 = cv.medianBlur(im1, 3) diff --git a/2/5.py b/2/5.py index 816a171..9918d9b 100644 --- a/2/5.py +++ b/2/5.py @@ -2,7 +2,7 @@ import cv2 as cv from matplotlib import pyplot as plt import numpy as np -img = cv.imread(r"E:\OneDrive\Code\Python\2\iris.jpg", 0) +img = cv.imread(r"src.jpg", 0) lplc = np.array([[0, -1, 0], [-1, 4, -1], [0, -1, 0]]) lplcEnhance = np.array([[0, -1, 0], [-1, 5, -1], [0, -1, 0]]) ImgLplc = cv.filter2D(img, -1, lplc, borderType=cv.BORDER_DEFAULT) diff --git a/2/iris.jpg b/src.jpg similarity index 100% rename from 2/iris.jpg rename to src.jpg