The threshold of sobel

11 visualizaciones (últimos 30 días)
Jürgen
Jürgen el 29 de Nov. de 2013
Comentada: Image Analyst el 4 de Dic. de 2013
Hi,
I am trying to find how the sobel threshold is defined:
I found :
determine the threshold; see page 514 of "Digital Imaging Processing" by
% William K. Pratt
if isempty(thresh), % Determine cutoff based on RMS estimate of noise
% Mean of the magnitude squared image is a
% value that's roughly proportional to SNR
cutoff = scale*mean2(b);
thresh = sqrt(cutoff);
scale = 4; % for calculating the automatic threshold
So I looked in the book to find an explanation why the scale is 4? but it is not explained, the book states that the threshold can be scaled linearly with the SNR but it does not explain why scale =4. Can someone explain this? I so that there were other post around this topic but I did not find a solution to this question.
txn, regards, J

Respuesta aceptada

Image Analyst
Image Analyst el 29 de Nov. de 2013
You can use imgradient() to get the full, original Sobel-filtered image. Then you can set a threshold equal to 4 or 5 or whatever you want. It doesn't matter what they did. It only matters what you need to do to get the best results for your particular images.
  12 comentarios
Jürgen
Jürgen el 4 de Dic. de 2013
Well the problem is a bit more complex: Our final goal is to determine in a 3D spray which droplet are in focus and which not. Therefore we want to know the gradient of droplets of which we know beforehand that they are in focus. Then that gradient could be used to classify the droplets in the spray.
Image Analyst
Image Analyst el 4 de Dic. de 2013
OK, in that case you probably do want an edge detector. But you don't want to threshold it - you want to take the mean of it. First of all you need to have a window large enough to contain your blur or else you can't tell how much it's blurred. With a 3x3 Sobel filter you can tell when it's in focus but if it's blurred a lot or a huge lot, you'll never be able to tell. So you'll probably want to use a Laplacian of Gaussian or Difference of Gaussian filter. But be aware that if the window is too large, then you'll start picking up on your shading/vignetting, and to prevent that you'll need to do a background correction (which you can do with polyfitn. So then when you have the edges you'd simply want to sum your image (or mean - basically the same thing) to get a metric that indicates how much your image is blurred. If the sum or mean is higher, there are more edges there, indicating sharper edges. I don't really see any benefit to thresholding it for the purpose of either binarizing it or masking it.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by