이미지(3)
-
Scanning
import cv2 import numpy as np import os print("라이브러리 임포트 완료".rjust(50, "=")) img_path = 'img/test2.jpg' filename, ext = os.path.splitext(os.path.basename(img_path)) print(filename) print("") print(ext) ori_img = cv2.imread(img_path) src = [] print("마우스 콜백 함수".rjust(50, "=")) # mouse callback handler def mouse_handler(event, x, y, flags, param): if event == cv2.EVENT_LBUTTONUP: img = ori_img.copy..
2020.04.17 -
Naver Image Crawling
from urllib.request import urlopen from urllib.parse import quote_plus from bs4 import BeautifulSoup from selenium import webdriver print("라이브러리 임포트 완료\n".rjust(20, '-')) base_url = "https://search.naver.com/search.naver?where=image&sm=tab_jum&query=" plus_url = input("무엇을 검색하시겠습니까? ") url = base_url + quote_plus(plus_url) print(url) html = urlopen(url).read() soup = BeautifulSoup(html, 'html.pa..
2020.04.17 -
Google Image Crawling
import errno import sys, os from bs4 import BeautifulSoup from selenium import webdriver import urllib, urllib.request import requests import random import time from selenium.webdriver.common.keys import Keys folder = "image" url = "https://www.google.com/search" webDriver = "chromedriver.exe" searchItem = input("검색어를 입력하세요: ") size = 300 params = { "q": searchItem , "tbm": "isch" , "sa": "1" , ..
2020.04.17