我想使用查找边缘选项ImageJ,拥有找到的边数组并以编程方式将其保存到另一个文件。
ImagePlus ip1 = IJ.openImage("myimage.jpg");
ImageProcessor ip = new ColorProcessor(ip1.getWidth(), ip1.getHeight());
ip.findEdges();
然而,该函数寻找边缘是抽象的,我无法获得边缘图像。
EDIT:
我写了以下几行:
ip.findEdges();
BufferedImage bimg = ip.getBufferedImage();
但是,当我尝试打印 BufferedImage 的 RGB 值时,它只为每个像素 RGB 打印“-16777216”。
好的,我得到了解决方案,问题是我没有将 ColorProcessor 与图像连接起来。
ColorProcessor ip = new ColorProcessor(ImageIO.read(new File("my_image.jpg")));
ip.findEdges();
BufferedImage bimg = ip.getBufferedImage();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)