How do I scale Gaussians for Edge detection Say I have an $m\times n$ image and I want to use DOG for edge detection. I can see in this answer he is using:

gaussian1 = fspecial('Gaussian', 21, 15);
gaussian2 = fspecial('Gaussian', 21, 20);


I was working with this image for reference, and I tried to move the size from 1 to 30. I cant make sense of which output is better. I think the sharpest edges I received were for hsize=6, but how can I tell?

After following the advice on the comments and reading the wiki entery's abstract on the subject I am still puzzled. It is my understanding that the band pass parameters is dependent in the image and there is no efficient automatic way to derive the sigma and size parameters of the filters from the image.Does this means I have to manually adjust the filter sizes for any new image?


Is there an automatic way to do so? (I am sure there is since this algorithms work independently on the market)
say I want to generate response for different filters as an experiment:


Which iterations should I go through?
When I am looking at the result image, what should I look for to ssay it is the desired response?
Does this means I have to manually adjust the filter sizes for any new image?


yes! You need to know the kind of edges you want to detect. And that "kind of edge" is a "width of the edge in pixels" in disguise. So, you need more "intelligence" than just a DOG if you want to detect your favourite kind of edge in pictures of any zoom / resolution.


  Is there an automatic way to do so? 


Plenty! You could, for example, simply try out some parametrizations for your DOG and automatedly select the parametrization that leads to an edge image that fits your signal model best – for example, if you want to find square boxes in images, looking for the "cleanest" straight lines.

Again, all depends on what you want to detect, and how you model your signals. There's no "universally" best edge detector. (or else, that would be the only one everyone uses, right?)