Generalized Hough Transform on a MAC isn't working

I picked up a plugin for ImageJ here:

I put two 8 bit grey scale gif files into a directory.
It has two files in it:
refrence_object.gif and search_pic_1.gif

I invoked the GHT plugin from the plugin menu.
It asks for the source directory
I point to it.

I click through all the defaults…

This is what I get

ImageJ 1.48v; Java 1.6.0_65 [32-bit]; Mac OS X 10.11.4; 15MB of 400MB (3%)

java.lang.ArithmeticException: / by zero
   at GHT_.search_for_object(
   at ij.IJ.runUserPlugIn(
   at ij.IJ.runPlugIn(
   at ij.Executer.runCommand(

I suspect that because this is a mac it finds the .DS_Store file and tries to interpret that…
Not sure… Was I suppose to have done an edge detection on the source images first?

Hey Brian,

I can reproduce the ArithmeticException in a folder that doesn’t contain any .DS_Store files on my system.

After some digging I found a loop over all pixels of the reference_object.gif:

if (pixels [i] == edge_colour) {

This implies that your reference_object.gif has to contain pixels with 0 value while the others are discarded. This sounds to me like an edge image, where the background is white (255) and the edges are 0.

Hope that helps,

Did you figure out how it works? I have the same issue.