MCPcopy Create free account
hub / github.com/WenDesi/lihang_book_algorithm / get_features

Function get_features

extract_features.py:60–77  ·  view source on GitHub ↗
(imgs)

Source from the content-addressed store, hash-verified

58 return labels
59
60def get_features(imgs):
61 features = []
62 hog = cv2.HOGDescriptor('hog.xml')
63
64 # 二值化
65 for i in range(len(imgs)):
66 cv_img = imgs[i].astype(np.uint8)
67 cv2.threshold(cv_img,25,255,cv2.cv.CV_THRESH_BINARY_INV,imgs[i])
68
69 for img in imgs:
70 cv_img = img.astype(np.uint8)
71
72 hog_feature = hog.compute(cv_img)
73 hog_feature = np.transpose(hog_feature)
74
75 features.append(hog_feature)
76
77 return np.array(features)
78
79def get_hog_features():
80 # trainset features

Callers 1

get_hog_featuresFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected