def testAngle(im):
    thetas = npr.computeAngles(im)
    out = np.zeros_like(thetas)
    for y in xrange(thetas.shape[0]):
        for x in xrange(thetas.shape[1]):
            theta = thetas[y, x, 0]
            if theta < 0: theta += 2 * math.pi
            out[y, x] = theta / 2.0 / math.pi
    io.imwrite(out, 'testangle.png')
def testAngle(im):
    thetas = npr.computeAngles(im)
    out = np.zeros_like(thetas)
    for y in xrange(thetas.shape[0]):
        for x in xrange(thetas.shape[1]):
            theta = thetas[y,x,0]
            if theta<0: theta+=2*math.pi
            out[y,x]=theta/2.0/math.pi
    io.imwrite(out, 'testangle.png')
def testSingleScaleOrientedPaint(im,
                                 texture,
                                 outputName,
                                 N=10000,
                                 size=50,
                                 noise=0.3,
                                 nAngles=36):
    out = np.zeros_like(im)
    thetas = npr.computeAngles(im)
    npr.singleScaleOrientedPaint(im, out, thetas, np.ones_like(im), texture,
                                 size, N, noise, nAngles)
    io.imwrite(out, str(outputName + "SingleScaleOriented" + ".png"))
def testSingleScaleOrientedPaint(im, texture, outputName, N=10000, size=50, noise=0.3, nAngles=36):
    out = np.zeros_like(im)
    thetas = npr.computeAngles(im)
    npr.singleScaleOrientedPaint(im, out, thetas, np.ones_like(im), texture, size, N, noise, nAngles)
    io.imwrite(out, str(outputName+"SingleScaleOriented"+".png"))