Hi,
I'm currently working on a small plug-in (a PlugInFilter to be more speciffic) , in which the first step of processing needs to be a thresholding operation. In my run() method I try to do the following: ip.setAutoThreshold(AutoThresholder.Method.Shanbhag, false, ImageProcessor.BLACK_AND_WHITE_LUT); ip.autoThreshold(); This indeed produces a binary image. However, the output seems to be the same, no matter which method I use and it is far from what I get, when i apply the same method using the menu (Image->Adjust->Auto Treshold) Is this the right way to do this kind of thing, or is there a better way to do this? Thanks, Gebhard |
Good day Gebhard,
did you try recording the processing steps using the Java-recorder? (Plugins > Macro > Record > Java) Best Herbie ::::::::::::::::::::::::::::::::::::::::::::: Am 29.03.16 um 16:07 schrieb Gebhard Stopper: > Hi, > > I'm currently working on a small plug-in (a PlugInFilter to be more > speciffic) , in which the first step of processing needs to be a > thresholding operation. > In my run() method I try to do the following: > > ip.setAutoThreshold(AutoThresholder.Method.Shanbhag, false, > ImageProcessor.BLACK_AND_WHITE_LUT); > ip.autoThreshold(); > > > This indeed produces a binary image. However, the output seems to be the > same, no matter which method I use and it is far from what I get, when i > apply the same method using the menu (Image->Adjust->Auto Treshold) > > Is this the right way to do this kind of thing, or is there a better way to > do this? > > > > Thanks, > Gebhard -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
This post was updated on .
Hello Herbie,
thanks for your answer! It turned out that a simple call to IJ.run(img, "Auto Threshold", "method=Shanbhag white"); did the trick. I'm pretty new to ImageJ and didn't know it had such a nice function. Thanks a lot! Gebhard ::::::::::::::::::::::::::::::::::::::::::::: Good day Gebhard, did you try recording the processing steps using the Java-recorder? (Plugins > Macro > Record > Java) Best Herbie ::::::::::::::::::::::::::::::::::::::::::::: Am 29.03.16 um 16:07 schrieb Gebhard Stopper: > Hi, > > I'm currently working on a small plug-in (a PlugInFilter to be more > speciffic) , in which the first step of processing needs to be a > thresholding operation. > In my run() method I try to do the following: > > ip.setAutoThreshold(AutoThresholder.Method.Shanbhag, false, > ImageProcessor.BLACK_AND_WHITE_LUT); > ip.autoThreshold(); > > > This indeed produces a binary image. However, the output seems to be the > same, no matter which method I use and it is far from what I get, when i > apply the same method using the menu (Image->Adjust->Auto Treshold) > > Is this the right way to do this kind of thing, or is there a better way to > do this? > > > > Thanks, > Gebhard -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html ________________________________ If you reply to this email, your message will be added to the discussion below: http://imagej.1557.x6.nabble.com/Applying-autothreshold-in-java-PlugInFilter-tp5016020p5016021.html To unsubscribe from Applying autothreshold in java PlugInFilter, click here<http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5016020&code=Z2ViaGFyZC5zdG9wcGVyQHVrcy5ldXw1MDE2MDIwfDQ4MjcwNzk5MQ==>. NAML<http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> |
Free forum by Nabble | Edit this page |