import cv2
cap = cv2.VideoCapture(1)
cap.set(3,1280)
cap.set(4,960)
分辨率越大,视野越小
https://blog.csdn.net/dcrmg/article/details/53543341
https://www.cnblogs.com/arkenstone/p/7900978.html
image = "test.jpg"
frame = cv2.imread(image)
img2gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # 将图片压缩为单通道的灰度图
score = cv2.Laplacian(img2gray, cv2.CV_64F).var()
print "Laplacian score of given image is ", score
if score > 100: # 这个值可以根据需要自己调节,在我的测试集中100可以满足我的需求。
print "Good image!"
else:
print "Bad image!"