func averageFaces(numFaces int) image.Image {
	filePattern := "static/img/orl_faces/%v.png"
	filenames := make([]string, numFaces)
	for i := 0; i < numFaces; i++ {
		filenames[i] = fmt.Sprintf(filePattern, i+1)
	}
	avgFace := faceimage.AverageFaces(filenames)
	return faceimage.ToImage(avgFace)
}
예제 #2
0
func averageFaces(numFaces int) eigenface.FaceVector {
	filePattern := getPath() + "static/img/orl_faces/%v.png"
	filenames := make([]string, numFaces)
	for i := 0; i < numFaces; i++ {
		filenames[i] = fmt.Sprintf(filePattern, i+1)
	}
	avgFace := faceimage.AverageFaces(filenames)
	return avgFace
}