Ejemplo n.º 1
0
def calculateAverageBOW(sfmDataFile, matchesFolLoc):
    sfmData = FileUtils.loadjson(sfmDataFile)
                
    avgBow = None
    for view in sfmData["views"]:
        viewImage = view["value"]["ptr_wrapper"]["data"]["filename"]
        viewBow = os.path.join(matchesFolLoc, os.path.splitext(viewImage)[0] + ".bow")
        bowvec = FileUtils.loadBinMat(viewBow)
        if avgBow is None:
            avgBow = bowvec
        else:
            avgBow += bowvec
        avgBow /= len(sfmData["views"])
    
    return avgBow
Ejemplo n.º 2
0
def calculateAverageBOW(sfmDataFile, matchesFolLoc):
    sfmData = FileUtils.loadjson(sfmDataFile)

    avgBow = None
    for view in sfmData["views"]:
        viewImage = view["value"]["ptr_wrapper"]["data"]["filename"]
        viewBow = os.path.join(matchesFolLoc,
                               os.path.splitext(viewImage)[0] + ".bow")
        bowvec = FileUtils.loadBinMat(viewBow)
        if avgBow is None:
            avgBow = bowvec
        else:
            avgBow += bowvec
        avgBow /= len(sfmData["views"])

    return avgBow
Ejemplo n.º 3
0
def main():
    mat = FileUtils.loadBinMat(os.path.join("../data","opencv-mat.bin"))
    print "loaded binary matrix : " + str(mat)
Ejemplo n.º 4
0
def main():
    mat = FileUtils.loadBinMat(os.path.join("../data", "opencv-mat.bin"))
    print "loaded binary matrix : " + str(mat)