Ejemplo n.º 1
0
def readCSV(filepath):
   reader = CSVReader(FileReader(filepath), ",")
   ls = reader.readAll()
   data = ArrayList()
   for item in ls:
   	  data.add(item)
   return data
Ejemplo n.º 2
0
def readKeyCSV(filepath):
   reader = CSVReader(FileReader(filepath), ",")
   ls = reader.readAll()
   keymap = HashMap()
   for item in ls:
         keymap.put(int(item[0]), int(item[1]))
         print item[0], item[1]
   return keymap
Ejemplo n.º 3
0
def readCSV(filepath):
    reader = CSVReader(FileReader(filepath), "\t")
    ls = reader.readAll()
    f, x, y, z = [], [], [], []
    for i in range(len(ls)):
        if i is not 0:
            f.append(ls.get(i)[1])
            x.append(ls.get(i)[4])
            y.append(ls.get(i)[5])
            z.append(ls.get(i)[6])
            # print x[i-1], y[i-1], z[i-1]
    return f, x, y, z
Ejemplo n.º 4
0
def readDataCSV(fp):
    reader = CSVReader(FileReader(fp), ",")
    ls = reader.readAll()
    tracks = HashMap()
    for idx, item in enumerate(ls):
        if idx > 0:
            if tracks.containsKey(int(item[0])):
                pass
            else:
                track = [[], [], [], []]
                tracks.put(int(item[0]), track)  # trackID in str.
            track = tracks.get(int(item[0]))
            track[0].append(int(item[1]))  # frame 0
            track[1].append(item[3])  # x 1
            track[2].append(item[4])  # y 2
            roi = Roi(int(item[5]), int(item[6]), int(item[7]), int(item[8]))
            track[3].append(roi)  # a roi 3
    return tracks