Forums > Jitter

jit.matrix operation

May 28, 2009 | 2:42 pm

I am trying to apply a filter to a jit.matrix loaded with an image using java external.
As you can see I am creating a Sobel operator.
But I count not see any effect when I display the image

textureImage.importmovie("lena_std.tif");
JitterMatrix mat =  new JitterMatrix(1,"float32", 3, 3);
         mat.setcell2d(0, 0, new float[]{1.0f});
        mat.setcell2d(0, 1, new float[]{2.0f});
        mat.setcell2d(0, 2, new float[]{1.0f});

        mat.setcell2d(1, 0, new float[]{0.0f});
        mat.setcell2d(1, 1, new float[]{0.0f});
        mat.setcell2d(1, 2, new float[]{0.0f});

        mat.setcell2d(2, 0, new float[]{-1.0f});
        mat.setcell2d(2, 1, new float[]{-2.0f});
        mat.setcell2d(2, 2, new float[]{-1.0f});

        textureImage.op("*",mat);

I display the image using
myrender.send("draw_pixels", new Atom[] { Atom.newAtom(textureImage.getName()) });
Am I doing this right?
Is there a different way of doing this?


Viewing 1 post (of 1 total)