{"id":6520,"date":"2019-03-26T08:01:54","date_gmt":"2019-03-25T23:01:54","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=6520"},"modified":"2020-05-28T12:33:45","modified_gmt":"2020-05-28T03:33:45","slug":"python%ea%b3%bc-opencv-11-%ec%9d%b4%eb%af%b8%ec%a7%80%eb%a5%bc-%eb%b6%80%eb%93%9c%eb%9f%bd%ea%b2%8c-%eb%a7%8c%eb%93%a4%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=6520","title":{"rendered":"Python\uacfc OpenCV \u2013 11 : \uc774\ubbf8\uc9c0\ub97c \ubd80\ub4dc\ub7fd\uac8c \ub9cc\ub4e4\uae30"},"content":{"rendered":"<p>\uc774 \uae00\uc758 \uc6d0\ubb38\uc740 https:\/\/opencv-python-tutroals.readthedocs.io\/en\/latest\/py_tutorials\/py_imgproc\/py_filtering\/py_filtering.html#filtering \uc785\ub2c8\ub2e4.<\/p>\n<p>OpenCV\ub97c \uc774\uc6a9\ud574 \ub2e4\uc591\ud55c \uc800\uc8fc\ud30c \ud544\ud130(Low-pass filter)\ub97c \uc774\uc6a9\ud574 \uc774\ubbf8\uc9c0\ub97c \ubd80\ub4dc\ub7fd\uac8c, \uc989 \ube14\ub7ec\ub9c1(Bluring) \ucc98\ub9ac\ub97c \ud558\ub294 \ub0b4\uc6a9\uc785\ub2c8\ub2e4.<\/p>\n<p>2D Convolution, \uac19\uc740 \uc758\ubbf8\ub85c\uc368 \uc774\ubbf8\uc9c0 \ud544\ud130\ub9c1(Filtering)\uc740 \uace0\uc8fc\ud30c, \ub610\ub294 \uc800\uc8fc\ud30c \ud544\ud130\ub97c \uc774\uc6a9\ud574 \uc774\ubbf8\uc9c0\ub97c \ucc98\ub9ac\ud558\ub294 \uac83\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4. \uc5ec\uae30\uc11c \ud544\ud130\ub294 \uc608\ub97c\ub4e4\uc5b4 \uc544\ub798\uc640 \uac19\uc740 \ud589\ub82c\uc785\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2019\/03\/220e403e44b16ea8e05d350c4ce69e9aedff5bd1.png\" alt=\"\" width=\"190\" height=\"111\" class=\"aligncenter size-full wp-image-6521\" \/><\/p>\n<p>\uc704\uc758 \ud544\ud130\uac00 \uc774\ubbf8\uc9c0\uc758 \uac01 \ud53d\uc140\uc744 \uc21c\ud68c\ud558\uba74\uc11c \ud574\ub2f9 \ud53d\uc140 \uc8fc\uc704\uc758 \ud53d\uc140\ub4e4\uc640 \uacf1\ud574\uc838 \ub354\ud574\uc9d1\ub2c8\ub2e4. \uc704\uc758 \ud544\ud130\uc5d0 \ub300\ud55c \uc774\ubbf8\uc9c0 \ud544\ud130\ub9c1\uc5d0 \ub300\ud55c \uc608\uc81c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport cv2\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\nimg = cv2.imread('.\/data\/opencv_logo.png')\r\n\r\nkernel = np.ones((5,5), np.float32) \/ 25\r\ndst = cv2.filter2D(img, -1, kernel)\r\n\r\nplt.subplot(121),plt.imshow(img),plt.title('Original')\r\nplt.xticks([]), plt.yticks([])\r\nplt.subplot(122),plt.imshow(dst),plt.title('Averaging')\r\nplt.xticks([]), plt.yticks([])\r\nplt.show()\r\n<\/pre>\n<p>\uc704\uc758 7\ubc88 \ucf54\ub4dc\uac00 \uc55e\uc758 \ud544\ud130 \ud589\ub82c\uc744 \uc0dd\uc131\ud558\uace0 \uc788\uace0 8\ubc88\ucf54\ub4dc\uc758 cv2.filter2D \ud568\uc218\uac00 \uc774\ubbf8\uc9c0\uc5d0 \ub300\ud574 \ud574\ub2f9 \ud544\ud130\ub97c \uc801\uc6a9\ud558\uc5ec \uadf8 \uacb0\uacfc \uc774\ubbf8\uc9c0\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4. \uc2e4\ud589 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2019\/03\/opencv_filter2d.png\" alt=\"\" width=\"1444\" height=\"1228\" class=\"aligncenter size-full wp-image-6525\" \/><\/p>\n<p>\ub2e4\uc2dc \uc774\uae00\uc758 \uc8fc\uc81c\ub85c \ub3cc\uc544\uc640\uc11c \uc774\ubbf8\uc9c0\ub97c \ubd80\ub4dc\ub7fd\uac8c \ucc98\ub9ac\ud558\ub294 LPF\ub85c\uc368 OpenCV\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 4\uac00\uc9c0 \ud544\ud130\ub97c \uc815\ub9ac\ud569\ub2c8\ub2e4. \uba3c\uc800 \ud3c9\uade0 \ud544\ud130\uc778\ub370, \uc774\ub294 \uc774\ubbf8 \uc55e\uc758 \uc608\uc81c \ucf54\ub4dc\uc640 \ub3d9\uc77c\ud558\uba70 \ub2e4\uc74c\uacfc \uac19\uc740 \ucf54\ub4dc \uc5ed\uc2dc \ub3d9\uc77c\ud55c \uacb0\uacfc\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport cv2\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\nimg = cv2.imread('.\/data\/opencv_logo.png')\r\n\r\nblur = cv2.blur(img,(5,5))\r\n\r\nplt.subplot(121),plt.imshow(img),plt.title('Original')\r\nplt.xticks([]), plt.yticks([])\r\nplt.subplot(122),plt.imshow(blur),plt.title('Blurred')\r\nplt.xticks([]), plt.yticks([])\r\nplt.show()\r\n<\/pre>\n<p>\ub2e4\uc74c\uc740 \uac00\uc6b0\uc2dc\uc548 \ud544\ud130\ub9c1(Gaussian Filtering)\uc5d0 \ub300\ud55c \uc608\uc81c\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport cv2\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\nimg = cv2.imread('.\/data\/opencv_logo.png')\r\n\r\nblur = cv2.GaussianBlur(img,(5,5),0)\r\n\r\nplt.subplot(121),plt.imshow(img),plt.title('Original')\r\nplt.xticks([]), plt.yticks([])\r\nplt.subplot(122),plt.imshow(blur),plt.title('Blurred')\r\nplt.xticks([]), plt.yticks([])\r\nplt.show()\r\n<\/pre>\n<p>\ub2e4\uc74c\uc740 Median Filtering\uc5d0 \ub300\ud55c \uc608\uc81c\uc778\ub370, \uc774 \ud544\ud130\ub294 \uc7a1\uc74c \uc81c\uac70 \ud6a8\uacfc\uac00 \ub6f0\uc5b4\ub0a9\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport cv2\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\nimg = cv2.imread('.\/data\/opencv_logo.png')\r\n\r\nblur = cv2.medianBlur(img,5)\r\n#\r\nplt.subplot(121),plt.imshow(img),plt.title('Original')\r\nplt.xticks([]), plt.yticks([])\r\nplt.subplot(122),plt.imshow(blur),plt.title('Blurred')\r\nplt.xticks([]), plt.yticks([])\r\nplt.show()\r\n<\/pre>\n<p>\ub2e4\uc74c\uc740 Bilateral Filtering\uc774\uba70 \uc7a1\uc74c \uc81c\uac70 \ud6a8\uacfc\uac00 \uc88b\uc73c\uba74\uc11c, \uac00\uc7a5\uc790\ub9ac\ub97c \ubcf4\uc874\ud558\ub294\ub370 \ud6a8\uacfc\uc801\uc785\ub2c8\ub2e4. \ub2e8, \uc18d\ub3c4\uac00 \ub290\ub9ac\ub2e4\ub294 \ub2e8\uc810\uc774 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport cv2\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\nimg = cv2.imread('.\/data\/opencv_logo.png')\r\n\r\nblur = cv2.bilateralFilter(img,9,75,75)\r\n\r\nplt.subplot(121),plt.imshow(img),plt.title('Original')\r\nplt.xticks([]), plt.yticks([])\r\nplt.subplot(122),plt.imshow(blur),plt.title('Blurred')\r\nplt.xticks([]), plt.yticks([])\r\nplt.show()\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uc774 \uae00\uc758 \uc6d0\ubb38\uc740 https:\/\/opencv-python-tutroals.readthedocs.io\/en\/latest\/py_tutorials\/py_imgproc\/py_filtering\/py_filtering.html#filtering \uc785\ub2c8\ub2e4. OpenCV\ub97c \uc774\uc6a9\ud574 \ub2e4\uc591\ud55c \uc800\uc8fc\ud30c \ud544\ud130(Low-pass filter)\ub97c \uc774\uc6a9\ud574 \uc774\ubbf8\uc9c0\ub97c \ubd80\ub4dc\ub7fd\uac8c, \uc989 \ube14\ub7ec\ub9c1(Bluring) \ucc98\ub9ac\ub97c \ud558\ub294 \ub0b4\uc6a9\uc785\ub2c8\ub2e4. 2D Convolution, \uac19\uc740 \uc758\ubbf8\ub85c\uc368 \uc774\ubbf8\uc9c0 \ud544\ud130\ub9c1(Filtering)\uc740 \uace0\uc8fc\ud30c, \ub610\ub294 \uc800\uc8fc\ud30c \ud544\ud130\ub97c \uc774\uc6a9\ud574 \uc774\ubbf8\uc9c0\ub97c \ucc98\ub9ac\ud558\ub294 \uac83\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4. \uc5ec\uae30\uc11c \ud544\ud130\ub294 \uc608\ub97c\ub4e4\uc5b4 \uc544\ub798\uc640 \uac19\uc740 \ud589\ub82c\uc785\ub2c8\ub2e4. \uc704\uc758 \ud544\ud130\uac00 \uc774\ubbf8\uc9c0\uc758 \uac01 \ud53d\uc140\uc744 \uc21c\ud68c\ud558\uba74\uc11c \ud574\ub2f9 \ud53d\uc140 \uc8fc\uc704\uc758 \ud53d\uc140\ub4e4\uc640 \uacf1\ud574\uc838 \ub354\ud574\uc9d1\ub2c8\ub2e4. \uc704\uc758 \ud544\ud130\uc5d0 \ub300\ud55c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=6520\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;Python\uacfc OpenCV \u2013 11 : \uc774\ubbf8\uc9c0\ub97c \ubd80\ub4dc\ub7fd\uac8c \ub9cc\ub4e4\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[130,131],"tags":[],"class_list":["post-6520","post","type-post","status-publish","format-standard","hentry","category-opencv","category-python"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/6520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6520"}],"version-history":[{"count":7,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/6520\/revisions"}],"predecessor-version":[{"id":9476,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/6520\/revisions\/9476"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6520"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}