Python 如何对人进行分类';用Gabor滤波器过滤衣服?
我想用Gabor滤波器来识别另一个人 它工作正常,但我不知道如何分类 例如,它是否需要SVM作为分类器 我从中了解到,它不需要SVM或其他分类器 实时完整代码(视频): 请帮帮我 先谢谢你Python 如何对人进行分类';用Gabor滤波器过滤衣服?,python,classification,textures,gabor-filter,Python,Classification,Textures,Gabor Filter,我想用Gabor滤波器来识别另一个人 它工作正常,但我不知道如何分类 例如,它是否需要SVM作为分类器 我从中了解到,它不需要SVM或其他分类器 实时完整代码(视频): 请帮帮我 先谢谢你 import cv2 import numpy as np from imutils.video import FPS # capturing video through webcam import time cap = cv2.VideoCapture(0) #video dimension in pyth
import cv2
import numpy as np
from imutils.video import FPS
# capturing video through webcam
import time
cap = cv2.VideoCapture(0)
#video dimension in python-opencv
width = cap.get(3) # float
height = cap.get(4) # float
print width,height
time.sleep(2.0)
fps = FPS().start()
while(1):
_, img = cap.read()
if _ is True:
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# img =cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
else:
continue
g_kernel = cv2.getGaborKernel((21, 21), 8.0, np.pi / 4, 10.0, 0.5, 0, ktype=cv2.CV_32F)
# print g_kernel
filtered_img = cv2.filter2D(img, cv2.CV_8UC3, g_kernel)
# print filtered_img
# kernel_resized = cv2.resize(g_kernel)
cv2.imshow("Original Tracking", img)
cv2.imshow("Color Tracking", filtered_img)
h, w = g_kernel.shape[:2]
g_kernel = cv2.resize(g_kernel, (3 * w, 3 * h), interpolation=cv2.INTER_CUBIC)
cv2.imshow('gabor kernel (resized)', g_kernel)
# cv2.imshow("kernel", g_kernel)
if cv2.waitKey(10) & 0xFF == ord('q'):
cap.release()
cv2.destroyAllWindows()
break
fps.update()
fps.stop()
print("[INFO] elapsed time: {:.2f}".format(fps.elapsed()))
print("[INFO] approx. FPS: {:.2f}".format(fps.fps()))