๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • Tried. Failed. Logged.
728x90

๐Ÿ‘จ๐Ÿผ‍๐Ÿ’ป๊ฐœ๋ฐœ/OpenCV6

OpenCV - ํŒŒ์ด์ฌ cv2 ์ด๋ฏธ์ง€ ์†์— ํŠน์ • ์ด๋ฏธ์ง€ ๊ฐ์ง€ํ•˜๊ธฐ def isExistImage(a, b, c=0.65): print("์ด๋ฏธ์ง€ ์กด์žฌ ์—ฌ๋ถ€") img_rgb = cv2.imread(a) template = cv2.imread(b) h, w = template.shape[:-1] res = cv2.matchTemplate(img_rgb, template, cv2.TM_CCOEFF_NORMED) threshold = c loc = np.where(res >= threshold) return len( loc[0] ) != 0 print(isExistImage("screen.png", "target.png")) # True or False def getMatchPosition(a, b, c=0.65): print("์ด๋ฏธ์ง€ ์œ„์น˜ ๊ฐ€์ ธ์˜ค๊ธฐ") img_rgb = cv.. 2023. 1. 16.
OpenCV - pyinstaller ๋นŒ๋“œ ํ›„ cv2๊ฐ€ improt ์•ˆ๋˜๋Š” ์˜ค๋ฅ˜ ํ•ด๊ฒฐ pip install opencv-python==4.5.3.56 ๋‹ค์šด๊ทธ๋ ˆ์ด๋“œ๊ฐ€ ๋‹ต์ด๋‹ค. ์ถœ์ฒ˜: https://stackoverflow.com/questions/69855356/recursion-is-detected-during-loading-of-cv2-binary-extensions recursion is detected during loading of "cv2" binary extensions I have a small program which return opencv error after compilation by pyinstaller. But without compilation it's work! I use Python 3.8.10 on Windows 10 Program: import pyauto.. 2022. 6. 27.
OpenCV - ์ปค์Šคํ…€ Cascade ๋งŒ๋“ค๊ธฐ(CASCADE TRAINER GUI) ๋ฐ ๋ฌผ์ฒด ํƒ์ง€ ์•„๋ž˜ ๋งํฌ์—์„œ Cascade Trainer GUI๋ฅผ ์ž์‹ ์˜ ์ปดํ“จํ„ฐ ํ™˜๊ฒฝ์— ๋งž๋Š” ๋ฒ„์ „์œผ๋กœ ์„ค์น˜(64๋น„ํŠธ๊ฐ€ 32๋น„ํŠธ ๋ฒ„์ „์œผ๋กœ ์„ค์น˜ํ•˜๋ฉด ์ค‘๊ฐ„์— ์˜ค๋ฅ˜๊ฐ€ ์ƒ๊น€) https://amin-ahmadi.com/cascade-trainer-gui/ Cascade Trainer GUI - Amin Cascade Trainer GUI 1. Introduction Cascade Trainer GUI is a program that can be used to train, test and improve cascade classifier models. It uses a graphical interface to set the parameters and make it easy to use OpenCV tools for training.. 2022. 5. 19.
OpenCV - ์บก์ฑ  ๋ฌธ์ž ๊ฒ€์ถœํ•˜๊ธฐ import cv2 import numpy as numpy import matplotlib.pyplot as plt img = cv2.imread('./characters.PNG') img = cv2.blur(img, (10, 10), anchor=(-1, -1), borderType=cv2.BORDER_DEFAULT) # ๋ธ”๋Ÿฌ์ฒ˜๋ฆฌ(๋–จ์–ด์ง„ ์กฐ๊ฐ์„ ๋ถ™์ด๊ธฐ) img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # ํšŒ์ƒ‰ ์ „ํ™˜ img_gray = 255 - img_gray # ์ด๋ฏธ์ง€ ๋ฐ˜์ „ res, thr = cv2.threshold(img_gray, 90, 255, cv2.THRESH_BINARY) # ์ด์ง„ํ™” cv2.imshow('gray', thr) contours, hie.. 2022. 5. 18.
OpenCV - ํŒŒ์ด์ฌ ์›น์บ  ๋ˆˆ, ์–ผ๊ตด ์ธ์‹ import cv2 face_cascade_filename = 'haarcascade_frontalface_default.xml' face_cascasde = cv2.CascadeClassifier( cv2.data.haarcascades + face_cascade_filename) eye_cascade_filename = 'haarcascade_eye.xml' eye_cascade = cv2.CascadeClassifier( cv2.data.haarcascades + eye_cascade_filename) capture = cv2.VideoCapture(0) while cv2.waitKey(33) < 0: ret, frame = capture.read() faces = face_cascasde.dete.. 2022. 2. 2.
OpenCV - ํŒŒ์ด์ฌ ์›น์บ  ์–ผ๊ตด ์ธ์‹ import cv2 cascade_filename = 'haarcascade_frontalface_default.xml' cascasde = cv2.CascadeClassifier( cv2.data.haarcascades + cascade_filename) capture = cv2.VideoCapture(0) while cv2.waitKey(33) < 0: ret, frame = capture.read() faces = cascasde.detectMultiScale(frame, 1.3, 5) for (x, y, w, h) in faces: cv2.rectangle(frame, (x,y), (x + w, y + h), (255,0,0), 2) cv2.imshow('frame', frame) capture... 2022. 2. 2.
728x90