전체 글
-
Python 교촌치킨 국내매장 크롤링(Selenium 동적 웹크롤링)DataAnalysis/웹크롤링 2022. 4. 17. 00:15
from selenium import webdriver import time driver = webdriver.Chrome('chromedriver.exe') driver.implicitly_wait(10) url = 'http://www.kyochon.com/shop/domestic.asp' driver.get(url) sido1 = driver.find_element_by_css_selector('#sido1') sido1.click() sido_list = driver.find_elements_by_css_selector('#sido1 > option') length= len(sido_list) time.sleep(0.2) sido1.click() for sido in range(1,length):..
-
손가락 개수를 이용한 가위바위보 놀이영상처리(Opencv) 2022. 4. 16. 23:39
import cv2 import numpy as np vid = cv2.VideoCapture("images/rock3.mp4") while (True): ret, frame = vid.read() hsvimg = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) lower = np.array([0, 48, 80], dtype="uint8") upper = np.array([20, 255, 255], dtype="uint8") hsv = cv2.inRange(hsvimg, lower, upper) #손 색상영역에 따른 검출 blurred = cv2.blur(hsv, (2, 2)) #블러처리 ret, thresh = cv2.threshold(blurred, 0, 255, cv2.THRE..
-
opencv 포토샵 도구 만들기영상처리(Opencv) 2022. 4. 16. 23:34
import cv2 import numpy as np title = 'photo' half = 50 # 관심 영역 절반 크기 isDragging = False # 드래그 여부 플래그 def liquify(img, x1, y1, x2, y2): x, y, w, h = x1 - half, y1 - half, half * 2, half * 2 # 대상 영역 좌표와 크기 설정 roi = img[y:y + h, x:x + w].copy() # 관심 영역 설정 result = roi.copy() #관심영역 복사 offset_x1, offset_y1 = x1 - x, y1 - y # 관심영역 기준으로 좌표 재설정 offset_x2, offset_y2 = x2 - x, y2 - y # 관심영역 기준으로 좌표 재설정 #..