๋ชฉ๋ก๋ถ๋ฅ ์ ์ฒด๋ณด๊ธฐ (1005)
๐ ๊ณต๋ถํ๋ ์ง์ง์ํ์นด๋ ์ฒ์์ด์ง?
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/NAK3j/btsCQoPjJnP/a9lk2yek7I3GlmHxOaFgU0/img.png)
๐ channle ๋ณ ํ๋ ฌ ๋ฐ์ดํฐ ๊ตฌ์กฐ ๐ ์ ๋ ฅ ์์์ ๊ธฐ์ค์ผ๋ก ๋ฐ๋ณต ์คํ def scale_nogood(img, scale_x=1, scale_y=1): height, width = img.shape img_ = np.zeros((int(height*scale_y), int(width*scale_x)), dtype=np.uint8) for y in range(height): for x in range(width): try: img_[int(y*scale_y), int(x*scale_x)] = img[y, x] except: pass return img_ import cv2 import numpy as np img = cv2.imread("images/lena.jpg", cv2.IMREAD_GRAYSCA..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dD99Vc/btsCLr0zEZG/qkKchusu1Ubc2BK2klPZ50/img.png)
๐ ํ์คํ ๊ทธ๋จ by. cv2 ์ ํ์คํ ๊ทธ๋จ ๋ณด๋๊น 0์ ๊ทผ์ ํ ์๊ฐ ๋ง์ ๊ฑธ ๋ณด์ ์ด๋์ด ๊ทธ๋ฆผ์ธ๊ฑธ ํ์ธํ๋ค! import cv2 img = cv2.imread("images/couple2.jpg", flags=cv2.IMREAD_GRAYSCALE) import numpy as np hist = np.zeros((256)) cv2.imshow('histogram', img) cv2.waitKey(0) cv2.destroyAllWindows() height, width = img.shape for y in range(height): for x in range(width): hist[img[y,x]] = hist[img[y,x]] + 1 import matplotlib.pyplot as plt plt.bar(..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cg4vkH/btsCEIWAgKA/X8qTPA2ieYw3uSXEDDFAuk/img.png)
๐ 0๊ณผ 1๋ก ๋ช ์ ํํํด๋ณด๊ธฐ ๋๋๋ง(Dithering)์ ์ ํ๋ ์์ ์ด์ฉํ์ฌ ์์์ด๋ ์์ ๋ํ๋ด๋ ๊ฒ์ด๋ฉฐ, ์ฌ๋ฌ ์ปฌ๋ฌ์ ์์ ์ต๋ํ ๋ง์ถ๋ ๊ณผ์ ์ด๋ค.๊ทธ๋ํฝ ๋์์ด๋์ ์์ฑ๊ณต๊ฐ ์์์ ํ๋์ ์ธ๊ธฐ๊ฐ ์๋ ๋ค๋ฅธ ํฝ์ ์ธ๊ธฐ๋ก ๊ตฌ์ฑ๋๊ธฐ ๋๋ฌธ์ ๋์์ด ๋ง์ ๊ฒ์ฒ๋ผ ๋ค์ ๊ฑฐ์น ๊ฒ ๋ณด์ผ ์ ์๋ค ์์ฆ ์ ์์ฐ์ ^_^ def minmax(pixel): if pixel > 255: pixel = 255 if pixel < 0: pixel = 0 return pixel import numpy as np def dithering(img): height, width = img.shape for y in range(0, height-1): for x in range(1, width-1): p = img[y, x] new_p..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bZ9tHr/btsCJkOob1P/YRlh4xEaIWhIvAvx77f2J1/img.png)
๐ threshold ๋ก binary, tozero ๋ฑ flag ์ง์ ํ๊ธฐ import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('images/gradation.png',0) ret, thresh1 = cv2.threshold(img,127,255, cv2.THRESH_BINARY) ret, thresh2 = cv2.threshold(img,127,255, cv2.THRESH_BINARY_INV) ret, thresh3 = cv2.threshold(img,127,255, cv2.THRESH_TRUNC) ret, thresh4 = cv2.threshold(img,127,255, cv2.THRESH_TOZERO) ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/tlyG0/btsCCxA0WpW/e52qNtXSL9D4G9OjeK7Kkk/img.png)
๐ threshold ๋ก tone ์กฐ์ ํ๊ธฐ import numpy as np def two_tone(img, threshold=128): output = (img > threshold) * 255 return output.astype(np.uint8) import cv2 img = cv2.imread("images/lena.jpg", 0) # 100 ์ดํ๋ฉด 0 black, 100 ์ด์์ด๋ฉด 255 white new_img = two_tone(img, threshold=100) cv2.imwrite('lena_bin.jpg', new_img) cv2.imshow('img', new_img) cv2.waitKey(0) cv2.destroyAllWindows() ๐ threshold ๋ก ์ค์๊ฐ webcam to..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/I7Mxr/btsCMyLUz5X/t8JIkJSuulNqH2IKIgbpl1/img.png)
๐ NORMAL & MIXED import cv2 import numpy as np # ํ๋ ฌ (์ ์ ๋ณด b g r) logo = cv2.imread('images/logo.png') lena = cv2.imread('images/lena.jpg') mask = np.full_like(logo, 255) height, width = lena.shape[:2] center = (width//2, height//2) # ์์ค ์ด๋ฏธ์ง, destination, ๋ณต์ ์ฃผ๋ณ mask, center ์ด๋ฏธ์ง, flag normal = cv2.seamlessClone(logo, lena, mask, center, cv2.NORMAL_CLONE) # ๋ธ๋ฌ์ฒ๋ฆฌ mixed = cv2.seamlessClone(logo, lena..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/oyTSS/btsCztZxiFd/w5HVln2bPrRhIXaQEIr8NK/img.png)
๋ฌธ๋ ๊ตฌ์กฐ์ฒด ์์ ์๋ ๋ฉค๋ฒ๋ณ์, ๋ฉค๋ฒํจ์์ ์ด๋ฆ์ ์ถ๋ ฅํ ์๋ ์์๊น? ์๊ฐ์ด ๋ค์๋ค ๊ทธ๋ฐ๋ฐ C# ์ด๋ฐ๋ฐ๋ reflection ์ด ์ฃผ์ด์ง๋ค๊ณ ํ๋ค C++ ์๋ boost ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ก ์ ๊ทผ์ด ๊ฐ๋ฅํ๋ค๊ณ ํ๋๋ฐ ... ๊ณผ์ฐ? โญ boost ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ค์ดํ๊ธฐ https://www.boost.org/users/history/version_1_84_0.html Version 1.84.0 Version 1.84.0 December 13th, 2023 23:54 GMT Documentation DownloadsPlatformFileSHA256 Hash unixboost_1_84_0.tar.bz2cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454boo..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/WEstZ/btsCoIbKPuj/YNKrCbCrDdHIDXhOPki8C0/img.png)
๐ ์์ ํ ์งํ์ฒ ๐ฉ BSS (Best Safety Subway) ๋น์ฆ๋์ค ์ง์ ์์คํ BSS (Business Support System) : ํต์ ์กฐ์ง์ด ๋ชจ๋ ๊ณ ๊ฐ ๋๋ฉด ํ๋์ ๊ด๋ฆฌํ๊ณ ๊ฐ์ํํ๋ ๋ฐ ๋์์ด ๋๋ ๋ค์ํ ์ํํธ์จ์ด ํ๋ก๊ทธ๋จ ์์ ํ๊ณ ๊นจ๋ํ ์งํ์ฒ ํ์น ๋ฐ ์ดํ ~ ! ๐ฉ ์ถ์ง ๋ฐฐ๊ฒฝ ๋ฐ ํ์์ฑ ์์ด ๋ฐ ์ฌ๊ณ ๋น๋ฒํ๊ฒ ์ผ์ด๋จ ์คํฌ๋ฆฐ ๋์ด ๊ณ ์ฅ ๋ฌธ์ ์ถํด๊ทผ ์์ฌ ์ฌ๊ณ ์ํ ๋์ ๊ฐ์ ์ ์ผ๋ก ์ด์ฐํํ์ ๊ณผํฌํ ์๊ฐํ๋ก “์ํ” ์์ ์ ๋ฌ ๐ฉ ์๋น์ค ๋ด์ฉ Staion ์งํ์ฒ ์ญ ์งํ์ฒ ๊ธฐ๊ด์ฌ์๊ฒ ์๊ธ ์ํฉ ๋ฐ ๋ฐฉํด๋ฌผ ๊ฐ์ง ์๋ฆฌ๊ธฐ MQTT ํต์ ์ผ๋ก ์๋ฆผ ๋ช ๋ฒ ์ถ์ ๋ฌธ์ธ์ง ์๋ฆผ ์ด๋ก์ ๋ ธ๋์ ๋นจ๊ฐ์์ผ๋ก ๊ฝ ์ฐจ์์ผ๋ฉด ์ด์ฐํํ์ ๊ณผํฌํ๋ก, ์ฌ๋๋ค์ด ๋ฌด์์์ ์ ํ ๊ฒ์ ์ ์ฐจ์ญ์ ์ด์ํ ๋ผ์ด๋ ์ผ์๋ก ๋ฐฉ..