def testFindCameraSpacePointsTwo(): v = Connections() srcPts = np.array([[1, 1], [3, 3], [5, 5]]) dstPts = np.array([[2, 2], [4, 4], [6, 6]]) v.addConnection(0, 1, None, None, srcPts, dstPts) v.debugConnections() listOfMatches = [] discovered = [dict(), dict()] v.findMatches(listOfMatches, discovered) [match.debugViews() for match in listOfMatches]
def testFindCameraSpacePointsThree(): v = Connections() srcPts01 = np.array([[1, 1], [4, 4]]) dstPts01 = np.array([[2, 2], [5, 5]]) v.addConnection(0, 1, None, None, srcPts01, dstPts01) srcPts02 = np.array([[8, 8]]) dstPts02 = np.array([[9, 9]]) v.addConnection(0, 2, None, None, srcPts02, dstPts02) srcPts12 = np.array([[2, 2], [6, 6]]) dstPts12 = np.array([[3, 3], [7, 7]]) v.addConnection(1, 2, None, None, srcPts12, dstPts12) # v.debugConnections() listOfMatches = [] discovered = [dict(), dict(), dict()] v.findMatches(listOfMatches, discovered) [match.debugViews() for match in listOfMatches]
def testAddOneConnection(R01, t01): v = Connections() v.addConnection(0, 1, R01, t01, None, None) v.debugConnections()
def testFindCameraSpacePointsFour(): v = Connections() srcPts01 = np.array([[1, 1], [8, 8], [17, 17]]) dstPts01 = np.array([[2, 2], [9, 9], [18, 18]]) v.addConnection(0, 1, None, None, srcPts01, dstPts01) srcPts02 = np.array([[5, 5], [19, 19]]) dstPts02 = np.array([[7, 7], [20, 20]]) v.addConnection(0, 2, None, None, srcPts02, dstPts02) srcPts03 = np.array([[8, 8], [11, 11]]) dstPts03 = np.array([[10, 10], [13, 13]]) v.addConnection(0, 3, None, None, srcPts03, dstPts03) srcPts12 = np.array([[2, 2], [6, 6], [14, 14], [21, 21]]) dstPts12 = np.array([[3, 3], [7, 7], [15, 15], [22, 22]]) v.addConnection(1, 2, None, None, srcPts12, dstPts12) srcPts13 = np.array([[14, 14], [23, 23]]) dstPts13 = np.array([[16, 16], [24, 24]]) v.addConnection(1, 3, None, None, srcPts13, dstPts13) srcPts23 = np.array([[3, 3], [12, 12], [25, 25]]) dstPts23 = np.array([[4, 4], [13, 13], [26, 26]]) v.addConnection(2, 3, None, None, srcPts23, dstPts23) # v.debugConnections() listOfMatches = [] discovered = [dict(), dict(), dict(), dict()] v.findMatches(listOfMatches, discovered) [match.debugViews() for match in listOfMatches]
for k in range(3): matrixList[i][j, k] = np.float(row[k]) # instantiate viewSet object c = Connections(len(images)) # set instrinsics c.setIntrinsics(matrixList[0]) # fill connection table for i in range(numImages): for j in range(i + 1, numImages): R, t, srcPts, dstPts = estimateRelativeExtrinsics( images[i], images[j], i, j, c.intrinsics) # estimate time 35.433154821395874 c.addConnection(i, j, R, t, srcPts, dstPts) # find the matches listOfMatches = [] discovered = [dict() for i in range(numImages)] c.findMatches(listOfMatches, discovered) # find the 3D points index = np.random.randint(0, len(listOfMatches)) compute3DPoints(listOfMatches, c, False) filterRelativeProjections(listOfMatches) compute3DPoints(listOfMatches, c, True) listOfMatches = filterWorldPoints(listOfMatches) pointCloud = createPointCloud(listOfMatches) finish = time() print(finish - start) plot_pointCloud(pointCloud)