Reproducing Tworkov

Geometry and shape in art with computer vision.

March 14, 2017 - 3 minute read -
blog art

Last year I saw an exhibition by Jack Tworkov (b.1900, Biala, Poland – d.1982, Provincetown, MA). At the same time I was taking computer vision class and learning about 2D projection transformations. I remembered spending a long time staring into this painting, trying to trace the geometry of it.

Compression and Expansion of the Square (Q3-82 #2) (1982) | Oil on Canvas
Photo Source: Alexander Gary Associates

Today waiting for the blizzard to come to New York, I came across it again in my notebook and on a whim decided to sketch it out and dig out some old homework code from computer vision class and apply transformations on it.

This is the center element block, the square:

The original image, as suggested by the title, is the compression and expansion of the square. It’s easy today for us with tools like Sketch. Basically all I needed to do is copy and paste, and drag my mouse twice, then align three images.

But we could also easily do a little bit more. What if we apply a 2D projection transformation on the trapezium (highlighted in green) to make it appear like a rectangle?

I basically re-used code blocks from four-point algorithm, which is essentially the algorithm behind the projective distortion feature in a lot of photo editing applications.

def hat(x):
    return np.array([[0, -x[2], x[1]], [x[2], 0, -x[0]], [-x[1], x[0], 0]])

def four_point(X1, X2):
    if len(X1) == len(X2) and len(X1) >= 4:
        n = len(X1)
        chi = []
        for i in range(n):
            x1 = X1[i].reshape(3,1)
            x2 = X2[i]
            x2_hat = hat(x2)
            a = np.kron(x1, x2_hat)
        chi = hstack(tuple(chi)).T

        u,s,v = svd(chi)
        HsL = v[8]
        HL = np.reshape(HsL,(3,3))
        H = HL
        negative = 0
        for i in range(n):
            if dot(X2[i], dot(H, X1[i].reshape(3,1)))[0] < 0:
                negative += 1
        if negative == n:
            H = -H
        return H
        print 'Please make sure there are more than four image point pairs.'

After I manually clicked on the four points of the green area and applied the transformation, it resulted in the following picture (on the right).

Food for thought: How much does the artistic value lie in the effort or the process of the artist? When Tworkov painted the compression and the expansion, he didn’t just copy and pasted. Does it make his transformations more important or interesting than the trick I used? What about the projective transformation? Is the process of transformation an essential part of the work?