Background Subtract (Rolling Ball)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
BrendanSimon
Posts: 1
Joined: 2011-05-24T03:04:45-07:00
Authentication code: 8675308

Background Subtract (Rolling Ball)

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Background Subtract (Rolling Ball)

Post 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.
Post Reply