Exemplo n.º 1
0
func normalizeFaces(numFaces int) []eigenface.FaceVector {
	filePattern := getPath() + "static/img/orl_faces/%v.png"
	faces := make([]eigenface.FaceVector, numFaces)
	for i := 0; i < numFaces; i++ {
		filename := fmt.Sprintf(filePattern, i+1)
		faces[i] = faceimage.ToVector(filename)
	}
	return eigenface.Normalize(faces)
}
func scratch(w http.ResponseWriter, r *http.Request) {
	f := faceimage.ToVector("static/img/orl_faces/1.png")
	averageFaces(5)
	saveVector(f, w, r)
	fmt.Fprint(w, "Done!")
}