コード例 #1
0
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')
コード例 #2
0
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')
コード例 #3
0
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"))
コード例 #4
0
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"))