-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·36 lines (29 loc) · 875 Bytes
/
test.py
File metadata and controls
executable file
·36 lines (29 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
"""
Test script
Tomás Larrain A.
1 de octubre de 2014
"""
import numpy as np
import utils.ASRUtils as asr
import utils.miscUtils as miscUtils
import utils.displayUtils as displayUtils
import utils.magisterUtils as magisterUtils
import utils.dataBaseUtils as dataBaseUtils
import utils.imageUtils as imageUtils
import os
import time
import cv2
from sklearn.neighbors import NearestNeighbors
dataBase = "Yale"
dataBasePath, cantPhotosPerPerson = dataBaseUtils.getDataBasePath(dataBase)
idxPerson = "027"
idxPhoto = np.array([0,2,3,6,13,22])
route = os.path.join(dataBasePath, idxPerson)
width = 168
height = 192
photos = os.listdir(route)
for i in range(len(idxPhoto)):
routePhoto = os.path.join(route, photos[idxPhoto[i]])
I = imageUtils.readScaleImage(routePhoto, width, height, tanTriggs=True)
cv2.imwrite(photos[idxPhoto[i]] + "_TT", I)