I think there are two problems here.
The first is that it's not clear exactly what the Sobel option in edge() really does, as the threshold that it returns seems much lower that is reasonable. Some kind of normalisation seems to be going on, but it's not properly documented. The gv and gh results from edge('sobel', ...) are also smaller in amplitude that I'd expect, by more than the factor of 8 shown in the documentation.
I'd address this by using my own sobel masks (you can use fspecial as Sean suggests, or you can just write them down) and then convolving with conv2, and thresholding myself.
The second problem is that the Sobel operation on its own is too small-scale for most real images - you'll likely get fragmentary edges all over. For most cases a detector that incorporates some smoothing (e.g. Canny, also available using edge()), will give more useful results.
2 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/23504-sobel-edge-thresholds#comment_51236
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/23504-sobel-edge-thresholds#comment_51236
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/23504-sobel-edge-thresholds#comment_51276
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/23504-sobel-edge-thresholds#comment_51276
Sign in to comment.