Content deleted Content added
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5 |
|||
(11 intermediate revisions by 9 users not shown) | |||
Line 177:
:<math>\theta = \operatorname{atan2}(L_y, L_x).</math>
Other first-order difference operators for estimating image gradient have been proposed in the [[Prewitt operator]], [[Roberts cross]], Kayyali<ref>{{Cite journal|last1=Dim|first1=Jules R.|last2=Takamura|first2=Tamio|date=2013-12-11|title=Alternative Approach for Satellite Cloud Classification: Edge Gradient Application|journal=Advances in Meteorology|language=en|volume=2013|issue=1 |pages=1–8|doi=10.1155/2013/584816|issn=1687-9309|doi-access=free|bibcode=2013AdMet201384816D }}</ref> operator and [[Frei–Chen operator]].
It is possible to extend filters dimension to avoid the issue of recognizing edge in low [[Signal-to-noise ratio|SNR]] image. The cost of this operation is loss in terms of resolution. Examples are Extended Prewitt 7×7.
Line 188:
A commonly used approach to handle the problem of appropriate thresholds for thresholding is by using [[Adaptive thresholding|thresholding]] with [[hysteresis]]. This method uses multiple thresholds to find edges. We begin by using the upper threshold to find the start of an edge. Once we have a start point, we then trace the path of the edge through the image pixel by pixel, marking an edge whenever we are above the lower threshold. We stop marking our edge only when the value falls below our lower threshold. This approach makes the assumption that edges are likely to be in continuous curves, and allows us to follow a faint section of an edge we have previously seen, without meaning that every noisy pixel in the image is marked down as an edge. Still, however, we have the problem of choosing appropriate thresholding parameters, and suitable thresholding values may vary over the image.
=== Connectivity of gradients without using (high) magnitude thresholds ===
This method finds connected set of pixels having a directional derivative magnitude larger than a fairly small threshold.<ref>{{Cite journal |last1=Pak |first1=Mesut |last2=Bayazit |first2=Ulug |date=2020-07-01 |title=Regional bit allocation with visual attention and distortion sensitivity |url=https://link.springer.com/article/10.1007/s11042-020-08686-z |journal=Multimedia Tools and Applications |language=en |volume=79 |issue=27 |pages=19239–19263 |doi=10.1007/s11042-020-08686-z |issn=1573-7721|url-access=subscription }}</ref> It considers only presence of gradients instead of strength of gradients. After applying a dramatically small threshold (i.e. 5), a binary image is obtained. The morphological opening operation and the morphological closing operation are applied to the binary image to close gaps. Then, the distance transform operation is applied to the binary image to clear the pixels far from the background, so blob-like shapes or other false labeled regions are deleted from the edge map.
=== Edge thinning ===
Edge thinning is a technique used to remove the unwanted spurious points on the edges in an image. This technique is employed after the image has been filtered for noise (using median, Gaussian filter etc.), the edge operator has been applied (like the ones described above, Canny or Sobel) to detect the edges and after the edges have been smoothed using an appropriate threshold value.
This removes all the unwanted points, and if applied carefully, results in one pixel thick edge elements.
Advantages:
Line 206 ⟶ 209:
# Do this in multiple passes, i.e. after the north pass, use the same semi processed image in the other passes and so on.
# Remove a point if:<br />The point has no neighbors in the North (if you are in the north pass, and respective directions for other passes).<br />The point is not the end of a line.<br />The point is isolated.<br />Removing the points will not cause to disconnect its neighbors in any way.
#
The number of passes across direction should be chosen according to the level of accuracy desired.
Line 279 ⟶ 282:
[[Marr–Hildreth algorithm|The Marr-Hildreth edge detector]]<ref>{{Cite book |last=Gonzalez |first=Rafael |title=Digital Image Processing |publisher=Pearson Education |year=2018 |isbn=978-0-13-335672-4 |edition=4th}}</ref> is distinguished by its use of the Laplacian of Gaussian (LoG) operator for edge detection in digital images. Unlike other edge detection methods, the LoG approach combines Gaussian smoothing with second derivative operations, allowing for simultaneous noise reduction and edge enhancement. The key advantage of this method lies in its ability to detect edges at various scales by adjusting the standard deviation of the Gaussian kernel, enabling detection of fine details as well as broader transitions. Moreover, the technique leverages zero-crossing detection on the LoG response to precisely locate edges, offering robustness against noise and maintaining edge continuity. This approach is particularly effective for detecting edges with clear boundaries in images while minimizing false positives due to noise, making it a valuable tool in computer vision applications where accurate edge localization is crucial.
== Code for
Source:<ref>{{Cite web |date=2021-10-11 |title=Edge detection using Prewitt, Scharr and Sobel Operator |url=https://www.geeksforgeeks.org/edge-detection-using-prewitt-scharr-and-sobel-operator/ |access-date=2024-05-08 |website=GeeksforGeeks |language=en-US}}</ref>
=== Edge
<syntaxhighlight lang="matlab" line="1">
% MATLAB code for prewitt
% operator edge detection
k = imread("logo.png");
k = rgb2gray(k);
k1 = double(k);
p_msk = [-1 0 1; -1 0 1; -1 0 1];
kx = conv2(k1, p_msk, 'same');
ky = conv2(k1, p_msk', 'same');
ked = sqrt(kx.^2 + ky.^2);
% display the images.
Line 306 ⟶ 309:
% display the full edge detection.
imtool(abs(ked),[]);
</syntaxhighlight>
=== Edge
<syntaxhighlight lang="matlab" line="1">
% Scharr operator -> edge detection
k = imread("logo.png");
k = rgb2gray(k);
k1 = double(k);
s_msk = [-3 0 3; -10 0 10; -3 0 3];
kx = conv2(k1, s_msk, 'same');
ky = conv2(k1, s_msk', 'same');
ked = sqrt(kx.^2 + ky.^2);
% display the images.
imtool(k,[]);
% display the edge detection along x-axis.
imtool(abs(kx), []);
% display the edge detection along y-axis.
imtool(abs(ky), []);
% display the full edge detection.
imtool(abs(ked), []);
</syntaxhighlight>
=== Edge
<syntaxhighlight lang="matlab" line="1">
% MATLAB code for Sobel operator
% edge detection
k = imread("logo.png");
k = rgb2gray(k);
k1 = double(k);
s_msk = [-1 0 1; -2 0 2; -1 0 1];
kx = conv2(k1, s_msk, 'same');
ky = conv2(k1, s_msk', 'same');
ked = sqrt(kx.^2 + ky.^2);
% display the images.
imtool(k,[]);
% display the edge detection along x-axis.
imtool(abs(kx), []);
% display the edge detection along y-axis.
imtool(abs(ky), []);
%display the full edge detection.▼
imtool(abs(ked),[]);▼
▲% display the full edge detection.
▲imtool(abs(ked), []);
</syntaxhighlight>
Line 369 ⟶ 370:
==References==
<references />
Line 380 ⟶ 378:
*[[:doi:10.5201/ipol.2012.gjmr-lsd|A-contrario line segment detection with code and on-line demonstration]]
* [https://www.mathworks.com/discovery/edge-detection.html Edge detection using MATLAB]
* [http://www.mathworks.com/matlabcentral/fileexchange/48908-accurate-subpixel-edge-___location Subpixel edge detection using Matlab] {{Webarchive|url=https://web.archive.org/web/20211216123504/http://www.mathworks.com/matlabcentral/fileexchange/48908-accurate-subpixel-edge-___location |date=2021-12-16 }}
* [https://photokit.com/tools/effects/edgedetect/ Image Tools Effects - Edgedetect]
* [https://sdk.docutain.com/blogartikel/edge-detection-for-image-processing Edge Detection for Image Processing]
{{DEFAULTSORT:Edge Detection}}
[[Category:Edge detection| ]]
[[Category:Image processing]]
|