我使用一个HOG描述符,再加上一个SVM分类器,来识别图片中的人类。我正在为OpenCV使用。我在pymagesearch上使用了出色的教程,它解释了算法的作用,并提供了如何设置detectMultiScale方法参数的提示。
特别是,我知道
# initialize the HOG descriptor
hog = cv2.HOGDescriptor()
# Set the support vector machine to be pre-trained for people detection
hog.setSVMDetector(cv2.HOGDescriptor_getDefault
当我试图运行代码(来自CMD)时,我正在检查这个错误:
ModuleNotFoundError: No module named 'numbers.hog'; numbers is not a package
这是hog.py文件代码..。
from skimage import feature
class HOG:
def __init__(self, orientations = 9, pixelsPerCell = (8, 8),
cellsPerBlock = (3, 3), normalize = False):
s
我第一次在Google Colab上尝试人脸识别
虽然我已经加载了所需的模块,但我无法获得作为NumPy数组的图像类型。
这是我的密码:
import matplotlib.pyplot as plt # To plot images and show information on image
import numpy as np
from skimage.feature import hog # To perform HOG calculations
from skimage import data, exposure
import cv2 # To read images a