opencv 图像人物识别

原始网址 https://fedemejia.com/?paged=2

 

OpenCV-1-图片处理

下载图片opencv 图像人物识别_第1张图片

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import cv2
import numpy as np

img = cv2.imread('Lenna.png') #load RGB image

imgGS = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #convert RGB to grayscale
cv2.imwrite("LennaGS.png",imgGS) #save grayscale image

ret,imgBW = cv2.threshold(imgGS,127,255,cv2.THRESH_BINARY) #binarization
cv2.imwrite("LennaBW.png",imgBW) #save binary image

cv2.imshow('Original image', img) #Display original image
cv2.imshow('Grayscale image', imgGS) #Display grayscale image
cv2.imshow('Binary image', imgBW) #Display binarized image
cv2.waitKey(0) #exit with 'Q' or ESC
cv2.destroyAllWindows()

你可能感兴趣的:(AI/大数据/云计算)