Sobel (Edge) function in Matlab and OpenCV sobel operation have different implementations. Can you please provide explanation and reference
Ältere Kommentare anzeigen
I want to perform a sobel operation on an image using the "edge" function and compare this against the OpenCV Sobel operation.
A closer look into the edge function reveals that it uses a threshold in the final outcome. Why is this done?
Also, a parameter called cutoff is created as follows (edge.m line number - 412) cutoff = scale*mean2(b); Why is the mean calculated and cutoff estimated from it?
The comments above it (edge.m line 407) says % determine the threshold; see page 514 of "Digital Imaging Processing" by William K. Pratt". I looked up in the third edition of the book but didnt find anything relevant there. Can you please provide some reference on the Sobel operation in this regard.
Also the function goes on to use computeedge function (edge.m line number - 419). Typing "help computeedge" does not provide any documentation as to what is happening in this function.
Request you to kindly provide more information.
Thanks & Regards,
Mazhar
1 Kommentar
Royi Avital
am 14 Sep. 2019
Have you found anythong on it?
Antworten (1)
Image Analyst
am 20 Okt. 2015
imgradient will give you the unthresholded image:
grayImage = imread('coins.png');
% Calculate gradients and display.
[Gmag, Gdir] = imgradient(grayImage,'sobel');
imshowpair(Gmag, Gdir, 'montage');
title('Gradient Magnitude, Gmag (left), and Gradient Direction, Gdir (right), using Prewitt method')
axis on;
Kategorien
Mehr zu Object Analysis finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!