SlideShare a Scribd company logo
2
Most read
25
BY
AHMED R. A. SHAMSAN
MOHAMMED ALMOHAMADI
Edge
Detection
lecture 03
part 01
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01
26
Smoothing:
• suppress as much
noise as possible,
without
destroying true
edges
• Method Apply
filters (e.g.,
Gaussian,
median) to
smooth the
image.
Enhancement
• Objective
Improve the
quality of edges
in the image.
• apply
differentiation to
enhance the
quality of edges
• (i.e., sharpening)
Sharpening
emphasizes
edges, making
them more
distinct.
Thresholding
• determine which
edge pixels
should be
discarded as
noise and which
should be
retained (i.e.,
threshold edge
magnitude).
Localization
• determines the
exact edge
location.
• Objective
Precisely locate
the position of an
edge.
Main Steps in Edge Detection
‫الحواف‬ ‫لتتبع‬ ‫الرئيسية‬ ‫الخطوات‬
:
•
Smoothing
:
‫الحقيقية‬ ‫الحواف‬ ‫تدمير‬ ‫دون‬ ،‫الضوضاء‬ ‫من‬ ‫ممكن‬ ‫قدر‬ ‫أكبر‬ ‫من‬ ‫التخلص‬
‫المرشحات‬ ‫تطبيق‬ ‫الطريقة‬
)
،‫المثال‬ ‫سبيل‬ ‫على‬
Gaussian
،
median)
‫الصورة‬ ‫لتنعيم‬
.
•
Enhancement
:
‫جو‬ ‫لتحسين‬ ‫التمايز‬ ‫تطبيق‬ ‫و‬ ‫الصورة‬ ‫في‬ ‫الحواف‬ ‫جودة‬ ‫تحسين‬ ‫الهدف‬
‫دة‬
‫الحواف‬
)
‫الشحذ‬ ‫أي‬
(
‫ا‬ً‫تميز‬ ‫أكثر‬ ‫يجعلها‬ ‫مما‬ ،‫الحواف‬ ‫على‬ ‫الشحذ‬ ‫تركز‬
.
•
Thresholding
:
‫ي‬ ‫وأيها‬ ‫كضوضاء‬ ‫منها‬ ‫التخلص‬ ‫ينبغي‬ ‫التي‬ ‫الحافة‬ ‫البيكسل‬ ‫تحديد‬
‫نبغي‬
‫به‬ ‫اﻻحتفاظ‬
)
‫العتبة‬ ‫حافة‬ ‫مقدار‬ ‫أي‬
.(
•
Localization
:
‫بالضبط‬ ‫الحافة‬ ‫موقع‬ ‫يحدد‬
.
‫الحاف‬ ‫موقع‬ ‫تحديد‬ ‫هو‬ ‫منه‬ ‫الهدف‬ ‫آخر‬ ‫بمعنى‬
‫ة‬
‫بدقة‬
.
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01
27
Main Steps in Edge Detection | [1] Smoothing:
smoothing is a crucial first step in edge detection for images. Here's why:
•Noise Reduction: Images can be corrupted by noise from various sources during capture
or transmission. This noise can manifest as random variations in pixel intensity, making it
difficult to distinguish between actual edges and noise artifacts. Smoothing filters help
suppress this noise by averaging the intensity values of neighboring pixels, creating a more
consistent image.
•Edge Preservation: The key challenge in smoothing for edge detection is to remove
noise while maintaining the sharpness of true edges. These edges represent significant
changes in intensity between adjacent regions in the image. Standard smoothing filters, if
applied too aggressively, can blur edges along with noise, making them difficult to detect
later.
‫التنعيم‬
:
‫خطوة‬
‫أساسية‬
‫ﻓﻲ‬
‫ﻛﺸﻒ‬
‫حواف‬
‫الصور‬
‫التنعيم‬
‫هو‬
‫الخطوة‬
‫اﻷولى‬
‫المهمة‬
‫ﻓﻲ‬
‫عملية‬
‫ﻛﺸﻒ‬
‫الحواف‬
‫للصور‬
.
‫والسبب‬
‫هو‬
:
•
‫إزالة‬
‫التﺸويش‬
:
‫يمكن‬
‫أن‬
‫ﺗتﺄﺛﺮ‬
‫الصور‬
‫بالتﺸويش‬
‫ﻣن‬
‫ﻣصادر‬
‫ﻣختلﻔة‬
‫أﺛناء‬
‫التصويﺮ‬
‫أ‬
‫و‬
‫النقل‬
.
‫يظهﺮ‬
‫هذا‬
‫التﺸويش‬
‫على‬
‫ﺷكل‬
‫اختﻼﻓات‬
‫عﺸوائية‬
‫ﻓﻲ‬
‫ﺷدة‬
‫وحدات‬
‫البكسل‬
)
‫البيكسﻼت‬
(
،
‫ﻣما‬
‫يج‬
‫عل‬
‫ﻣن‬
‫الصعب‬
‫التمييز‬
‫بين‬
‫الحواف‬
‫الحقيقية‬
‫وآﺛار‬
‫التﺸويش‬
.
‫ﺗساعد‬
‫ﻓﻼﺗﺮ‬
‫التنعيم‬
‫على‬
‫ال‬
‫تخلﺺ‬
‫ﻣن‬
‫هذا‬
‫التﺸويش‬
‫عن‬
‫طﺮيق‬
‫حساب‬
‫ﻣتوﺳﻂ‬
‫قيم‬
‫ﺷدة‬
‫وحدات‬
‫البكسل‬
،‫المجاورة‬
‫ﻣما‬
‫يؤدي‬
‫إلى‬
‫إنﺸاء‬
‫ﺻ‬
‫ورة‬
‫أﻛثﺮ‬
‫ﺗماﺳكا‬
.
•
‫حﻔﻆ‬
‫الحواف‬
:
‫يكمن‬
‫التحدي‬
‫الﺮئيسﻲ‬
‫ﻓﻲ‬
‫التنعيم‬
‫لكﺸﻒ‬
‫الحواف‬
‫ﻓﻲ‬
‫إزالة‬
‫التﺸويش‬
‫ﻣﻊ‬
‫الحﻔاظ‬
‫على‬
‫حدة‬
‫الحواف‬
‫الحقيقية‬
.
‫ﺗمثل‬
‫هذه‬
‫الحواف‬
‫ﺗغيﺮات‬
‫ﻛبيﺮة‬
‫ﻓﻲ‬
‫الﺸدة‬
‫بين‬
‫المناطق‬
‫المجاورة‬
‫ﻓ‬
‫ﻲ‬
‫الصورة‬
.
‫يمكن‬
‫أن‬
‫ﺗؤدي‬
‫ﻓﻼﺗﺮ‬
‫التنعيم‬
،‫القياﺳية‬
‫إذا‬
‫ﺗم‬
‫ﺗطبيقها‬
‫بﺸكل‬
،‫ﻣﻔﺮط‬
‫إلى‬
‫ﺗﺸويش‬
‫الح‬
‫واف‬
‫ا‬ً‫ب‬‫ﺟن‬
‫إلى‬
‫ﺟنب‬
‫ﻣﻊ‬
،‫التﺸويش‬
‫ﻣما‬
‫يجعل‬
‫ﻣن‬
‫الصعب‬
‫اﻛتﺸاﻓها‬
‫ا‬ً‫ق‬‫ﻻح‬
.
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01
28
Main Steps in Edge Detection | [1] Smoothing:
How Filtering Achieves Smoothing:
To achieve noise reduction while preserving edges, image processing employs various filters. Here are
two common examples:
•Gaussian Filter: This filter uses a bell-shaped kernel that assigns higher weights to pixels closer to the
center and lower weights to those further away. This effectively creates a weighted average, smoothing
the image while reducing the impact on sharp edges due to the emphasis on central pixels.
•Median Filter: This non-linear filter replaces a pixel's intensity with the median value of its
neighboring pixels. The median is less susceptible to outliers like noise compared to the average,
making it effective at removing noise without significantly blurring edges.
By applying these filters, the image becomes cleaner, allowing the edge detection algorithm to focus on
the actual intensity variations that represent true edges in the image.
In essence, smoothing prepares the image for edge detection by creating a better foundation for
identifying the significant changes in intensity that define edges. It's like cleaning a dirty window
before looking out to see the world clearly – the smoothing process removes the obscuring noise to
reveal the underlying edges more effectively.
‫ﻛيﻒ‬
‫ﺗحﻘﻖ‬
‫الﻔﻼﺗر‬
‫التنعيم؟‬
‫لتحقيق‬
‫إزالة‬
‫التﺸويش‬
‫ﻣﻊ‬
‫الحﻔاظ‬
‫على‬
،‫الحواف‬
‫ﺗستخدم‬
‫ﻣعالجة‬
‫الصور‬
‫ﻓﻼﺗﺮ‬
‫ﻣختلﻔة‬
.
‫إليك‬
‫ﻣثاﻻن‬
‫ﺷائعان‬
:
•
‫ﻓﻠتر‬
‫غاوسﻲ‬
)
Gaussian Filter):
‫يستخدم‬
‫هذا‬
‫الﻔلتﺮ‬
‫نواة‬
‫على‬
‫ﺷكل‬
‫ﺟﺮس‬
)
‫ﻣثل‬
‫ﺷكل‬
‫ﺗوزيﻊ‬
‫ﺟاوﺳﻲ‬
(
‫يعطﻲ‬
‫أوز‬
‫ا‬ً‫ن‬‫ا‬
‫أعلى‬
‫للبكسﻼت‬
‫اﻷقﺮب‬
‫إلى‬
‫المﺮﻛز‬
‫ا‬ً‫ن‬‫وأوزا‬
‫أقل‬
‫للبكسﻼت‬
‫البعيدة‬
.
‫يؤدي‬
‫هذا‬
‫ا‬ً‫ي‬‫ﻓعل‬
‫إلى‬
‫إنﺸاء‬
‫ﻣتوﺳﻂ‬
‫ﻣ‬
،‫ﺮﺟﺢ‬
‫ﻣما‬
‫يؤدي‬
‫إلى‬
‫ﺗنعيم‬
‫الصورة‬
‫ﻣﻊ‬
‫ﺗقليل‬
‫التﺄﺛيﺮ‬
‫على‬
‫الحواف‬
‫الحادة‬
‫بسبب‬
‫التﺮﻛيز‬
‫على‬
‫وحدات‬
‫البكسل‬
‫المﺮﻛزية‬
.
•
‫ﻓﻠتر‬
‫الوسيط‬
)
Median Filter):
‫يستبدل‬
‫هذا‬
‫الﻔلتﺮ‬
‫غيﺮ‬
‫الخطﻲ‬
‫ﺷدة‬
‫البكسل‬
‫بالقيمة‬
‫الوﺳطى‬
)
‫الوﺳﻂ‬
‫الحساب‬
‫ﻲ‬
(
‫لوحدات‬
‫البكسل‬
‫المجاورة‬
‫له‬
.
‫الوﺳﻂ‬
‫الحسابﻲ‬
‫أقل‬
‫ﺗﺄﺛﺮا‬
‫بالقيم‬
‫المتطﺮﻓة‬
‫ﻣثل‬
‫التﺸويش‬
‫ﻣقارنة‬
‫بالمتوﺳﻂ‬
،‫العادي‬
‫ﻣما‬
‫يجعله‬
‫ﻓعاﻻ‬
‫ﻓﻲ‬
‫إزالة‬
‫التﺸويش‬
‫دون‬
‫ﺗﺸويش‬
‫الحواف‬
‫بﺸكل‬
‫ﻣلحوظ‬
.
‫عن‬
‫طﺮيق‬
‫ﺗطبيق‬
‫هذه‬
،‫الﻔﻼﺗﺮ‬
‫ﺗصبﺢ‬
‫الصورة‬
‫أﻛثﺮ‬
،‫نظاﻓة‬
‫ﻣما‬
‫يسمﺢ‬
‫لخوارزﻣية‬
‫ﻛﺸﻒ‬
‫الحواف‬
‫بالتﺮﻛيز‬
‫على‬
‫التباينات‬
‫الﻔعلية‬
‫ﻓﻲ‬
‫الﺸدة‬
‫التﻲ‬
‫ﺗمثل‬
‫الحواف‬
‫الحقيقية‬
‫ﻓﻲ‬
‫الصورة‬
.
،‫باختصار‬
‫يعمل‬
‫التنعيم‬
‫على‬
‫ﺗحضيﺮ‬
‫الصورة‬
‫لكﺸﻒ‬
‫الحواف‬
‫عن‬
‫طﺮيق‬
‫إنﺸاء‬
‫أﺳاس‬
‫أﻓضل‬
‫لتحديد‬
‫التغييﺮات‬
‫المهمة‬
‫ﻓ‬
‫ﻲ‬
‫الﺸدة‬
‫التﻲ‬
‫ﺗحدد‬
‫الحواف‬
.
‫إنه‬
‫ﻣثل‬
‫ﺗنظيﻒ‬
‫ناﻓذة‬
‫ﻣتسخة‬
‫قبل‬
‫النظﺮ‬
‫إلى‬
‫الخارج‬
‫لﺮؤية‬
‫العالم‬
‫بوضوح‬
-
‫حيث‬
‫ﺗزيل‬
‫عملية‬
‫التنعيم‬
‫التﺸويش‬
‫الذي‬
‫يحجب‬
‫الﺮؤية‬
‫لتكﺸﻒ‬
‫الحواف‬
‫اﻷﺳاﺳية‬
‫بﺸكل‬
‫أﻛثﺮ‬
‫ﻓعالية‬
.
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01
29
Enhancement: Sharpening Up Edges in Image Processing
Smoothing prepares the image for edge detection, but it might leave some edges a little
weak. Enhancement is the second step in the process, and its goal is to make those edges
more prominent for easier detection.
Why Enhance Edges?
•Improved Edge Quality: Unlike smoothing which focuses on noise removal, enhancement
aims to amplify the sharp changes in intensity that define edges. Imagine a faint line
separating two regions in an image. Enhancement strengthens this contrast, making the line
(the edge) stand out more.
How Does Enhancement Work?
The primary tool for enhancement in edge detection is differentiation. Differentiation
calculates the difference in intensity between neighboring pixels. In areas with an edge, there
will be a significant difference in intensity between pixels on either side of the edge. By
applying differentiation, these variations are amplified, making the edges more pronounced.
‫ﺗعزيز‬
‫الحواف‬
:
‫إبراز‬
‫التﻔاصيل‬
‫ﻓﻲ‬
‫ﻣعالﺠة‬
‫الصور‬
‫بعد‬
‫ﺗنعيم‬
‫الصورة‬
‫للتخلﺺ‬
‫ﻣن‬
‫التﺸويش‬
‫والحﻔاظ‬
‫على‬
‫حواﻓها‬
،‫اﻷﺻلية‬
‫ﺗﺄﺗﻲ‬
‫خطوة‬
‫ﻣهمة‬
‫أخﺮى‬
‫وهﻲ‬
‫ﺗعزيز‬
‫الحواف‬
.
‫يهدف‬
‫ﺗ‬
‫عزيز‬
‫الحواف‬
‫إلى‬
‫ﺗحسين‬
‫وضوح‬
‫حواف‬
‫الصورة‬
‫حتى‬
‫يسهل‬
‫على‬
‫خوارزﻣية‬
‫الكﺸﻒ‬
‫اﻛتﺸاﻓها‬
‫ا‬ً‫ق‬‫ﻻح‬
.
‫لماذا‬
‫نﻘوم‬
‫بتعزيز‬
‫الحواف؟‬
•
‫ﺗحسين‬
‫جودة‬
‫الحواف‬
:
‫على‬
‫عكﺲ‬
‫التنعيم‬
‫الذي‬
‫يﺮﻛز‬
‫على‬
‫إزالة‬
،‫التﺸويش‬
‫يﺮﻛز‬
‫ﺗعزيز‬
‫الحواف‬
‫على‬
‫ﺟعل‬
‫التغييﺮ‬
‫ات‬
‫الحادة‬
‫ﻓﻲ‬
‫ﺷدة‬
‫وحدات‬
‫البكسل‬
)
‫البيكسﻼت‬
(
‫أﻛثﺮ‬
‫ا‬ً‫ح‬‫وضو‬
.
‫ﺗخيل‬
‫وﺟود‬
‫خﻂ‬
‫ﻓاﺻل‬
‫بين‬
‫ﻣنطقتين‬
‫ﻓﻲ‬
،‫الصورة‬
‫يعمل‬
‫ﺗعزيز‬
‫ا‬
‫لحواف‬
‫على‬
‫ﺗقوية‬
‫هذا‬
‫التباين‬
‫بحيث‬
‫يظهﺮ‬
‫الخﻂ‬
)
‫الحاﻓة‬
(
‫بﺸكل‬
‫أوضﺢ‬
.
‫ﻛيﻒ‬
‫يعمل‬
‫ﺗعزيز‬
‫الحواف؟‬
‫اﻷداة‬
‫الﺮئيسية‬
‫المستخدﻣة‬
‫ﻓﻲ‬
‫ﺗعزيز‬
‫الحواف‬
‫هﻲ‬
‫التﻔاضل‬
.
‫يقوم‬
‫التﻔاضل‬
‫بحساب‬
‫الﻔﺮق‬
‫ﻓﻲ‬
‫ﺷدة‬
‫وحدات‬
‫البكسل‬
‫المجاور‬
‫ة‬
.
‫ﻓﻲ‬
‫المناطق‬
‫التﻲ‬
‫ﺗحتوي‬
‫على‬
،‫حاﻓة‬
‫ﺳيكون‬
‫هناك‬
‫ﻓﺮق‬
‫ﻛبيﺮ‬
‫ﻓﻲ‬
‫ﺷدة‬
‫وحدات‬
‫البكسل‬
‫على‬
‫ﺟانبﻲ‬
‫الحاﻓة‬
.
‫ﻣن‬
‫خﻼل‬
‫ﺗطبيق‬
،‫التﻔاضل‬
‫يتم‬
‫زيادة‬
‫ه‬
‫ذه‬
،‫اﻻختﻼﻓات‬
‫ﻣما‬
‫يجعل‬
‫الحواف‬
‫أﻛثﺮ‬
‫ا‬ً‫بﺮوز‬
.
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01
30
Sharpening:A Common Enhancement Technique
A popular enhancement technique is sharpening. Sharpening works by emphasizing the
difference in intensity between adjacent pixels in areas where an edge is likely present. It's
like adjusting the contrast in a specific area to make details pop out more.
Why is Enhancement Important?
Some edges might be subtle or weak after smoothing. Enhancement strengthens these
edges, making them more distinct for the edge detection algorithm in the next step. This
leads to a more accurate detection of the actual edges present in the image.
In Summary:
Enhancement complements smoothing. While smoothing removes noise, enhancement
highlights the variations that represent true edges. Together, these steps improve the image
quality and prepare it for the final stage of edge detection – pinpointing the exact location
of the edges.
‫التوضيح‬
:
‫طريﻘة‬
‫ﺷاﺋعة‬
‫لتعزيز‬
‫الحواف‬
‫إحدى‬
‫الطﺮق‬
‫الﺸائعة‬
‫لتعزيز‬
‫الحواف‬
‫هﻲ‬
‫التوضيح‬
.
‫يعمل‬
‫التوضيﺢ‬
‫عن‬
‫طﺮيق‬
‫زيادة‬
‫الﻔﺮق‬
‫ﻓﻲ‬
‫ﺷدة‬
‫وحدات‬
‫البكسل‬
‫المجاورة‬
‫ﻓﻲ‬
‫المناطق‬
‫التﻲ‬
‫حتمل‬ُ‫ي‬
‫أن‬
‫ﺗكون‬
‫ﻓيها‬
‫حاﻓة‬
.
‫يﺸبه‬
‫هذا‬
‫إلى‬
‫حد‬
‫ﻣا‬
‫زيادة‬
‫التباين‬
‫ﻓﻲ‬
‫ﻣنطقة‬
‫ﻣعينة‬
‫ﻣن‬
‫الصورة‬
‫ﻹبﺮاز‬
‫التﻔاﺻيل‬
‫بﺸكل‬
‫أﻓضل‬
.
‫لماذا‬
‫يعد‬
‫ﺗعزيز‬
‫الحواف‬
‫ا؟‬ً‫م‬‫ﻣه‬
‫قد‬
‫ﺗكون‬
‫بعﺾ‬
‫الحواف‬
‫ضعيﻔة‬
‫أو‬
‫غيﺮ‬
‫واضحة‬
‫بعد‬
‫عملية‬
‫التنعيم‬
.
‫يعمل‬
‫ﺗعزيز‬
‫الحواف‬
‫على‬
‫ﺗقوية‬
‫هذه‬
‫ال‬
‫حواف‬
‫حتى‬
‫يسهل‬
‫على‬
‫خوارزﻣية‬
‫الكﺸﻒ‬
‫عن‬
‫الحواف‬
‫اﻛتﺸاﻓها‬
‫ﻓﻲ‬
‫الخطوة‬
‫التالية‬
.
‫وهذا‬
‫يؤدي‬
‫ﻓﻲ‬
‫النهاية‬
‫إلى‬
‫اﻛتﺸاف‬
‫أﻛثﺮ‬
‫دقة‬
‫للحواف‬
‫الحقيقية‬
‫الموﺟودة‬
‫ﻓﻲ‬
‫الصورة‬
.
‫باختصار‬
:
‫يعمل‬
‫ﺗعزيز‬
‫الحواف‬
‫ا‬ً‫ب‬‫ﺟن‬
‫إلى‬
‫ﺟنب‬
‫ﻣﻊ‬
‫التنعيم‬
.
‫بينما‬
‫يﺮﻛز‬
‫التنعيم‬
‫على‬
‫إزالة‬
،‫التﺸويش‬
‫يﺮﻛز‬
‫ﺗعز‬
‫يز‬
‫الحواف‬
‫على‬
‫إبﺮاز‬
‫التباينات‬
‫التﻲ‬
‫ﺗمثل‬
‫الحواف‬
‫الحقيقية‬
.
،‫ا‬ً‫ع‬‫ﻣ‬
‫ﺗساهم‬
‫ﻛلتا‬
‫الخطوﺗين‬
‫ﻓﻲ‬
‫ﺗحسين‬
‫ﺟودة‬
‫الصورة‬
‫وﺗحضيﺮها‬
‫للخطوة‬
‫النهائية‬
‫ﻓﻲ‬
‫عملية‬
‫ﻛﺸﻒ‬
‫الحواف‬
-
‫وهﻲ‬
‫ﺗحديد‬
‫ﻣوقﻊ‬
‫الحواف‬
‫الﻔعلﻲ‬
.
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01
31
Main Steps in Edge Detection | [3] Thresholding
Thresholding: Making the Cut in Edge Detection
After smoothing and enhancement, we've prepped the image for edge detection. But there
can still be faint edges or noise masquerading as edges. Thresholding, the third step, tackles
this by deciding which intensity changes truly represent edges.
The Goal of Thresholding:
•Separating Edges from Noise: The image might have weak variations in intensity that
aren't actual edges. Thresholding helps distinguish these "pseudo-edges" from real edges
with a significant intensity change.
How Does Thresholding Work?
Imagine the image's intensity values plotted on a graph. Ideally, edges show up as sharp
peaks or dips. Thresholding sets a specific intensity value (the threshold) as a cut-off point.
•Pixels Above the Threshold: Any pixel with an intensity value higher than the threshold is
considered a strong edge candidate and is likely to be a real edge.
•Pixels Below the Threshold: Conversely, pixels with an intensity value lower than the
threshold are considered weak edges or noise and are often discarded.
‫ﺗحديد‬
‫العتبة‬
:
‫رسم‬
‫الخط‬
‫الﻔاصل‬
‫ﻓﻲ‬
‫ﻛﺸﻒ‬
‫الحواف‬
‫بعد‬
‫التنعيم‬
،‫والتعزيز‬
‫قمنا‬
‫بتجهيز‬
‫الصورة‬
‫لكﺸﻒ‬
‫الحواف‬
.
‫ولكن‬
‫ﻻ‬
‫يزال‬
‫ﻣن‬
‫الممكن‬
‫وﺟود‬
‫حواف‬
‫خاﻓتة‬
‫أو‬
‫ﺗﺸويش‬
‫يظهﺮ‬
‫ع‬
‫لى‬
‫أنه‬
‫حواف‬
.
‫ﺗتولى‬
‫عملية‬
‫ﺗحديد‬
،‫العتبة‬
‫وهﻲ‬
‫الخطوة‬
،‫الثالثة‬
‫ﻣعالجة‬
‫هذه‬
‫المسﺄلة‬
‫عن‬
‫طﺮيق‬
‫ﺗحديد‬
‫أي‬
‫ﻣن‬
‫ﺗغيﺮات‬
‫الﺸدة‬
‫ﺗمثل‬
‫ا‬ً‫ﻓ‬‫حوا‬
‫ح‬
‫قيقية‬
.
‫هدف‬
‫ﺗحديد‬
‫العتبة‬
:
•
‫ﻓصل‬
‫الحواف‬
‫ﻋن‬
‫التﺸويش‬
:
‫قد‬
‫ﺗحتوي‬
‫الصورة‬
‫على‬
‫اختﻼﻓات‬
‫ضعيﻔة‬
‫ﻓﻲ‬
‫الﺸدة‬
‫ﻻ‬
‫ﺗمثل‬
‫ا‬ً‫ﻓ‬‫حوا‬
‫ﻓعلية‬
.
‫يساع‬
‫د‬
‫ﺗحديد‬
‫العتبة‬
‫على‬
‫التمييز‬
‫بين‬
‫هذه‬
"
‫الحواف‬
‫الزائﻔة‬
"
‫والحواف‬
‫الحقيقية‬
‫التﻲ‬
‫ﺗتميز‬
‫بتغييﺮ‬
‫ﻛبيﺮ‬
‫ﻓﻲ‬
‫الﺸدة‬
.
‫ﻛيﻒ‬
‫يعمل‬
‫ﺗحديد‬
‫العتبة؟‬
‫ﺗخيل‬
‫قيم‬
‫ﺷدة‬
‫الصورة‬
‫ﻣﺮﺳوﻣة‬
‫على‬
‫رﺳم‬
‫بيانﻲ‬
.
‫ﻣن‬
‫الناحية‬
،‫المثالية‬
‫ﺗظهﺮ‬
‫الحواف‬
‫على‬
‫ﺷكل‬
‫ذروات‬
‫أو‬
‫انخﻔ‬
‫اضات‬
‫حادة‬
.
‫يحدد‬
‫ﺗحديد‬
‫العتبة‬
‫قيمة‬
‫ﺷدة‬
‫ﻣعينة‬
)
‫العتبة‬
(
‫ﻛنقطة‬
‫ﻓاﺻلة‬
.
•
‫البيكسﻼت‬
‫أﻋﻠى‬
‫ﻣن‬
‫العتبة‬
:
‫أي‬
‫بكسل‬
‫بقيمة‬
‫ﺷدة‬
‫أﻋﻠى‬
‫ﻣن‬
‫العتبة‬
‫يعتبﺮ‬
‫ا‬ً‫ح‬‫ﻣﺮﺷ‬
‫ا‬ً‫ي‬‫قو‬
‫للحاﻓة‬
‫وﻣن‬
‫المح‬
‫تمل‬
‫أن‬
‫يكون‬
‫حاﻓة‬
‫حقيقية‬
.
•
‫البيكسﻼت‬
‫أقل‬
‫ﻣن‬
‫العتبة‬
:
،‫بالعكﺲ‬
‫ﺗعتبﺮ‬
‫البكسﻼت‬
‫التﻲ‬
‫ﺗحتوي‬
‫على‬
‫قيمة‬
‫ﺷدة‬
‫أقل‬
‫ﻣن‬
‫العتبة‬
ً‫ﻓ‬‫حوا‬
‫ا‬
‫ضعيﻔة‬
‫أو‬
‫ا‬ً‫ﺸ‬‫ﺗﺸوي‬
‫ا‬ً‫ب‬‫وغال‬
‫يتم‬
‫ﺗجاهلها‬
.
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01
32
Main Steps in Edge Detection | [3] Thresholding
Choosing the Right Threshold:
Selecting the perfect threshold can be tricky. A high threshold might miss subtle edges, while
a low threshold might include too much noise. It often involves experimentation to find the
best balance for the specific image.
Why is Thresholding Important?
Thresholding helps us focus on the most likely edge pixels and avoid getting bogged down
by insignificant intensity variations. It streamlines the edge detection process and provides a
clearer picture of the actual edges present in the image.
In Summary:
Thresholding acts like a filter, separating the wheat from the chaff. It helps us discard noise
and weak edges while retaining strong intensity changes that represent true edges in the
image. This paves the way for the final step – precisely locating these edges for further
analysis.
‫اختيار‬
‫العتبة‬
‫الصحيحة‬
:
‫يمكن‬
‫أن‬
‫يكون‬
‫اختيار‬
‫العتبة‬
‫المثالية‬
‫عملية‬
‫ﺻعبة‬
.
‫قد‬
‫ﺗﻔوت‬
‫العتبة‬
‫العالية‬
‫الحواف‬
،‫الخﻔية‬
‫بينما‬
‫قد‬
‫ﺗتضمن‬
‫العت‬
‫بة‬
‫المنخﻔضة‬
‫الكثيﺮ‬
‫ﻣن‬
‫التﺸويش‬
.
‫ا‬ً‫ب‬‫وغال‬
‫ﻣا‬
‫يتطلب‬
‫اﻷﻣﺮ‬
‫التجﺮبة‬
‫للعثور‬
‫على‬
‫أﻓضل‬
‫ﺗوازن‬
‫للصورة‬
‫المحددة‬
.
‫لماذا‬
‫يعد‬
‫ﺗحديد‬
‫العتبة‬
‫ا؟‬ً‫م‬‫ﻣه‬
‫يساعدنا‬
‫ﺗحديد‬
‫العتبة‬
‫على‬
‫التﺮﻛيز‬
‫على‬
‫وحدات‬
‫البكسل‬
‫اﻷﻛثﺮ‬
ً
‫احتماﻻ‬
‫بﺄن‬
‫ﺗكون‬
‫ا‬ً‫ﻓ‬‫حوا‬
‫وﺗجنب‬
‫اﻻنﺸغال‬
‫بتغيﺮات‬
‫الﺸدة‬
‫غيﺮ‬
‫المهمة‬
.
‫يعمل‬
‫على‬
‫ﺗبسيﻂ‬
‫عملية‬
‫ﻛﺸﻒ‬
‫الحواف‬
‫ويوﻓﺮ‬
‫ﺻورة‬
‫أوضﺢ‬
‫للحواف‬
‫الﻔعلية‬
‫الموﺟودة‬
‫ﻓﻲ‬
‫الصورة‬
.
‫باختصار‬
:
‫يعمل‬
‫ﺗحديد‬
‫العتبة‬
،‫ﻛمﺮﺷﺢ‬
‫يﻔصل‬
‫بين‬
‫القمﺢ‬
‫والزن‬
.
‫يساعدنا‬
‫على‬
‫التخلﺺ‬
‫ﻣن‬
‫التﺸويش‬
‫والحواف‬
‫الضعيﻔة‬
‫ﻣﻊ‬
‫الحﻔ‬
‫اظ‬
‫على‬
‫التغييﺮات‬
‫القوية‬
‫ﻓﻲ‬
‫الﺸدة‬
‫التﻲ‬
‫ﺗمثل‬
‫ا‬ً‫ﻓ‬‫حوا‬
‫حقيقية‬
‫ﻓﻲ‬
‫الصورة‬
.
‫وهذا‬
‫يمهد‬
‫الطﺮيق‬
‫للخطوة‬
‫اﻷخيﺮة‬
-
‫ﺗحديد‬
‫ﻣوقﻊ‬
‫هذه‬
‫الحواف‬
‫بدق‬
‫ة‬
‫لمزيد‬
‫ﻣن‬
‫التحليل‬
.
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01
33
Main Steps in Edge Detection | [4] Localization
Localization: Pinpointing the Edge on the Map
We've come a long way! After smoothing, enhancement, and thresholding, we have a good
idea of where the edges might be in the image. But the question remains: where exactly are
these edges located? Localization, the final step in edge detection, tackles this by precisely
determining the sub-pixel position of each edge.
The Goal of Localization:
•Sub-Pixel Accuracy: Thresholding gives us a general idea of the edge's presence.
Localization refines this by pinpointing the exact location within a pixel. Imagine a pixel as
a tiny square. Localization helps us determine where the edge falls within that square, not
just whether it's present somewhere in the pixel.
Why Sub-Pixel Accuracy Matters?
A precise edge location is crucial for various applications. For instance, in self-driving cars,
accurate edge detection of lanes and obstacles is vital for safe navigation. A slight
miscalculation in the edge location could have significant consequences.
‫ﺗحديد‬
‫الموقع‬
:
‫وضع‬
‫إصبعك‬
‫ﻋﻠى‬
‫الحاﻓة‬
‫ا‬ً‫ﻣ‬‫ﺗما‬
‫لقد‬
‫قطعنا‬
‫ا‬ً‫ط‬‫ﺷو‬
ً‫ﻼ‬‫طوي‬
!
‫بعد‬
‫التنعيم‬
‫والتعزيز‬
‫وﺗحديد‬
،‫العتبة‬
‫أﺻبﺢ‬
‫لدينا‬
‫ﻓكﺮة‬
‫ﺟيدة‬
‫عن‬
‫أﻣاﻛن‬
‫وﺟود‬
‫ال‬
‫حواف‬
‫ﻓﻲ‬
‫الصورة‬
.
‫لكن‬
‫السؤال‬
‫المطﺮوح‬
:
‫أين‬
‫ﺗقﻊ‬
‫هذه‬
‫الحواف‬
‫بالضبﻂ؟‬
‫ﺗحديد‬
‫الموقع‬
:
‫هﻲ‬
‫الخطوة‬
‫اﻷخيﺮة‬
‫ﻓﻲ‬
‫ﻛﺸﻒ‬
،‫الحواف‬
‫ﺗعالﺞ‬
‫هذه‬
‫المسﺄلة‬
‫عن‬
‫طﺮيق‬
‫ﺗحديد‬
‫ﻣوضﻊ‬
‫البكسل‬
‫الﻔﺮعﻲ‬
)
‫أﺟزاء‬
‫ﻣن‬
‫البك‬
‫سل‬
(
‫لكل‬
‫حاﻓة‬
‫بدقة‬
.
‫هدف‬
‫ﺗحديد‬
‫الموقع‬
:
•
‫دقة‬
‫البكسل‬
‫الﻔرﻋﻲ‬
:
‫يمنحنا‬
‫ﺗحديد‬
‫العتبة‬
‫ﻓكﺮة‬
‫عاﻣة‬
‫عن‬
‫وﺟود‬
‫الحاﻓة‬
.
‫يقوم‬
‫ﺗحديد‬
‫الموقﻊ‬
‫بتحسين‬
‫ذلك‬
‫عن‬
‫طﺮيق‬
‫ﺗ‬
‫حديد‬
‫الموقﻊ‬
‫الدقيق‬
‫ضمن‬
‫البكسل‬
.
‫ﺗخيل‬
‫البكسل‬
‫ﻛمﺮبﻊ‬
‫ﺻغيﺮ‬
.
‫يساعدنا‬
‫ﺗحديد‬
‫الموقﻊ‬
‫على‬
‫ﺗحديد‬
‫ﻣكان‬
‫ﺳقوط‬
‫الحاﻓة‬
‫داخل‬
‫ذلك‬
،‫المﺮبﻊ‬
‫وليﺲ‬
‫ﻓقﻂ‬
‫ﻣا‬
‫إذا‬
‫ﻛانﺖ‬
‫ﻣوﺟودة‬
‫ﻓﻲ‬
‫ﻣكان‬
‫ﻣا‬
‫داخل‬
‫البكسل‬
.
‫لماذا‬
‫ﺗعد‬
‫دقة‬
‫البكسل‬
‫الﻔرﻋﻲ‬
‫ﻣهمة؟‬
‫يعد‬
‫ﺗحديد‬
‫ﻣوقﻊ‬
‫الحاﻓة‬
‫بدقة‬
‫أﻣﺮا‬
‫ا‬ً‫ي‬‫ضﺮور‬
‫لتطبيقات‬
‫ﻣختلﻔة‬
.
‫على‬
‫ﺳبيل‬
،‫المثال‬
‫ﻓﻲ‬
‫السيارات‬
‫ذاﺗية‬
،‫القيادة‬
‫يعد‬
‫ﻛﺸﻒ‬
‫حواف‬
‫المسارات‬
‫والعوائق‬
‫بدقة‬
‫أﻣﺮا‬
‫حيويا‬
‫للمﻼحة‬
‫اﻵﻣنة‬
.
‫يمكن‬
‫أن‬
‫يؤدي‬
‫ﺳوء‬
‫التقديﺮ‬
‫البسيﻂ‬
‫ﻓﻲ‬
‫ﺗحديد‬
‫ﻣوقﻊ‬
‫الحاﻓة‬
‫إلى‬
‫عواقب‬
‫وخيمة‬
.
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01
34
Main Steps in Edge Detection | [4] Localization
How Does Localization Work?
There are various techniques for localization, but a common approach involves analyzing the
intensity values of pixels around the suspected edge. By examining the intensity gradient (the
rate of change in intensity), the exact location of the sharp transition (the edge) can be
pinpointed with greater accuracy.
Beyond Simple Edges:
Localization isn't just about straight lines. It can also determine the orientation and curvature of
more complex edges, providing a more detailed picture of the image's structure.
Why is Localization Important?
Localization takes edge detection a step further, transforming a general idea of "edge present"
into a precise location. This refined information is essential for many image-processing tasks
and computer vision applications.
In Summary:
Localization acts like a magnifying glass, zooming in on the suspected edge region and
precisely determining its location within a pixel. This sub-pixel accuracy provides valuable
information for further analysis and tasks that rely on accurate edge detection.
‫ﻛيﻒ‬
‫يعمل‬
‫ﺗحديد‬
‫الموقع؟‬
‫هناك‬
‫ﺗقنيات‬
‫ﻣختلﻔة‬
‫لتحديد‬
،‫الموقﻊ‬
‫ولكن‬
‫النهﺞ‬
‫الﺸائﻊ‬
‫ينطوي‬
‫على‬
‫ﺗحليل‬
‫قيم‬
‫ﺷدة‬
‫وحدات‬
‫البكسل‬
‫حول‬
‫الحاﻓة‬
‫المﺸتب‬
‫ه‬
‫بها‬
.
‫ﻣن‬
‫خﻼل‬
‫ﻓحﺺ‬
‫ﺗدرج‬
‫الﺸدة‬
)
‫ﻣعدل‬
‫ﺗغيﺮ‬
‫الﺸدة‬
(
،
‫يمكن‬
‫ﺗحديد‬
‫الموقﻊ‬
‫الدقيق‬
‫لﻼنتقال‬
‫الحاد‬
)
‫الحاﻓة‬
(
‫بدقة‬
‫أﻛبﺮ‬
.
‫أﻛثر‬
‫ﻣن‬
‫ﻣﺠرد‬
‫حواف‬
‫بسيطة‬
:
‫ﻻ‬
‫يقتصﺮ‬
‫ﺗحديد‬
‫الموقﻊ‬
‫على‬
‫الخطوط‬
‫المستقيمة‬
‫ﻓقﻂ‬
.
‫ﻛما‬
‫يمكنه‬
‫ﺗحديد‬
‫اﺗجاه‬
‫وانحناء‬
‫الحواف‬
‫اﻷﻛثﺮ‬
،‫ًا‬‫د‬‫ﺗعقي‬
‫ﻣما‬
‫يوﻓﺮ‬
‫ﺻ‬
‫ورة‬
‫أﻛثﺮ‬
‫ﺗﻔصيﻼ‬
‫لبنية‬
‫الصورة‬
.
‫لماذا‬
‫يعد‬
‫ﺗحديد‬
‫الموقع‬
‫ا؟‬ً‫م‬‫ﻣه‬
‫يﺮﻓﻊ‬
‫ﺗحديد‬
‫الموقﻊ‬
‫ﻛﺸﻒ‬
‫الحواف‬
‫إلى‬
‫ﻣستوى‬
،‫أعلى‬
‫حيث‬
‫يحول‬
‫الﻔكﺮة‬
‫العاﻣة‬
‫عن‬
"
‫وﺟود‬
‫حاﻓة‬
"
‫إلى‬
‫ﻣوقﻊ‬
‫ﻣحدد‬
.
‫ﺗعتبﺮ‬
‫هذه‬
‫الم‬
‫علوﻣات‬
‫الدقيقة‬
‫ضﺮورية‬
‫للعديد‬
‫ﻣن‬
‫ﻣهام‬
‫ﻣعالجة‬
‫الصور‬
‫وﺗطبيقات‬
‫رؤية‬
‫الحاﺳوب‬
.
‫باختصار‬
:
‫يعمل‬
‫ﺗحديد‬
‫الموقﻊ‬
‫ﻛعدﺳة‬
،‫ﻣكبﺮة‬
‫حيث‬
‫يقﺮب‬
‫ﻣنطقة‬
‫الحاﻓة‬
‫المﺸتبه‬
‫بها‬
‫ويحدد‬
‫ﻣوقعها‬
‫بدقة‬
‫داخل‬
‫البكسل‬
.
‫ﺗوﻓﺮ‬
‫د‬
‫قة‬
‫البكسل‬
‫الﻔﺮعﻲ‬
‫هذه‬
‫ﻣعلوﻣات‬
‫قيمة‬
‫لمزيد‬
‫ﻣن‬
‫التحليل‬
‫والمهام‬
‫التﻲ‬
‫ﺗعتمد‬
‫على‬
‫ﻛﺸﻒ‬
‫الحواف‬
‫الدقيق‬
.
AHMED R. A. SHAMSAN & M. MOHAMADI
EDGE DETECTION | LUC01

More Related Content

PDF
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
PDF
Java Based Quantitative Imaging Tool
PPTX
Lecture 3.1.3 Edge Detection.ppfgtx dhjd
PPTX
Computer vision (Image Processing) - Sobel Prewitt Gabor Gaussian Laplacian ...
PPT
Image enhancement
DOC
Seminar report on edge detection of video using matlab code
PPTX
ODP
Image Processing with OpenCV
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
Java Based Quantitative Imaging Tool
Lecture 3.1.3 Edge Detection.ppfgtx dhjd
Computer vision (Image Processing) - Sobel Prewitt Gabor Gaussian Laplacian ...
Image enhancement
Seminar report on edge detection of video using matlab code
Image Processing with OpenCV

Similar to image processing EdgeDetection Luc03 part 01.pdf (20)

PPT
Total_variation image and video processing
PDF
A New Technique of Extraction of Edge Detection Using Digital Image Processing
PDF
A Novel Approach for Edge Detection using Modified ACIES Filtering
PPTX
Digital image processing techniques
PPTX
Adaptive unsharp masking
PDF
Real time Canny edge detection
PPTX
Chap3
PDF
CH-4.pdf image restoration and what are
PDF
Paper id 212014133
PPTX
Image Blur.pptx
PDF
A SURVEY : On Image Denoising and its Various Techniques
PDF
Edge detection.pdf
PPT
Image pre processing - local processing
PDF
GRUPO 4 : new algorithm for image noise reduction
PPTX
Spatial enhancement
PPTX
Clipping path in bd
PPTX
Defocus magnification
PPTX
NOISE FILTERS IN IMAGE PROCESSING
PPTX
image processing using matlab in faculty 1
PPTX
09 cie552 image_featuresi
Total_variation image and video processing
A New Technique of Extraction of Edge Detection Using Digital Image Processing
A Novel Approach for Edge Detection using Modified ACIES Filtering
Digital image processing techniques
Adaptive unsharp masking
Real time Canny edge detection
Chap3
CH-4.pdf image restoration and what are
Paper id 212014133
Image Blur.pptx
A SURVEY : On Image Denoising and its Various Techniques
Edge detection.pdf
Image pre processing - local processing
GRUPO 4 : new algorithm for image noise reduction
Spatial enhancement
Clipping path in bd
Defocus magnification
NOISE FILTERS IN IMAGE PROCESSING
image processing using matlab in faculty 1
09 cie552 image_featuresi
Ad

More from ِِِAhmed R. A. Shamsan (20)

PPTX
Max Pooling and SPPF in YOLOv8 Max Pooling is a common operation in convoluti...
PPTX
introduction to deep learning the components .pptx
PPTX
the CCTV Cameras A Surveillance Overview
PPTX
SEGMENTATION TECHNIQUES__ summarized.PPTX
PPTX
[7] The SiLU Activation Function Unlocking Neural Network Potential.pptx
PPTX
[5] Understanding the YOLOv8 Architecture.pptx
PPTX
[4] - [2] The SIFT Algorithm Unlocking Image Recognition.pptx
PPTX
[4] - [1] The SIFT Algorithm and Its Formulas.pptx
PPTX
Intersection over Union (IoU) COMMAN QUESTIONS IN COMPUTER VISION.pptx
PPT
smoothing filters gaussion and median filters comparing.ppt
PPTX
شرح تفصيلي لهندسة YOLOv8 - انهيار كامل.pptx
PDF
image processing_ Edge Detection Luc02.pdf
PDF
image processing _Edge Detection Luc01.pdf
PDF
digital image enhancement techniques and applcations.pdf
PDF
Image Edge Detection Operators in Digital Image Processing _ L1.pdf
PDF
Intorduction to databases 2021
PDF
PDF
PDF
Computer skills 2019 last edition a
PDF
Ms powerpoint بالعربي شرح ميكروسوفت باوربويت العرض التقديمي
Max Pooling and SPPF in YOLOv8 Max Pooling is a common operation in convoluti...
introduction to deep learning the components .pptx
the CCTV Cameras A Surveillance Overview
SEGMENTATION TECHNIQUES__ summarized.PPTX
[7] The SiLU Activation Function Unlocking Neural Network Potential.pptx
[5] Understanding the YOLOv8 Architecture.pptx
[4] - [2] The SIFT Algorithm Unlocking Image Recognition.pptx
[4] - [1] The SIFT Algorithm and Its Formulas.pptx
Intersection over Union (IoU) COMMAN QUESTIONS IN COMPUTER VISION.pptx
smoothing filters gaussion and median filters comparing.ppt
شرح تفصيلي لهندسة YOLOv8 - انهيار كامل.pptx
image processing_ Edge Detection Luc02.pdf
image processing _Edge Detection Luc01.pdf
digital image enhancement techniques and applcations.pdf
Image Edge Detection Operators in Digital Image Processing _ L1.pdf
Intorduction to databases 2021
Computer skills 2019 last edition a
Ms powerpoint بالعربي شرح ميكروسوفت باوربويت العرض التقديمي
Ad

Recently uploaded (20)

PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
RMMM.pdf make it easy to upload and study
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
Computing-Curriculum for Schools in Ghana
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Trump Administration's workforce development strategy
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PDF
1_English_Language_Set_2.pdf probationary
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
Introduction to Building Materials
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Orientation - ARALprogram of Deped to the Parents.pptx
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
RMMM.pdf make it easy to upload and study
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
History, Philosophy and sociology of education (1).pptx
LDMMIA Reiki Yoga Finals Review Spring Summer
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
Computing-Curriculum for Schools in Ghana
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Final Presentation General Medicine 03-08-2024.pptx
Trump Administration's workforce development strategy
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Weekly quiz Compilation Jan -July 25.pdf
Unit 4 Skeletal System.ppt.pptxopresentatiom
1_English_Language_Set_2.pdf probationary
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Introduction to Building Materials

image processing EdgeDetection Luc03 part 01.pdf

  • 1. 25 BY AHMED R. A. SHAMSAN MOHAMMED ALMOHAMADI Edge Detection lecture 03 part 01 AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01
  • 2. 26 Smoothing: • suppress as much noise as possible, without destroying true edges • Method Apply filters (e.g., Gaussian, median) to smooth the image. Enhancement • Objective Improve the quality of edges in the image. • apply differentiation to enhance the quality of edges • (i.e., sharpening) Sharpening emphasizes edges, making them more distinct. Thresholding • determine which edge pixels should be discarded as noise and which should be retained (i.e., threshold edge magnitude). Localization • determines the exact edge location. • Objective Precisely locate the position of an edge. Main Steps in Edge Detection ‫الحواف‬ ‫لتتبع‬ ‫الرئيسية‬ ‫الخطوات‬ : • Smoothing : ‫الحقيقية‬ ‫الحواف‬ ‫تدمير‬ ‫دون‬ ،‫الضوضاء‬ ‫من‬ ‫ممكن‬ ‫قدر‬ ‫أكبر‬ ‫من‬ ‫التخلص‬ ‫المرشحات‬ ‫تطبيق‬ ‫الطريقة‬ ) ،‫المثال‬ ‫سبيل‬ ‫على‬ Gaussian ، median) ‫الصورة‬ ‫لتنعيم‬ . • Enhancement : ‫جو‬ ‫لتحسين‬ ‫التمايز‬ ‫تطبيق‬ ‫و‬ ‫الصورة‬ ‫في‬ ‫الحواف‬ ‫جودة‬ ‫تحسين‬ ‫الهدف‬ ‫دة‬ ‫الحواف‬ ) ‫الشحذ‬ ‫أي‬ ( ‫ا‬ً‫تميز‬ ‫أكثر‬ ‫يجعلها‬ ‫مما‬ ،‫الحواف‬ ‫على‬ ‫الشحذ‬ ‫تركز‬ . • Thresholding : ‫ي‬ ‫وأيها‬ ‫كضوضاء‬ ‫منها‬ ‫التخلص‬ ‫ينبغي‬ ‫التي‬ ‫الحافة‬ ‫البيكسل‬ ‫تحديد‬ ‫نبغي‬ ‫به‬ ‫اﻻحتفاظ‬ ) ‫العتبة‬ ‫حافة‬ ‫مقدار‬ ‫أي‬ .( • Localization : ‫بالضبط‬ ‫الحافة‬ ‫موقع‬ ‫يحدد‬ . ‫الحاف‬ ‫موقع‬ ‫تحديد‬ ‫هو‬ ‫منه‬ ‫الهدف‬ ‫آخر‬ ‫بمعنى‬ ‫ة‬ ‫بدقة‬ . AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01
  • 3. 27 Main Steps in Edge Detection | [1] Smoothing: smoothing is a crucial first step in edge detection for images. Here's why: •Noise Reduction: Images can be corrupted by noise from various sources during capture or transmission. This noise can manifest as random variations in pixel intensity, making it difficult to distinguish between actual edges and noise artifacts. Smoothing filters help suppress this noise by averaging the intensity values of neighboring pixels, creating a more consistent image. •Edge Preservation: The key challenge in smoothing for edge detection is to remove noise while maintaining the sharpness of true edges. These edges represent significant changes in intensity between adjacent regions in the image. Standard smoothing filters, if applied too aggressively, can blur edges along with noise, making them difficult to detect later. ‫التنعيم‬ : ‫خطوة‬ ‫أساسية‬ ‫ﻓﻲ‬ ‫ﻛﺸﻒ‬ ‫حواف‬ ‫الصور‬ ‫التنعيم‬ ‫هو‬ ‫الخطوة‬ ‫اﻷولى‬ ‫المهمة‬ ‫ﻓﻲ‬ ‫عملية‬ ‫ﻛﺸﻒ‬ ‫الحواف‬ ‫للصور‬ . ‫والسبب‬ ‫هو‬ : • ‫إزالة‬ ‫التﺸويش‬ : ‫يمكن‬ ‫أن‬ ‫ﺗتﺄﺛﺮ‬ ‫الصور‬ ‫بالتﺸويش‬ ‫ﻣن‬ ‫ﻣصادر‬ ‫ﻣختلﻔة‬ ‫أﺛناء‬ ‫التصويﺮ‬ ‫أ‬ ‫و‬ ‫النقل‬ . ‫يظهﺮ‬ ‫هذا‬ ‫التﺸويش‬ ‫على‬ ‫ﺷكل‬ ‫اختﻼﻓات‬ ‫عﺸوائية‬ ‫ﻓﻲ‬ ‫ﺷدة‬ ‫وحدات‬ ‫البكسل‬ ) ‫البيكسﻼت‬ ( ، ‫ﻣما‬ ‫يج‬ ‫عل‬ ‫ﻣن‬ ‫الصعب‬ ‫التمييز‬ ‫بين‬ ‫الحواف‬ ‫الحقيقية‬ ‫وآﺛار‬ ‫التﺸويش‬ . ‫ﺗساعد‬ ‫ﻓﻼﺗﺮ‬ ‫التنعيم‬ ‫على‬ ‫ال‬ ‫تخلﺺ‬ ‫ﻣن‬ ‫هذا‬ ‫التﺸويش‬ ‫عن‬ ‫طﺮيق‬ ‫حساب‬ ‫ﻣتوﺳﻂ‬ ‫قيم‬ ‫ﺷدة‬ ‫وحدات‬ ‫البكسل‬ ،‫المجاورة‬ ‫ﻣما‬ ‫يؤدي‬ ‫إلى‬ ‫إنﺸاء‬ ‫ﺻ‬ ‫ورة‬ ‫أﻛثﺮ‬ ‫ﺗماﺳكا‬ . • ‫حﻔﻆ‬ ‫الحواف‬ : ‫يكمن‬ ‫التحدي‬ ‫الﺮئيسﻲ‬ ‫ﻓﻲ‬ ‫التنعيم‬ ‫لكﺸﻒ‬ ‫الحواف‬ ‫ﻓﻲ‬ ‫إزالة‬ ‫التﺸويش‬ ‫ﻣﻊ‬ ‫الحﻔاظ‬ ‫على‬ ‫حدة‬ ‫الحواف‬ ‫الحقيقية‬ . ‫ﺗمثل‬ ‫هذه‬ ‫الحواف‬ ‫ﺗغيﺮات‬ ‫ﻛبيﺮة‬ ‫ﻓﻲ‬ ‫الﺸدة‬ ‫بين‬ ‫المناطق‬ ‫المجاورة‬ ‫ﻓ‬ ‫ﻲ‬ ‫الصورة‬ . ‫يمكن‬ ‫أن‬ ‫ﺗؤدي‬ ‫ﻓﻼﺗﺮ‬ ‫التنعيم‬ ،‫القياﺳية‬ ‫إذا‬ ‫ﺗم‬ ‫ﺗطبيقها‬ ‫بﺸكل‬ ،‫ﻣﻔﺮط‬ ‫إلى‬ ‫ﺗﺸويش‬ ‫الح‬ ‫واف‬ ‫ا‬ً‫ب‬‫ﺟن‬ ‫إلى‬ ‫ﺟنب‬ ‫ﻣﻊ‬ ،‫التﺸويش‬ ‫ﻣما‬ ‫يجعل‬ ‫ﻣن‬ ‫الصعب‬ ‫اﻛتﺸاﻓها‬ ‫ا‬ً‫ق‬‫ﻻح‬ . AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01
  • 4. 28 Main Steps in Edge Detection | [1] Smoothing: How Filtering Achieves Smoothing: To achieve noise reduction while preserving edges, image processing employs various filters. Here are two common examples: •Gaussian Filter: This filter uses a bell-shaped kernel that assigns higher weights to pixels closer to the center and lower weights to those further away. This effectively creates a weighted average, smoothing the image while reducing the impact on sharp edges due to the emphasis on central pixels. •Median Filter: This non-linear filter replaces a pixel's intensity with the median value of its neighboring pixels. The median is less susceptible to outliers like noise compared to the average, making it effective at removing noise without significantly blurring edges. By applying these filters, the image becomes cleaner, allowing the edge detection algorithm to focus on the actual intensity variations that represent true edges in the image. In essence, smoothing prepares the image for edge detection by creating a better foundation for identifying the significant changes in intensity that define edges. It's like cleaning a dirty window before looking out to see the world clearly – the smoothing process removes the obscuring noise to reveal the underlying edges more effectively. ‫ﻛيﻒ‬ ‫ﺗحﻘﻖ‬ ‫الﻔﻼﺗر‬ ‫التنعيم؟‬ ‫لتحقيق‬ ‫إزالة‬ ‫التﺸويش‬ ‫ﻣﻊ‬ ‫الحﻔاظ‬ ‫على‬ ،‫الحواف‬ ‫ﺗستخدم‬ ‫ﻣعالجة‬ ‫الصور‬ ‫ﻓﻼﺗﺮ‬ ‫ﻣختلﻔة‬ . ‫إليك‬ ‫ﻣثاﻻن‬ ‫ﺷائعان‬ : • ‫ﻓﻠتر‬ ‫غاوسﻲ‬ ) Gaussian Filter): ‫يستخدم‬ ‫هذا‬ ‫الﻔلتﺮ‬ ‫نواة‬ ‫على‬ ‫ﺷكل‬ ‫ﺟﺮس‬ ) ‫ﻣثل‬ ‫ﺷكل‬ ‫ﺗوزيﻊ‬ ‫ﺟاوﺳﻲ‬ ( ‫يعطﻲ‬ ‫أوز‬ ‫ا‬ً‫ن‬‫ا‬ ‫أعلى‬ ‫للبكسﻼت‬ ‫اﻷقﺮب‬ ‫إلى‬ ‫المﺮﻛز‬ ‫ا‬ً‫ن‬‫وأوزا‬ ‫أقل‬ ‫للبكسﻼت‬ ‫البعيدة‬ . ‫يؤدي‬ ‫هذا‬ ‫ا‬ً‫ي‬‫ﻓعل‬ ‫إلى‬ ‫إنﺸاء‬ ‫ﻣتوﺳﻂ‬ ‫ﻣ‬ ،‫ﺮﺟﺢ‬ ‫ﻣما‬ ‫يؤدي‬ ‫إلى‬ ‫ﺗنعيم‬ ‫الصورة‬ ‫ﻣﻊ‬ ‫ﺗقليل‬ ‫التﺄﺛيﺮ‬ ‫على‬ ‫الحواف‬ ‫الحادة‬ ‫بسبب‬ ‫التﺮﻛيز‬ ‫على‬ ‫وحدات‬ ‫البكسل‬ ‫المﺮﻛزية‬ . • ‫ﻓﻠتر‬ ‫الوسيط‬ ) Median Filter): ‫يستبدل‬ ‫هذا‬ ‫الﻔلتﺮ‬ ‫غيﺮ‬ ‫الخطﻲ‬ ‫ﺷدة‬ ‫البكسل‬ ‫بالقيمة‬ ‫الوﺳطى‬ ) ‫الوﺳﻂ‬ ‫الحساب‬ ‫ﻲ‬ ( ‫لوحدات‬ ‫البكسل‬ ‫المجاورة‬ ‫له‬ . ‫الوﺳﻂ‬ ‫الحسابﻲ‬ ‫أقل‬ ‫ﺗﺄﺛﺮا‬ ‫بالقيم‬ ‫المتطﺮﻓة‬ ‫ﻣثل‬ ‫التﺸويش‬ ‫ﻣقارنة‬ ‫بالمتوﺳﻂ‬ ،‫العادي‬ ‫ﻣما‬ ‫يجعله‬ ‫ﻓعاﻻ‬ ‫ﻓﻲ‬ ‫إزالة‬ ‫التﺸويش‬ ‫دون‬ ‫ﺗﺸويش‬ ‫الحواف‬ ‫بﺸكل‬ ‫ﻣلحوظ‬ . ‫عن‬ ‫طﺮيق‬ ‫ﺗطبيق‬ ‫هذه‬ ،‫الﻔﻼﺗﺮ‬ ‫ﺗصبﺢ‬ ‫الصورة‬ ‫أﻛثﺮ‬ ،‫نظاﻓة‬ ‫ﻣما‬ ‫يسمﺢ‬ ‫لخوارزﻣية‬ ‫ﻛﺸﻒ‬ ‫الحواف‬ ‫بالتﺮﻛيز‬ ‫على‬ ‫التباينات‬ ‫الﻔعلية‬ ‫ﻓﻲ‬ ‫الﺸدة‬ ‫التﻲ‬ ‫ﺗمثل‬ ‫الحواف‬ ‫الحقيقية‬ ‫ﻓﻲ‬ ‫الصورة‬ . ،‫باختصار‬ ‫يعمل‬ ‫التنعيم‬ ‫على‬ ‫ﺗحضيﺮ‬ ‫الصورة‬ ‫لكﺸﻒ‬ ‫الحواف‬ ‫عن‬ ‫طﺮيق‬ ‫إنﺸاء‬ ‫أﺳاس‬ ‫أﻓضل‬ ‫لتحديد‬ ‫التغييﺮات‬ ‫المهمة‬ ‫ﻓ‬ ‫ﻲ‬ ‫الﺸدة‬ ‫التﻲ‬ ‫ﺗحدد‬ ‫الحواف‬ . ‫إنه‬ ‫ﻣثل‬ ‫ﺗنظيﻒ‬ ‫ناﻓذة‬ ‫ﻣتسخة‬ ‫قبل‬ ‫النظﺮ‬ ‫إلى‬ ‫الخارج‬ ‫لﺮؤية‬ ‫العالم‬ ‫بوضوح‬ - ‫حيث‬ ‫ﺗزيل‬ ‫عملية‬ ‫التنعيم‬ ‫التﺸويش‬ ‫الذي‬ ‫يحجب‬ ‫الﺮؤية‬ ‫لتكﺸﻒ‬ ‫الحواف‬ ‫اﻷﺳاﺳية‬ ‫بﺸكل‬ ‫أﻛثﺮ‬ ‫ﻓعالية‬ . AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01
  • 5. 29 Enhancement: Sharpening Up Edges in Image Processing Smoothing prepares the image for edge detection, but it might leave some edges a little weak. Enhancement is the second step in the process, and its goal is to make those edges more prominent for easier detection. Why Enhance Edges? •Improved Edge Quality: Unlike smoothing which focuses on noise removal, enhancement aims to amplify the sharp changes in intensity that define edges. Imagine a faint line separating two regions in an image. Enhancement strengthens this contrast, making the line (the edge) stand out more. How Does Enhancement Work? The primary tool for enhancement in edge detection is differentiation. Differentiation calculates the difference in intensity between neighboring pixels. In areas with an edge, there will be a significant difference in intensity between pixels on either side of the edge. By applying differentiation, these variations are amplified, making the edges more pronounced. ‫ﺗعزيز‬ ‫الحواف‬ : ‫إبراز‬ ‫التﻔاصيل‬ ‫ﻓﻲ‬ ‫ﻣعالﺠة‬ ‫الصور‬ ‫بعد‬ ‫ﺗنعيم‬ ‫الصورة‬ ‫للتخلﺺ‬ ‫ﻣن‬ ‫التﺸويش‬ ‫والحﻔاظ‬ ‫على‬ ‫حواﻓها‬ ،‫اﻷﺻلية‬ ‫ﺗﺄﺗﻲ‬ ‫خطوة‬ ‫ﻣهمة‬ ‫أخﺮى‬ ‫وهﻲ‬ ‫ﺗعزيز‬ ‫الحواف‬ . ‫يهدف‬ ‫ﺗ‬ ‫عزيز‬ ‫الحواف‬ ‫إلى‬ ‫ﺗحسين‬ ‫وضوح‬ ‫حواف‬ ‫الصورة‬ ‫حتى‬ ‫يسهل‬ ‫على‬ ‫خوارزﻣية‬ ‫الكﺸﻒ‬ ‫اﻛتﺸاﻓها‬ ‫ا‬ً‫ق‬‫ﻻح‬ . ‫لماذا‬ ‫نﻘوم‬ ‫بتعزيز‬ ‫الحواف؟‬ • ‫ﺗحسين‬ ‫جودة‬ ‫الحواف‬ : ‫على‬ ‫عكﺲ‬ ‫التنعيم‬ ‫الذي‬ ‫يﺮﻛز‬ ‫على‬ ‫إزالة‬ ،‫التﺸويش‬ ‫يﺮﻛز‬ ‫ﺗعزيز‬ ‫الحواف‬ ‫على‬ ‫ﺟعل‬ ‫التغييﺮ‬ ‫ات‬ ‫الحادة‬ ‫ﻓﻲ‬ ‫ﺷدة‬ ‫وحدات‬ ‫البكسل‬ ) ‫البيكسﻼت‬ ( ‫أﻛثﺮ‬ ‫ا‬ً‫ح‬‫وضو‬ . ‫ﺗخيل‬ ‫وﺟود‬ ‫خﻂ‬ ‫ﻓاﺻل‬ ‫بين‬ ‫ﻣنطقتين‬ ‫ﻓﻲ‬ ،‫الصورة‬ ‫يعمل‬ ‫ﺗعزيز‬ ‫ا‬ ‫لحواف‬ ‫على‬ ‫ﺗقوية‬ ‫هذا‬ ‫التباين‬ ‫بحيث‬ ‫يظهﺮ‬ ‫الخﻂ‬ ) ‫الحاﻓة‬ ( ‫بﺸكل‬ ‫أوضﺢ‬ . ‫ﻛيﻒ‬ ‫يعمل‬ ‫ﺗعزيز‬ ‫الحواف؟‬ ‫اﻷداة‬ ‫الﺮئيسية‬ ‫المستخدﻣة‬ ‫ﻓﻲ‬ ‫ﺗعزيز‬ ‫الحواف‬ ‫هﻲ‬ ‫التﻔاضل‬ . ‫يقوم‬ ‫التﻔاضل‬ ‫بحساب‬ ‫الﻔﺮق‬ ‫ﻓﻲ‬ ‫ﺷدة‬ ‫وحدات‬ ‫البكسل‬ ‫المجاور‬ ‫ة‬ . ‫ﻓﻲ‬ ‫المناطق‬ ‫التﻲ‬ ‫ﺗحتوي‬ ‫على‬ ،‫حاﻓة‬ ‫ﺳيكون‬ ‫هناك‬ ‫ﻓﺮق‬ ‫ﻛبيﺮ‬ ‫ﻓﻲ‬ ‫ﺷدة‬ ‫وحدات‬ ‫البكسل‬ ‫على‬ ‫ﺟانبﻲ‬ ‫الحاﻓة‬ . ‫ﻣن‬ ‫خﻼل‬ ‫ﺗطبيق‬ ،‫التﻔاضل‬ ‫يتم‬ ‫زيادة‬ ‫ه‬ ‫ذه‬ ،‫اﻻختﻼﻓات‬ ‫ﻣما‬ ‫يجعل‬ ‫الحواف‬ ‫أﻛثﺮ‬ ‫ا‬ً‫بﺮوز‬ . AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01
  • 6. 30 Sharpening:A Common Enhancement Technique A popular enhancement technique is sharpening. Sharpening works by emphasizing the difference in intensity between adjacent pixels in areas where an edge is likely present. It's like adjusting the contrast in a specific area to make details pop out more. Why is Enhancement Important? Some edges might be subtle or weak after smoothing. Enhancement strengthens these edges, making them more distinct for the edge detection algorithm in the next step. This leads to a more accurate detection of the actual edges present in the image. In Summary: Enhancement complements smoothing. While smoothing removes noise, enhancement highlights the variations that represent true edges. Together, these steps improve the image quality and prepare it for the final stage of edge detection – pinpointing the exact location of the edges. ‫التوضيح‬ : ‫طريﻘة‬ ‫ﺷاﺋعة‬ ‫لتعزيز‬ ‫الحواف‬ ‫إحدى‬ ‫الطﺮق‬ ‫الﺸائعة‬ ‫لتعزيز‬ ‫الحواف‬ ‫هﻲ‬ ‫التوضيح‬ . ‫يعمل‬ ‫التوضيﺢ‬ ‫عن‬ ‫طﺮيق‬ ‫زيادة‬ ‫الﻔﺮق‬ ‫ﻓﻲ‬ ‫ﺷدة‬ ‫وحدات‬ ‫البكسل‬ ‫المجاورة‬ ‫ﻓﻲ‬ ‫المناطق‬ ‫التﻲ‬ ‫حتمل‬ُ‫ي‬ ‫أن‬ ‫ﺗكون‬ ‫ﻓيها‬ ‫حاﻓة‬ . ‫يﺸبه‬ ‫هذا‬ ‫إلى‬ ‫حد‬ ‫ﻣا‬ ‫زيادة‬ ‫التباين‬ ‫ﻓﻲ‬ ‫ﻣنطقة‬ ‫ﻣعينة‬ ‫ﻣن‬ ‫الصورة‬ ‫ﻹبﺮاز‬ ‫التﻔاﺻيل‬ ‫بﺸكل‬ ‫أﻓضل‬ . ‫لماذا‬ ‫يعد‬ ‫ﺗعزيز‬ ‫الحواف‬ ‫ا؟‬ً‫م‬‫ﻣه‬ ‫قد‬ ‫ﺗكون‬ ‫بعﺾ‬ ‫الحواف‬ ‫ضعيﻔة‬ ‫أو‬ ‫غيﺮ‬ ‫واضحة‬ ‫بعد‬ ‫عملية‬ ‫التنعيم‬ . ‫يعمل‬ ‫ﺗعزيز‬ ‫الحواف‬ ‫على‬ ‫ﺗقوية‬ ‫هذه‬ ‫ال‬ ‫حواف‬ ‫حتى‬ ‫يسهل‬ ‫على‬ ‫خوارزﻣية‬ ‫الكﺸﻒ‬ ‫عن‬ ‫الحواف‬ ‫اﻛتﺸاﻓها‬ ‫ﻓﻲ‬ ‫الخطوة‬ ‫التالية‬ . ‫وهذا‬ ‫يؤدي‬ ‫ﻓﻲ‬ ‫النهاية‬ ‫إلى‬ ‫اﻛتﺸاف‬ ‫أﻛثﺮ‬ ‫دقة‬ ‫للحواف‬ ‫الحقيقية‬ ‫الموﺟودة‬ ‫ﻓﻲ‬ ‫الصورة‬ . ‫باختصار‬ : ‫يعمل‬ ‫ﺗعزيز‬ ‫الحواف‬ ‫ا‬ً‫ب‬‫ﺟن‬ ‫إلى‬ ‫ﺟنب‬ ‫ﻣﻊ‬ ‫التنعيم‬ . ‫بينما‬ ‫يﺮﻛز‬ ‫التنعيم‬ ‫على‬ ‫إزالة‬ ،‫التﺸويش‬ ‫يﺮﻛز‬ ‫ﺗعز‬ ‫يز‬ ‫الحواف‬ ‫على‬ ‫إبﺮاز‬ ‫التباينات‬ ‫التﻲ‬ ‫ﺗمثل‬ ‫الحواف‬ ‫الحقيقية‬ . ،‫ا‬ً‫ع‬‫ﻣ‬ ‫ﺗساهم‬ ‫ﻛلتا‬ ‫الخطوﺗين‬ ‫ﻓﻲ‬ ‫ﺗحسين‬ ‫ﺟودة‬ ‫الصورة‬ ‫وﺗحضيﺮها‬ ‫للخطوة‬ ‫النهائية‬ ‫ﻓﻲ‬ ‫عملية‬ ‫ﻛﺸﻒ‬ ‫الحواف‬ - ‫وهﻲ‬ ‫ﺗحديد‬ ‫ﻣوقﻊ‬ ‫الحواف‬ ‫الﻔعلﻲ‬ . AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01
  • 7. 31 Main Steps in Edge Detection | [3] Thresholding Thresholding: Making the Cut in Edge Detection After smoothing and enhancement, we've prepped the image for edge detection. But there can still be faint edges or noise masquerading as edges. Thresholding, the third step, tackles this by deciding which intensity changes truly represent edges. The Goal of Thresholding: •Separating Edges from Noise: The image might have weak variations in intensity that aren't actual edges. Thresholding helps distinguish these "pseudo-edges" from real edges with a significant intensity change. How Does Thresholding Work? Imagine the image's intensity values plotted on a graph. Ideally, edges show up as sharp peaks or dips. Thresholding sets a specific intensity value (the threshold) as a cut-off point. •Pixels Above the Threshold: Any pixel with an intensity value higher than the threshold is considered a strong edge candidate and is likely to be a real edge. •Pixels Below the Threshold: Conversely, pixels with an intensity value lower than the threshold are considered weak edges or noise and are often discarded. ‫ﺗحديد‬ ‫العتبة‬ : ‫رسم‬ ‫الخط‬ ‫الﻔاصل‬ ‫ﻓﻲ‬ ‫ﻛﺸﻒ‬ ‫الحواف‬ ‫بعد‬ ‫التنعيم‬ ،‫والتعزيز‬ ‫قمنا‬ ‫بتجهيز‬ ‫الصورة‬ ‫لكﺸﻒ‬ ‫الحواف‬ . ‫ولكن‬ ‫ﻻ‬ ‫يزال‬ ‫ﻣن‬ ‫الممكن‬ ‫وﺟود‬ ‫حواف‬ ‫خاﻓتة‬ ‫أو‬ ‫ﺗﺸويش‬ ‫يظهﺮ‬ ‫ع‬ ‫لى‬ ‫أنه‬ ‫حواف‬ . ‫ﺗتولى‬ ‫عملية‬ ‫ﺗحديد‬ ،‫العتبة‬ ‫وهﻲ‬ ‫الخطوة‬ ،‫الثالثة‬ ‫ﻣعالجة‬ ‫هذه‬ ‫المسﺄلة‬ ‫عن‬ ‫طﺮيق‬ ‫ﺗحديد‬ ‫أي‬ ‫ﻣن‬ ‫ﺗغيﺮات‬ ‫الﺸدة‬ ‫ﺗمثل‬ ‫ا‬ً‫ﻓ‬‫حوا‬ ‫ح‬ ‫قيقية‬ . ‫هدف‬ ‫ﺗحديد‬ ‫العتبة‬ : • ‫ﻓصل‬ ‫الحواف‬ ‫ﻋن‬ ‫التﺸويش‬ : ‫قد‬ ‫ﺗحتوي‬ ‫الصورة‬ ‫على‬ ‫اختﻼﻓات‬ ‫ضعيﻔة‬ ‫ﻓﻲ‬ ‫الﺸدة‬ ‫ﻻ‬ ‫ﺗمثل‬ ‫ا‬ً‫ﻓ‬‫حوا‬ ‫ﻓعلية‬ . ‫يساع‬ ‫د‬ ‫ﺗحديد‬ ‫العتبة‬ ‫على‬ ‫التمييز‬ ‫بين‬ ‫هذه‬ " ‫الحواف‬ ‫الزائﻔة‬ " ‫والحواف‬ ‫الحقيقية‬ ‫التﻲ‬ ‫ﺗتميز‬ ‫بتغييﺮ‬ ‫ﻛبيﺮ‬ ‫ﻓﻲ‬ ‫الﺸدة‬ . ‫ﻛيﻒ‬ ‫يعمل‬ ‫ﺗحديد‬ ‫العتبة؟‬ ‫ﺗخيل‬ ‫قيم‬ ‫ﺷدة‬ ‫الصورة‬ ‫ﻣﺮﺳوﻣة‬ ‫على‬ ‫رﺳم‬ ‫بيانﻲ‬ . ‫ﻣن‬ ‫الناحية‬ ،‫المثالية‬ ‫ﺗظهﺮ‬ ‫الحواف‬ ‫على‬ ‫ﺷكل‬ ‫ذروات‬ ‫أو‬ ‫انخﻔ‬ ‫اضات‬ ‫حادة‬ . ‫يحدد‬ ‫ﺗحديد‬ ‫العتبة‬ ‫قيمة‬ ‫ﺷدة‬ ‫ﻣعينة‬ ) ‫العتبة‬ ( ‫ﻛنقطة‬ ‫ﻓاﺻلة‬ . • ‫البيكسﻼت‬ ‫أﻋﻠى‬ ‫ﻣن‬ ‫العتبة‬ : ‫أي‬ ‫بكسل‬ ‫بقيمة‬ ‫ﺷدة‬ ‫أﻋﻠى‬ ‫ﻣن‬ ‫العتبة‬ ‫يعتبﺮ‬ ‫ا‬ً‫ح‬‫ﻣﺮﺷ‬ ‫ا‬ً‫ي‬‫قو‬ ‫للحاﻓة‬ ‫وﻣن‬ ‫المح‬ ‫تمل‬ ‫أن‬ ‫يكون‬ ‫حاﻓة‬ ‫حقيقية‬ . • ‫البيكسﻼت‬ ‫أقل‬ ‫ﻣن‬ ‫العتبة‬ : ،‫بالعكﺲ‬ ‫ﺗعتبﺮ‬ ‫البكسﻼت‬ ‫التﻲ‬ ‫ﺗحتوي‬ ‫على‬ ‫قيمة‬ ‫ﺷدة‬ ‫أقل‬ ‫ﻣن‬ ‫العتبة‬ ً‫ﻓ‬‫حوا‬ ‫ا‬ ‫ضعيﻔة‬ ‫أو‬ ‫ا‬ً‫ﺸ‬‫ﺗﺸوي‬ ‫ا‬ً‫ب‬‫وغال‬ ‫يتم‬ ‫ﺗجاهلها‬ . AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01
  • 8. 32 Main Steps in Edge Detection | [3] Thresholding Choosing the Right Threshold: Selecting the perfect threshold can be tricky. A high threshold might miss subtle edges, while a low threshold might include too much noise. It often involves experimentation to find the best balance for the specific image. Why is Thresholding Important? Thresholding helps us focus on the most likely edge pixels and avoid getting bogged down by insignificant intensity variations. It streamlines the edge detection process and provides a clearer picture of the actual edges present in the image. In Summary: Thresholding acts like a filter, separating the wheat from the chaff. It helps us discard noise and weak edges while retaining strong intensity changes that represent true edges in the image. This paves the way for the final step – precisely locating these edges for further analysis. ‫اختيار‬ ‫العتبة‬ ‫الصحيحة‬ : ‫يمكن‬ ‫أن‬ ‫يكون‬ ‫اختيار‬ ‫العتبة‬ ‫المثالية‬ ‫عملية‬ ‫ﺻعبة‬ . ‫قد‬ ‫ﺗﻔوت‬ ‫العتبة‬ ‫العالية‬ ‫الحواف‬ ،‫الخﻔية‬ ‫بينما‬ ‫قد‬ ‫ﺗتضمن‬ ‫العت‬ ‫بة‬ ‫المنخﻔضة‬ ‫الكثيﺮ‬ ‫ﻣن‬ ‫التﺸويش‬ . ‫ا‬ً‫ب‬‫وغال‬ ‫ﻣا‬ ‫يتطلب‬ ‫اﻷﻣﺮ‬ ‫التجﺮبة‬ ‫للعثور‬ ‫على‬ ‫أﻓضل‬ ‫ﺗوازن‬ ‫للصورة‬ ‫المحددة‬ . ‫لماذا‬ ‫يعد‬ ‫ﺗحديد‬ ‫العتبة‬ ‫ا؟‬ً‫م‬‫ﻣه‬ ‫يساعدنا‬ ‫ﺗحديد‬ ‫العتبة‬ ‫على‬ ‫التﺮﻛيز‬ ‫على‬ ‫وحدات‬ ‫البكسل‬ ‫اﻷﻛثﺮ‬ ً ‫احتماﻻ‬ ‫بﺄن‬ ‫ﺗكون‬ ‫ا‬ً‫ﻓ‬‫حوا‬ ‫وﺗجنب‬ ‫اﻻنﺸغال‬ ‫بتغيﺮات‬ ‫الﺸدة‬ ‫غيﺮ‬ ‫المهمة‬ . ‫يعمل‬ ‫على‬ ‫ﺗبسيﻂ‬ ‫عملية‬ ‫ﻛﺸﻒ‬ ‫الحواف‬ ‫ويوﻓﺮ‬ ‫ﺻورة‬ ‫أوضﺢ‬ ‫للحواف‬ ‫الﻔعلية‬ ‫الموﺟودة‬ ‫ﻓﻲ‬ ‫الصورة‬ . ‫باختصار‬ : ‫يعمل‬ ‫ﺗحديد‬ ‫العتبة‬ ،‫ﻛمﺮﺷﺢ‬ ‫يﻔصل‬ ‫بين‬ ‫القمﺢ‬ ‫والزن‬ . ‫يساعدنا‬ ‫على‬ ‫التخلﺺ‬ ‫ﻣن‬ ‫التﺸويش‬ ‫والحواف‬ ‫الضعيﻔة‬ ‫ﻣﻊ‬ ‫الحﻔ‬ ‫اظ‬ ‫على‬ ‫التغييﺮات‬ ‫القوية‬ ‫ﻓﻲ‬ ‫الﺸدة‬ ‫التﻲ‬ ‫ﺗمثل‬ ‫ا‬ً‫ﻓ‬‫حوا‬ ‫حقيقية‬ ‫ﻓﻲ‬ ‫الصورة‬ . ‫وهذا‬ ‫يمهد‬ ‫الطﺮيق‬ ‫للخطوة‬ ‫اﻷخيﺮة‬ - ‫ﺗحديد‬ ‫ﻣوقﻊ‬ ‫هذه‬ ‫الحواف‬ ‫بدق‬ ‫ة‬ ‫لمزيد‬ ‫ﻣن‬ ‫التحليل‬ . AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01
  • 9. 33 Main Steps in Edge Detection | [4] Localization Localization: Pinpointing the Edge on the Map We've come a long way! After smoothing, enhancement, and thresholding, we have a good idea of where the edges might be in the image. But the question remains: where exactly are these edges located? Localization, the final step in edge detection, tackles this by precisely determining the sub-pixel position of each edge. The Goal of Localization: •Sub-Pixel Accuracy: Thresholding gives us a general idea of the edge's presence. Localization refines this by pinpointing the exact location within a pixel. Imagine a pixel as a tiny square. Localization helps us determine where the edge falls within that square, not just whether it's present somewhere in the pixel. Why Sub-Pixel Accuracy Matters? A precise edge location is crucial for various applications. For instance, in self-driving cars, accurate edge detection of lanes and obstacles is vital for safe navigation. A slight miscalculation in the edge location could have significant consequences. ‫ﺗحديد‬ ‫الموقع‬ : ‫وضع‬ ‫إصبعك‬ ‫ﻋﻠى‬ ‫الحاﻓة‬ ‫ا‬ً‫ﻣ‬‫ﺗما‬ ‫لقد‬ ‫قطعنا‬ ‫ا‬ً‫ط‬‫ﺷو‬ ً‫ﻼ‬‫طوي‬ ! ‫بعد‬ ‫التنعيم‬ ‫والتعزيز‬ ‫وﺗحديد‬ ،‫العتبة‬ ‫أﺻبﺢ‬ ‫لدينا‬ ‫ﻓكﺮة‬ ‫ﺟيدة‬ ‫عن‬ ‫أﻣاﻛن‬ ‫وﺟود‬ ‫ال‬ ‫حواف‬ ‫ﻓﻲ‬ ‫الصورة‬ . ‫لكن‬ ‫السؤال‬ ‫المطﺮوح‬ : ‫أين‬ ‫ﺗقﻊ‬ ‫هذه‬ ‫الحواف‬ ‫بالضبﻂ؟‬ ‫ﺗحديد‬ ‫الموقع‬ : ‫هﻲ‬ ‫الخطوة‬ ‫اﻷخيﺮة‬ ‫ﻓﻲ‬ ‫ﻛﺸﻒ‬ ،‫الحواف‬ ‫ﺗعالﺞ‬ ‫هذه‬ ‫المسﺄلة‬ ‫عن‬ ‫طﺮيق‬ ‫ﺗحديد‬ ‫ﻣوضﻊ‬ ‫البكسل‬ ‫الﻔﺮعﻲ‬ ) ‫أﺟزاء‬ ‫ﻣن‬ ‫البك‬ ‫سل‬ ( ‫لكل‬ ‫حاﻓة‬ ‫بدقة‬ . ‫هدف‬ ‫ﺗحديد‬ ‫الموقع‬ : • ‫دقة‬ ‫البكسل‬ ‫الﻔرﻋﻲ‬ : ‫يمنحنا‬ ‫ﺗحديد‬ ‫العتبة‬ ‫ﻓكﺮة‬ ‫عاﻣة‬ ‫عن‬ ‫وﺟود‬ ‫الحاﻓة‬ . ‫يقوم‬ ‫ﺗحديد‬ ‫الموقﻊ‬ ‫بتحسين‬ ‫ذلك‬ ‫عن‬ ‫طﺮيق‬ ‫ﺗ‬ ‫حديد‬ ‫الموقﻊ‬ ‫الدقيق‬ ‫ضمن‬ ‫البكسل‬ . ‫ﺗخيل‬ ‫البكسل‬ ‫ﻛمﺮبﻊ‬ ‫ﺻغيﺮ‬ . ‫يساعدنا‬ ‫ﺗحديد‬ ‫الموقﻊ‬ ‫على‬ ‫ﺗحديد‬ ‫ﻣكان‬ ‫ﺳقوط‬ ‫الحاﻓة‬ ‫داخل‬ ‫ذلك‬ ،‫المﺮبﻊ‬ ‫وليﺲ‬ ‫ﻓقﻂ‬ ‫ﻣا‬ ‫إذا‬ ‫ﻛانﺖ‬ ‫ﻣوﺟودة‬ ‫ﻓﻲ‬ ‫ﻣكان‬ ‫ﻣا‬ ‫داخل‬ ‫البكسل‬ . ‫لماذا‬ ‫ﺗعد‬ ‫دقة‬ ‫البكسل‬ ‫الﻔرﻋﻲ‬ ‫ﻣهمة؟‬ ‫يعد‬ ‫ﺗحديد‬ ‫ﻣوقﻊ‬ ‫الحاﻓة‬ ‫بدقة‬ ‫أﻣﺮا‬ ‫ا‬ً‫ي‬‫ضﺮور‬ ‫لتطبيقات‬ ‫ﻣختلﻔة‬ . ‫على‬ ‫ﺳبيل‬ ،‫المثال‬ ‫ﻓﻲ‬ ‫السيارات‬ ‫ذاﺗية‬ ،‫القيادة‬ ‫يعد‬ ‫ﻛﺸﻒ‬ ‫حواف‬ ‫المسارات‬ ‫والعوائق‬ ‫بدقة‬ ‫أﻣﺮا‬ ‫حيويا‬ ‫للمﻼحة‬ ‫اﻵﻣنة‬ . ‫يمكن‬ ‫أن‬ ‫يؤدي‬ ‫ﺳوء‬ ‫التقديﺮ‬ ‫البسيﻂ‬ ‫ﻓﻲ‬ ‫ﺗحديد‬ ‫ﻣوقﻊ‬ ‫الحاﻓة‬ ‫إلى‬ ‫عواقب‬ ‫وخيمة‬ . AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01
  • 10. 34 Main Steps in Edge Detection | [4] Localization How Does Localization Work? There are various techniques for localization, but a common approach involves analyzing the intensity values of pixels around the suspected edge. By examining the intensity gradient (the rate of change in intensity), the exact location of the sharp transition (the edge) can be pinpointed with greater accuracy. Beyond Simple Edges: Localization isn't just about straight lines. It can also determine the orientation and curvature of more complex edges, providing a more detailed picture of the image's structure. Why is Localization Important? Localization takes edge detection a step further, transforming a general idea of "edge present" into a precise location. This refined information is essential for many image-processing tasks and computer vision applications. In Summary: Localization acts like a magnifying glass, zooming in on the suspected edge region and precisely determining its location within a pixel. This sub-pixel accuracy provides valuable information for further analysis and tasks that rely on accurate edge detection. ‫ﻛيﻒ‬ ‫يعمل‬ ‫ﺗحديد‬ ‫الموقع؟‬ ‫هناك‬ ‫ﺗقنيات‬ ‫ﻣختلﻔة‬ ‫لتحديد‬ ،‫الموقﻊ‬ ‫ولكن‬ ‫النهﺞ‬ ‫الﺸائﻊ‬ ‫ينطوي‬ ‫على‬ ‫ﺗحليل‬ ‫قيم‬ ‫ﺷدة‬ ‫وحدات‬ ‫البكسل‬ ‫حول‬ ‫الحاﻓة‬ ‫المﺸتب‬ ‫ه‬ ‫بها‬ . ‫ﻣن‬ ‫خﻼل‬ ‫ﻓحﺺ‬ ‫ﺗدرج‬ ‫الﺸدة‬ ) ‫ﻣعدل‬ ‫ﺗغيﺮ‬ ‫الﺸدة‬ ( ، ‫يمكن‬ ‫ﺗحديد‬ ‫الموقﻊ‬ ‫الدقيق‬ ‫لﻼنتقال‬ ‫الحاد‬ ) ‫الحاﻓة‬ ( ‫بدقة‬ ‫أﻛبﺮ‬ . ‫أﻛثر‬ ‫ﻣن‬ ‫ﻣﺠرد‬ ‫حواف‬ ‫بسيطة‬ : ‫ﻻ‬ ‫يقتصﺮ‬ ‫ﺗحديد‬ ‫الموقﻊ‬ ‫على‬ ‫الخطوط‬ ‫المستقيمة‬ ‫ﻓقﻂ‬ . ‫ﻛما‬ ‫يمكنه‬ ‫ﺗحديد‬ ‫اﺗجاه‬ ‫وانحناء‬ ‫الحواف‬ ‫اﻷﻛثﺮ‬ ،‫ًا‬‫د‬‫ﺗعقي‬ ‫ﻣما‬ ‫يوﻓﺮ‬ ‫ﺻ‬ ‫ورة‬ ‫أﻛثﺮ‬ ‫ﺗﻔصيﻼ‬ ‫لبنية‬ ‫الصورة‬ . ‫لماذا‬ ‫يعد‬ ‫ﺗحديد‬ ‫الموقع‬ ‫ا؟‬ً‫م‬‫ﻣه‬ ‫يﺮﻓﻊ‬ ‫ﺗحديد‬ ‫الموقﻊ‬ ‫ﻛﺸﻒ‬ ‫الحواف‬ ‫إلى‬ ‫ﻣستوى‬ ،‫أعلى‬ ‫حيث‬ ‫يحول‬ ‫الﻔكﺮة‬ ‫العاﻣة‬ ‫عن‬ " ‫وﺟود‬ ‫حاﻓة‬ " ‫إلى‬ ‫ﻣوقﻊ‬ ‫ﻣحدد‬ . ‫ﺗعتبﺮ‬ ‫هذه‬ ‫الم‬ ‫علوﻣات‬ ‫الدقيقة‬ ‫ضﺮورية‬ ‫للعديد‬ ‫ﻣن‬ ‫ﻣهام‬ ‫ﻣعالجة‬ ‫الصور‬ ‫وﺗطبيقات‬ ‫رؤية‬ ‫الحاﺳوب‬ . ‫باختصار‬ : ‫يعمل‬ ‫ﺗحديد‬ ‫الموقﻊ‬ ‫ﻛعدﺳة‬ ،‫ﻣكبﺮة‬ ‫حيث‬ ‫يقﺮب‬ ‫ﻣنطقة‬ ‫الحاﻓة‬ ‫المﺸتبه‬ ‫بها‬ ‫ويحدد‬ ‫ﻣوقعها‬ ‫بدقة‬ ‫داخل‬ ‫البكسل‬ . ‫ﺗوﻓﺮ‬ ‫د‬ ‫قة‬ ‫البكسل‬ ‫الﻔﺮعﻲ‬ ‫هذه‬ ‫ﻣعلوﻣات‬ ‫قيمة‬ ‫لمزيد‬ ‫ﻣن‬ ‫التحليل‬ ‫والمهام‬ ‫التﻲ‬ ‫ﺗعتمد‬ ‫على‬ ‫ﻛﺸﻒ‬ ‫الحواف‬ ‫الدقيق‬ . AHMED R. A. SHAMSAN & M. MOHAMADI EDGE DETECTION | LUC01