diff --git a/.ipynb_checkpoints/openCV_scanner-checkpoint.ipynb b/.ipynb_checkpoints/openCV_scanner-checkpoint.ipynb index 26bf1613995e5fa06b73d9ca31915aa6c476f5e8..4353fe03423a6547caf9629f55b6d995015bc8d1 100644 --- a/.ipynb_checkpoints/openCV_scanner-checkpoint.ipynb +++ b/.ipynb_checkpoints/openCV_scanner-checkpoint.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 42, "metadata": { "scrolled": true }, @@ -17,13 +17,12 @@ "from PIL import ImageTk\n", "import os\n", "from fpdf import FPDF\n", - "from PIL import Image\n", - "import os" + "from PIL import Image" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ @@ -40,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 44, "metadata": {}, "outputs": [], "source": [ @@ -82,7 +81,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 45, "metadata": {}, "outputs": [], "source": [ @@ -105,7 +104,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ @@ -147,7 +146,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 47, "metadata": {}, "outputs": [], "source": [ @@ -184,7 +183,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 48, "metadata": {}, "outputs": [], "source": [ @@ -215,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 49, "metadata": {}, "outputs": [], "source": [ @@ -234,7 +233,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 50, "metadata": {}, "outputs": [], "source": [ @@ -311,7 +310,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 51, "metadata": {}, "outputs": [], "source": [ @@ -343,7 +342,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 52, "metadata": {}, "outputs": [], "source": [ @@ -383,7 +382,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 53, "metadata": {}, "outputs": [], "source": [ @@ -408,7 +407,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 54, "metadata": { "scrolled": true }, @@ -417,15 +416,23 @@ "name": "stdout", "output_type": "stream", "text": [ + "./modified/bookcover.jpg\n", "./modified/example.jpg\n", + "./modified/example2.jpg\n", + "./modified/example3.jpg\n", "./modified/example4.jpg\n", + "./modified/framework1821.jpg\n", + "./modified/receipt.jpg\n", + "./modified/tilted_document.jpg\n", "PDF generated successfully!\n" ] } ], "source": [ "mouse_is_pressing = False\n", - "image_path = './images/'\n", + "__file__ = 'openCV_scanner.ipynb'\n", + "root = os.path.dirname(os.path.abspath(__file__))\n", + "image_path = root +'/images/'\n", "if not os.path.isdir(image_path): \n", " os.mkdir(image_path)\n", "\n", @@ -461,9 +468,8 @@ " win.resizable(False, False)\n", " lbl = tk.Label(win, text=\"마우스 입력 O/X?\")\n", " lbl.pack()\n", - " \n", " ## contour 이미지 파일을 저장하기. 폴더가 없을경우 폴더를 만듬\n", - " contour_path = './contour/'\n", + " contour_path = root +'/contour/'\n", " if not os.path.isdir(contour_path): \n", " os.mkdir(contour_path)\n", " \n", @@ -474,7 +480,7 @@ " label.pack()\n", "\n", " ## 최종 수정된 이미지를 저장하기. 폴더가 없을경우 폴더 생성\n", - " modified_path = './modified/'\n", + " modified_path = root+'/modified/'\n", " if not os.path.isdir(modified_path): \n", " os.mkdir(modified_path)\n", " \n", diff --git a/Open_CV PPT.pdf b/Open_CV PPT.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a68123306da1b5e8568bd16d71ed65fd3a2c7a83 Binary files /dev/null and b/Open_CV PPT.pdf differ diff --git a/Open_CV report.hwp b/Open_CV report.hwp index b8c9c004a5c001e2402f3ea0ecc0bbaa931ae9bf..6ef42e98b958635e97fcbd82886fa1fb1abb2db6 100644 Binary files a/Open_CV report.hwp and b/Open_CV report.hwp differ diff --git a/Open_CV report.pdf b/Open_CV report.pdf new file mode 100644 index 0000000000000000000000000000000000000000..080dab95af0838341d3f97ee46cfd2ac5fba796c Binary files /dev/null and b/Open_CV report.pdf differ diff --git a/contour/bookcover.jpg b/contour/bookcover.jpg deleted file mode 100644 index c4cc4c2e4cc068588404352a3f4551b5b42c8888..0000000000000000000000000000000000000000 Binary files a/contour/bookcover.jpg and /dev/null differ diff --git a/contour/example.jpg b/contour/example.jpg deleted file mode 100644 index cd601f4593715aa11819a0ca14b60f2980e99631..0000000000000000000000000000000000000000 Binary files a/contour/example.jpg and /dev/null differ diff --git a/contour/example2.jpg b/contour/example2.jpg deleted file mode 100644 index 5b54d82ca789f532a9fbb50a5f1361c189619f29..0000000000000000000000000000000000000000 Binary files a/contour/example2.jpg and /dev/null differ diff --git a/contour/example3.jpg b/contour/example3.jpg deleted file mode 100644 index 1144233d0bdef507f1ec10947369f102a2911446..0000000000000000000000000000000000000000 Binary files a/contour/example3.jpg and /dev/null differ diff --git a/contour/example4.jpg b/contour/example4.jpg deleted file mode 100644 index 25624cb67d75d44cfbdb1ff370786d0baeef957e..0000000000000000000000000000000000000000 Binary files a/contour/example4.jpg and /dev/null differ diff --git a/contour/framework1821.jpg b/contour/framework1821.jpg deleted file mode 100644 index bbea9218a9409d02fd2778bc738040915569203f..0000000000000000000000000000000000000000 Binary files a/contour/framework1821.jpg and /dev/null differ diff --git a/contour/receipt.jpg b/contour/receipt.jpg deleted file mode 100644 index 3367d6be2665d676770771402ab631654da9e75c..0000000000000000000000000000000000000000 Binary files a/contour/receipt.jpg and /dev/null differ diff --git a/contour/tilted_document.jpg b/contour/tilted_document.jpg deleted file mode 100644 index d492d9c1d8d163e46eeebc48bf8c854b65f2252f..0000000000000000000000000000000000000000 Binary files a/contour/tilted_document.jpg and /dev/null differ diff --git a/images/example3.jpg b/images/example3.jpg deleted file mode 100644 index 98f8959a3e5ae6493432b82e01d222669774cf58..0000000000000000000000000000000000000000 Binary files a/images/example3.jpg and /dev/null differ diff --git a/modified/example3.jpg b/modified/example3.jpg deleted file mode 100644 index f4bd39bab51debd28fbd4ec146d86023e1231b5a..0000000000000000000000000000000000000000 Binary files a/modified/example3.jpg and /dev/null differ diff --git a/modified/framework1821.jpg b/modified/framework1821.jpg index d5154501bfd76db9c9be3ed975f5e7919b60bec8..33b3d0c88a60aaafd844b43cc843dcb664f32ded 100644 Binary files a/modified/framework1821.jpg and b/modified/framework1821.jpg differ diff --git a/modified/image_list.pdf b/modified/image_list.pdf index ac4620c346cccfb25b2552285acd1d955c4c8903..30db50497c72839c5ae906fad377308ba8d61fc4 100644 Binary files a/modified/image_list.pdf and b/modified/image_list.pdf differ diff --git a/openCV_scanner.ipynb b/openCV_scanner.ipynb index 3531fe9516123258a18806f60edd1e4f6bc3dedf..a57a3a4912c2c93c2ecd297a3f98d96f7408cd15 100644 --- a/openCV_scanner.ipynb +++ b/openCV_scanner.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 29, + "execution_count": 69, "metadata": { "scrolled": true }, @@ -17,13 +17,12 @@ "from PIL import ImageTk\n", "import os\n", "from fpdf import FPDF\n", - "from PIL import Image\n", - "import os" + "from PIL import Image" ] }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 70, "metadata": {}, "outputs": [], "source": [ @@ -40,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 71, "metadata": {}, "outputs": [], "source": [ @@ -82,7 +81,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 72, "metadata": {}, "outputs": [], "source": [ @@ -105,7 +104,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 73, "metadata": {}, "outputs": [], "source": [ @@ -147,7 +146,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 74, "metadata": {}, "outputs": [], "source": [ @@ -184,7 +183,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 75, "metadata": {}, "outputs": [], "source": [ @@ -215,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 76, "metadata": {}, "outputs": [], "source": [ @@ -234,7 +233,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 77, "metadata": {}, "outputs": [], "source": [ @@ -311,7 +310,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 78, "metadata": {}, "outputs": [], "source": [ @@ -343,7 +342,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 79, "metadata": {}, "outputs": [], "source": [ @@ -383,7 +382,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 80, "metadata": {}, "outputs": [], "source": [ @@ -408,14 +407,36 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 81, "metadata": { "scrolled": true }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "./modified/bookcover.jpg\n", + "./modified/example.jpg\n", + "./modified/example2.jpg\n", + "./modified/example3.jpg\n", + "./modified/example4.jpg\n", + "./modified/framework1821.jpg\n", + "./modified/receipt.jpg\n", + "./modified/tilted_document.jpg\n", + "PDF generated successfully!\n" + ] + } + ], "source": [ "mouse_is_pressing = False\n", - "image_path = './images/'\n", + "\n", + "__file__ = 'openCV_scanner.ipynb'\n", + "root = os.path.dirname(os.path.abspath(__file__))\n", + "image_path = root +'/images/'\n", + "modified_path = root+'/modified/'\n", + "contour_path = root +'/contour/'\n", + "\n", "if not os.path.isdir(image_path): \n", " os.mkdir(image_path)\n", "\n", @@ -451,9 +472,7 @@ " win.resizable(False, False)\n", " lbl = tk.Label(win, text=\"마우스 입력 O/X?\")\n", " lbl.pack()\n", - " \n", " ## contour 이미지 파일을 저장하기. 폴더가 없을경우 폴더를 만듬\n", - " contour_path = './contour/'\n", " if not os.path.isdir(contour_path): \n", " os.mkdir(contour_path)\n", " \n", @@ -464,7 +483,6 @@ " label.pack()\n", "\n", " ## 최종 수정된 이미지를 저장하기. 폴더가 없을경우 폴더 생성\n", - " modified_path = './modified/'\n", " if not os.path.isdir(modified_path): \n", " os.mkdir(modified_path)\n", " \n",