BufferedImage Android 端口
我正在将一些java代码移植到Android上。该代码正在执行一些图像识别并使用 BufferedImage 我已设法将大部分功能转移到 Bitmap 但我正在努力处理下面的代码,关于如何将其移植到位图的任何建议
public void verticalEdgeDetector(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);
}
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 verticalEdgeDetector(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);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试 http://xjaphx.wordpress.com/2011/ 06/22/图像处理卷积矩阵/
try out http://xjaphx.wordpress.com/2011/06/22/image-processing-convolution-matrix/