-
Notifications
You must be signed in to change notification settings - Fork 1
/
DataCache.py
27 lines (23 loc) · 1.1 KB
/
DataCache.py
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
import cPickle as pickle
from os.path import isfile
POINTS4D = "cache/points4d.p" # epilines + extension x2 + getCliquePosSimple
POINTS4D_MULTIPLE_MATCH = "cache/points4d_multiple.p" # epilines_multiple + getCliquePosSimple
POINTS4D_TRIANGULATE = "cache/points4d_triangulate.p" # epilines + triangulate
POINTS4D_UNIFIED = "cache/points4d_unified.p" # POINTS4D_TRIANGULATE + POINTS4D
POINTS4D_HOMOGR_TRIANG_SIMPLE = "cache/points4d_homogr_triang_simple.p" # epilines homogr + triang simple
POINTS4D_HOMOGR_TRIANG = "cache/points4d_homogr_triang.p" # epilines homogr + triang
POINTS4D_HOMOGR_TRIANG_RANSAC = "cache/points4d_homogr_triang_ransac.p" # epilines homogr + triang ransac
# DO NOT USE
POINTS4D_UNIFIED_ALL = "cache/points4d_unified_all.p" # POINTS4D_TRIANGULATE + POINTS4D + POINTS4D_MULTIPLE_MATCH
def getData(filename):
print "DataCache get: %s" % filename
if isfile(filename):
f = open(filename, "rb")
data = pickle.load(f)
f.close()
return data
return None
def saveData(filename, data):
f = open(filename, "wb")
pickle.dump(data, f, 2)
f.close()