I'm trying to do top hat filtering in matlab. The imtophat function looks promising, but I have no idea how to use it. I dont have a lot of work with Matlab before. I am trying to look find basically small spots several pixels wide that are local max in my 2 dimensional array.
The documentation on imtophat
has an example .. did you try it? The following images are from the MATLAB documentation.
Code
I = imread('rice.png');
imshow(I)
se = strel('disk',12);
J = imtophat(I,se);
figure, imshow(J)
Original
Top Hat with a disk structuring element
This tutorial is an explanation, but not a particularly meaningful one; for that, you might need a decent explanation on hand.
Jacob - I read it, but am not sure what the strel function does or how you robustly choose its shape and parameters (I've also read its description on Mathworks' website, but it hasn't helped much). What does it really do, conceptually? For my system I'm trying to filter it to be able to look at small maxes that are elliptical at the base with a major radius of around 5 in a much larger array (although that's a very general estimate and they are not all identical sizes but I guess you can consider them small circles in a much larger array).
I think you have more problem undertanding how to use STREL, than IMTOPHAT. The later can be described as simple threshold but per structural element, not the whole image.
Here is another good examples of using STREL and IMTOPHAT: http://www.mathworks.com/matlabcentral/fx_files/2573/1/content/html/R14_MicroarrayImage_CaseStudy.html
This series of posts on Steve Eddins blog might be useful for you: http://blogs.mathworks.com/steve/category/dilation-algorithms/