일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- pandas
- 선그래프
- dataframe
- Stack
- python
- Matplotlib
- Join
- 파이썬
- 알고리즘
- 자료구조
- aws jupyter notebook
- 데이터시각화
- 백준
- javascript
- type hint
- Algorithm
- 알고리즘 스터디
- 알고리즘스터디
- openCV
- MySQL
- 코딩테스트
- NumPy
- 노마드코딩
- queue
- Selenium
- programmers
- 정보처리기사 c언어
- 프로그래머스
- String Method
- 가상환경
- Today
- Total
목록Python/OpenCV (12)
조금씩 꾸준히 완성을 향해

# numpy.ndarray로 영상표현 import cv2 import numpy as np 화소 접근 방법 img = cv2.imread('./lena.jpg') print('img.ndim=', img.ndim) print('img.shape=', img.shape) print('img.dtype=', img.dtype) # img.ndim= 3 # img.shape= (512, 512, 3) # img.dtype= uint8 img = img.astype(np.int32) print('img.dtype=', img.dtype) # img.dtype= int32 img = np.uint8(img) print('img.dtype=', img.dtype) # img.dtype= uint8 # 이미지를 데..

OpenCV 도형 그리기 import cv2 import numpy as np # line cv.line(img, pt1, pt2, color[, thickness[, line_type[, shift[, tipLength]]]]) ->img Parameters img Image. pt1 The point the arrow starts from. pt2 The point the arrow points to. color Line color. thickness Line thickness. line_type Type of the line. shift Number of fractional bits in the point coordinates. tipLength The length of the arrow tip i..

▶ openCV install pip install opencv-python import cv2 # 버전 확인 cv2.version.opencv_version # '4.6.0.66' ▶ Image read imagefile = './lena.jpg' #파일 경로 지정 # color (칼라로 가져오기) img = cv2.imread(imagefile) print(img.shape) # (512, 512, 3) # grayscale (흑백으로 가져오기) img2 = cv2.imread(imagefile, 0) print(img.shape) # (512, 512, 3) cv2.startWindowThread() cv2.imshow('Lena color', img) #칼라사진 띄우기 cv2.imshow('Len..