The threshold of sobel
11 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
Image Analyst
2013 年 11 月 29 日
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 件のコメント
Image Analyst
2013 年 12 月 4 日
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.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!