使用ImageJ库(Java)提高图像对比度
我试图通过某个因子来增加图像的对比度使用ImageJ库(Java)提高图像对比度,java,image,image-manipulation,imagej,Java,Image,Image Manipulation,Imagej,我试图通过某个因子来增加图像的对比度x 到目前为止,我能够读入一幅图像,并得到像这样的处理器 ImagePlus im = new ImagePlus(imagePathHere); ImageProcessor ip = im.getProcessor(); ImagePlus imc = increaseContrast(im, 0.5) 我知道contractenhancer.java和contractAdjulator.java,但我不确定它们将如何使用。 最终,我想要这样的东西 I
x
到目前为止,我能够读入一幅图像,并得到像这样的处理器
ImagePlus im = new ImagePlus(imagePathHere);
ImageProcessor ip = im.getProcessor();
ImagePlus imc = increaseContrast(im, 0.5)
我知道contractenhancer.java
和contractAdjulator.java
,但我不确定它们将如何使用。
最终,我想要这样的东西
ImagePlus im = new ImagePlus(imagePathHere);
ImageProcessor ip = im.getProcessor();
ImagePlus imc = increaseContrast(im, 0.5)
谢谢大家! 这似乎有效:
ImagePlus im = new ImagePlus(imagePathHere);
ContrastEnhancer enh = new ContrastEnhancer();
enh.stretchHistogram(plus, i);
其中i<100
当你打电话的时候
im.getImage();
您将获得对比度增强的图像
setMinAndMax(double min, double max)
在物体上 嗯,是的,这看起来确实管用。然而,它并没有做我想让它做的事情。Photoshop中对比度的增加不会显示与此方法相同的效果。你认为它可能在
ContractAdjulator
中吗?我想ContractAdjulator只是独立ImageJ应用程序的一个图形组件。如果你愿意,你可以下载源代码和单机版,看看对比度调整在他们的应用程序中是如何工作的。在对比度调整器.java
中有一个方法adjustContrast
。知道这是怎么回事吗?我在看ImageJ api,没有看到一个“adjustContrast”方法。嗯,我假设是因为它不是一个公共方法。退房在里面