본문 바로가기

공부/Open cv

(5)
오류 해결 module 'cv2.cv2' has no attribute 'xfeatures2d' pip install opencv-python==3.4.2.16 opencv-contrib-python==3.4.2.16
명령어 목록 선 검출 cv2.HoughLines(canny, 0.8, np.pi / 180, 150, srn = 100, stn = 200, min_theta = 0, max_theta = np.pi) 이미지,거리,각도,임곗값,거리약수, 각도 약수,최소각도,최대 각도 거리:픽셀 0.0~1.0 각도:0~180 임곗값 : 누산평면의 값 (각도 X 거리) 출처 : Python OpenCV 강좌 : 제 28강 - 직선 검출 - YUN DAE HEE (076923.github.io) 2.
3. mss를 이용한 실시간 스크린 샷 설치 pip install mss import sys import cv2 as cv from PyQt5.QtCore import QThread from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QBoxLayout, QLabel from PyQt5 import QtGui import numpy as np import mss class Image_View(QThread): def __init__(self): super().__init__() def __del__(self): self.wait() def run(self): image_pos = {'left': 0, 'top': 0, 'width': 80, 'height': 80} width = ..
2. [python_Open cv] cv2.threshold import cv2 def nothing(x): pass cv2.namedWindow("Test") cv2.createTrackbar("T1", "Test", 0, 255, nothing) cv2.createTrackbar("T2", "Test", 0, 255, nothing) img_color = cv2.imread('rena.jpg') img_gray = cv2.cvtColor(img_color, cv2.COLOR_BGR2GRAY) while True: T1 = cv2.getTrackbarPos("T1", "Test") T2 = cv2.getTrackbarPos("T2", "Test") ret, img_binary = cv2.threshold(img_gray, T1, T2, 0) cv2.imshow(..
1. [python_Open cv] cvtColor OPEN CV 설치 pip install opencv-python 원본 사진 import cv2 img_color = cv2.imread('rena.jpg') img_gray = cv2.cvtColor(img_color,cv2.COLOR_BGR2GRAY) img_hsv = cv2.cvtColor(img_color, cv2.COLOR_BGR2HSV) img_hlv = cv2.cvtColor(img_color, cv2.COLOR_BGR2HLS) cv2.imshow("result_color", img_color) cv2.imshow("result_gray", img_gray) cv2.imshow("result_hsv", img_hsv) cv2.imshow("result_hlv", img_hlv) cv2.wai..