Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ImageJ库(Java)提高图像对比度_Java_Image_Image Manipulation_Imagej - Fatal编程技术网

使用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”方法。嗯,我假设是因为它不是一个公共方法。退房在里面