Raspberry Pi - 이미지 처리 - OpenCV - 얼굴 영역 추출 (cam.py)
라즈베리파이 vscode 설치 $ sudo su # wget https://packagecloud.io/headmelted/codebuilds/gpgkey -O - | sudo apt-key add - # . 0: print(face_list) color = (0, 0, 255) for face in face_list: x, y, w, h = face cv2.rectangle(image, (x, y), (x+w, y+h), color, thickness=8) cv2.imwrite("facedetect-output.PNG", image) else: print("no face") [[402 479 354 354]] 원본 실행후 검출된 얼굴 영역 모자이크 처리하기 cv_face_ex02.py 30배 축소하여 ..
2020. 10. 19.
Raspberry Pi - 이미지 처리 - OpenCV - 기본연산
OpenCV 기본연산 영상 속성과 화소 접근 영상 속성 cv_ex10.py import cv2 import numpy as np img = cv2.imread('./data/lena.jpg') # img = cv2.imread('./data/lena.jpg', cv2.IMREAD_GRAYSCALE) print('img.ndim=', img.ndim) print('img.shape=', img.shape) print('img.dtype=', img.dtype) # np.bool, np.uint16, np.unit32, np.float32, np.float64, np.complex64 img = img.astype(np.uint32) print('img.dtype=', img.dtype) img = np.u..
2020. 10. 19.