Hello,
inserting ip = ip.convertToFloat(); after the ip = imp.getProcessor(); line
should get you farther
On Thu, May 31, 2012 at 2:34 PM, ashishdonvir <
[hidden email]>wrote:
> Hello all
> in my application i required to apply unsharp mask to my 16 bit image. i
> tried a lot to do this but dint get success.(confuset in making object of
> imageprocessor)
> now can any any tell me how to use imajeJ's UnsharpMask class in my
> application.
> one think is that here i am not suppose to open dilog box or any imajeJ
> window. i just have my buffered image and i want to apply unsharp mask
> using imajeJ library.
>
> here is what i had tried so far
> ImagePlus imp = new ImagePlus("newimg", bufferedimage);
> ImageProcessor ip=imp.getProcessor();
> ij.plugin.filter.UnsharpMask up=new UnsharpMask();
> up. sharpenFloat((FloatProcessor)ip, radius, (float)weight);
>
> and got the error
> Exception in thread "main" java.lang.ClassCastException:
> ij.process.ShortProcessor cannot be cast to ij.process.FloatProcessor
> at
> unsharpmaskfilter.UnsharpMaskFilter.main(UnsharpMaskFilter.java:37)
>
>
>
> --
> View this message in context:
>
http://imagej.1557.n6.nabble.com/how-to-apply-UnSharpMask-to-bufferred-image-tp4998862.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> _______________________________________________________
>
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
_______________________________________________________
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html