Page 1 of 1

Background Subtract (Rolling Ball)

Posted: 2011-05-24T03:41:38-07:00
by BrendanSimon
Hello,

I need and image processing library that has the following algorithms that will run in a .NET/C# environment.
* Background Subtraction (Rolling Ball method)
* Sharpen
* Template Matching (using Normalised Cross Correlation Coefficients method)

Unfortunately I haven't been able to find a library that has all these algorithms :(

I believe there is a C# interface for IM :)

I believe that Sharpen is available in IM :)

I believe that compare has a metric option with NCC. Is that the same as NCCC ??

The biggest hurdle seems to be Background Subtraction using the Rolling Ball method :(
Does this exist in IM anywhere ??
Does anyone know if there is an alternative algorithm that will provide similar results ??

Many thanks for any assistance.
Cheers, Brendan.

Re: Background Subtract (Rolling Ball)

Posted: 2011-05-24T10:18:56-07:00
by fmw42
can you provide a link to some background, examples or theory or code for the rolling ball background subtraction?

OK. I googled for it

http://pacific.mpi-cbg.de/wiki/index.ph ... ubtraction
http://imagejdocu.tudor.lu/doku.php?id= ... background

I see that it is somewhat a circular equivalent of the IM function -lat (http://www.imagemagick.org/script/comma ... ns.php#lat). I am sure it can be implemented as a script in circular form using -blur radiusx65000 to get a uniform circular average, then subtract that from the image using -compose minus -composite (or even do the subtraction as in -lat with a threshold value)

I have a script that uses -lat to even out background on text, called textcleaner, that would likely do the same thing you want. Also I have a Normalized Cross Correlation template matching script, normcrosscor, implemented via FFT. But unfortunately, all my scripts, see below, are bash unix-based.

IM compare with -metric ncc is a normalized cross correlation metric. That should work for template matching or just comparing two equal size images, but the former will be slower than my FFT script.