开发者

BufferedImage Android Port

开发者 https://www.devze.com 2023-04-12 13:15 出处:网络
I am in the process of porting some java code to Android. The code is doing some image recognition and uses BufferedImage I have managed to move most of the functionality over to Bitmap but I am strug

I am in the process of porting some java code to Android. The code is doing some image recognition and uses BufferedImage I have managed to move most of the functionality over to Bitmap but I am struggling with the code below, any advice on how to port this over

public void verti开发者_StackOverflow社区calEdgeDetector(BufferedImage source) {
    BufferedImage destination = duplicateBufferedImage(source);

    float data1[] = {
        -1,0,1,
        -2,0,2,
        -1,0,1,
    };

    float data2[] = {
        1,0,-1,
        2,0,-2,
        1,0,-1,
    };

    new ConvolveOp(new Kernel(3, 3, data1), ConvolveOp.EDGE_NO_OP, null).filter(destination, source);
 }


try out http://xjaphx.wordpress.com/2011/06/22/image-processing-convolution-matrix/

0

精彩评论

暂无评论...
验证码 换一张
取 消