Sobel (Edge) function in Matlab and OpenCV sobel operation have different implementations. Can you please provide explanation and reference
이전 댓글 표시
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
Royi Avital
2019년 9월 14일
Have you found anythong on it?
답변 (1개)
Image Analyst
2015년 10월 20일
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;
카테고리
도움말 센터 및 File Exchange에서 Object Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!