Background Subtraction: Coverting from Java to Matlab code



I've been working (on and off) for months on a program and ways to
automate it as much as possible. What I need to do for better accuracy
when thresholding my images, is subtract the relatively noisy
background so the thresholding methods that I am using can catch all
of the particles I am looking for in my images. (Right now, the
methods either miss some or catch too much of the image).
The source code for such a method is open source from ImageJ. I have
used this method within ImageJ and it works wonderfully. My problem is
that I am trying to work entirely within Matlab for my procedures, and
do not know how to correctly covert the Java code to Matlab code.

Here's the link for the Java code:
http://rsb.info.nih.gov/ij/developer/source/ij/plugin/filter/BackgroundSubtracter.java.html

Here's a link for what the code does (in wiki format):
http://imagejdocu.tudor.lu/doku.php?id=gui:process:subtract_background

Looking over the FEX and through the newsgroup, I haven't found any
solutions to my problem. Some people have asked similar questions, but
no applicable solution has been found.

I've tried converting the applicable parts of the Java code to Matlab,
but I receive errors when trying to run it such as out of bound
indexing (probably due to the 0 and 1 based array differences, among
other things).

Here is a link to the code I've tried converting:
http://docs.google.com/Doc?docid=0AakynObL-7fCZGhxajV2dDhfMjU3Z2ZtNnRrY2M&hl=en

Note: I did not convert classes and understand that the original code
also calls from libraries/packages that I do not know how to access
via matlab.

Here is an example image that I need to background subtract:
http://lh3.ggpht.com/_-PiQE3WZBsQ/Sg3kTxC2HGI/AAAAAAAABLU/IsTMiEODHc4/SR_1733_JILDN_324_50mm_20k_C.jpg

The differences in the background appear to be subtle, but they are
big enough that I need this background subtracting method (or
something similar, if anybody has an idea...)

I would appreciate any responses as well as help figuring this out.

-Nathan
.



Relevant Pages


Loading