opencv HSV颜色空间中的肤色检测
2. 实现代码
import cv2
import numpy as np
from matplotlib import pyplot as plt
################################################################################
print 'Pixel Values Access'
imgFile = 'images/face.jpg'
# load an original image
img = cv2.imread(imgFile)
################################################################################
print 'HSV Skin Model'
rows,cols,channels = img.shape
# convert color space from bgr to rgb
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# prepare an empty image space
imgSkin = np.zeros(img.shape, np.uint8)
# copy original image
imgSkin = img.copy()
# convert color