コード例 #1
0
ファイル: wormwatch.py プロジェクト: strob/watchworm
def run():
    if not os.path.isdir(OUTPUT):
        os.makedirs(OUTPUT)
    if not os.path.isdir(INPUT):
        die('No directory named `%s` found.' % (INPUT))
    files = glob.glob('input/*.avi')
    for filename in files:
        base = os.path.basename(filename)
        outbase = os.path.join(OUTPUT, base)
        firstframe =outbase+'.first.tif' 
        if not os.path.exists(firstframe):
            first(filename, firstframe)
        contourpath =outbase+'.contours.pkl'
        if not os.path.exists(contourpath):
            contours(filename, contourpath)
        pathspath = outbase+'.path.pkl'
        if not os.path.exists(pathspath):
            path(contourpath, pathspath)
        circlespath = outbase + '.circ.tif'
        if not os.path.exists(circlespath):
            circularity(pathspath, circlespath)
        motionpath = outbase+'.motion.avi'
        if not os.path.exists(motionpath):
            showmotion(filename, 
                       pathspath,
                       motionpath)
    jsonify('input', 'output')
    makecsv()
コード例 #2
0
ファイル: pathfinding.py プロジェクト: strob/watchworm
def testCircle(base):
    first(base, base+'.path.png')
    contours(base, base+'.contour.pkl')
    path(base+'.contour.pkl', base+'.path.pkl')
    showmotion(base, 
               base+'.path.pkl',
               base+'.motion.avi')