Background Subtracter - how to use?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Background Subtracter - how to use?

Influenza
This post was updated on .
Hello everyone,

I'm trying to use the BackgroundSubtracter class in a PlugIn without calling the IJ.command.
I tried to do the following:


                ImagePlus imp = WindowManager.getCurrentImage();
                ImagePlus copy = new ImagePlus("title",(ImageProcessor)imp.getProcessor().clone());
                double rad= 10;
                ImageProcessor ip = copy.getProcessor();
               
                BackgroundSubtracter bs =new BackgroundSubtracter();
                bs.rollingBallBackground(ip, rad , false, false, false, false, false);
                //bs.run(ip);
                copy.updateAndDraw();
                copy.show();

But equal to whether I use the .run() or the .rolingBallbackground() method, both outcoming images are just plain black.
Can anyone help me wiht the correct use, or find my mistake?
Best regards
Steve