|
Location: Computer science - Image processing License: The Intelliproject Open License (IPOL) Image processing – Edge Detection filters with c++ and GDI+Posted by Silviu CarageaThis article explains 2 different ways to do edge detection: first method is based on: Sobel , Prewitt and Kirsh and the second one is based on the difference between pairs of pixel around the current pixel. |
Skill: AdvancedPosted: 06/11/2008Views: 7778Rating: 4.56 /5Popularity: 4.35 |
| Sign Up to vote for this article |
Edge detection is a fundamental tool used in most image processing applications to obtain information from the frames as a precursor step to feature extraction and object segmentation. This process detects outlines of an object and boundaries between objects and the background in the image. An edge-detection filter can also be used to improve the appearance of blurred or anti-aliased video streams.
In this article I will show 2 different ways to do edge detection. First method is based on convolution filters operators like: Sobel , Prewitt and Kirsh. The second one is based on the difference between pairs of pixel around the current pixel.

The convolution filters are described in one of my preview articles which can be found here.
In this approach, three different masks are used to detect edges named after their inventors, Sobel, Prewitt, and Kirsh. In each case, a horizontal version of the filter is applied to one bitmap, vertical version to another, and one of these two images is used to merge both horizontal and vertical version together using the following formula:
pixel = sqrt(pixel1 *pixel1 + pixel2 * pixel2)

The above function can be found in CEdgeDetectionFilters.cpp .
The difference edge detection detects the difference between pairs of pixel around the current processed pixel. It used the highest value from the difference of the four pairs of pixels that can be used to form a line through the middle pixel.
| 19/05/2009 | Compatible with Visual Studio 2008
Sobel mask bug fixed |
This article, along with any associated source code and files, is licensed under The Intelliproject Open License (IPOL)
| Silviu Caragea
| Silviu Caragea is the Founder, Administrator and Chief Editor who wrote and runs The IntelliProject. He's been programming since 2000 and now he's student at The Faculty of Economic Cybernetics, Statistics and Informatics from Bucharest. In the same time he's working as software developer at Cratima Software, a Romanian software and web design company that activates both on the local and foreign market, providing its customers with software development services, internet and intranet solutions, web design, graphic design and IT consultancy. His programming experience includes: - C,C++, Visual C++(Win32 API, MFC, ADO, STL, DAO, ODBC, ATL, COM, DirectShow, DirectDraw, WTL) - Open Source libraries :CURL & Boost - HTML, CSS - Java (SE,ME) - JavaScript, Ajax, Google Web Toolkit (GWT) - Php, MySQL -Oracle, PL SQL - C# .NET -Objective C, IPhone SDK, Cocoa Location: |
Sign up to post message on the article message board!