首页 > 科技
DIP Programming Assignment 3
Edge detection using gradient operator
Edge detection is a problem of fundamental importance in image analysis. In typical images, edges characterize object boundaries and are therefore useful for segmentation, registration, and identification of objects in a scene.
In this exercise, you are required to develop an edge detection algorithm using gradient operator:
The formula above uses four-neighbor pixels to calculate the gradient of the central pixel. An important consideration in implementing this operation is the issue of what happens when the central pixel approaches the border of the input image, as one or more four-neighbors of the central pixel may be out of the image area. We suggest that you can skip the gradient operation on the border of the input image. For an image which has M*N resolution, you can implement the gradient operator from the 2nd to (M-1)th row, and from the 2nd to (N-1)th column.
If you use IMSHOW to show the processed image Y directly, most of its detail cannot be displayed clearly because of its low dynamic range. You can use the following command to get its negative image and extend to the full dynamic range before you use IMSHOW to display it.
Y = im2uint8(mat2gray(Y));
Y = 255-double(Y);
Y = im2uint8(mat2gray(Y));
In your submitted report, an input image, an output (processed) image and source code should be included.
Example:
Original Image Gradient Image Output Image
If you have finished jobs required above, you could try other edge detect operators or use different ways to handle those special pixels in which your edge detect operator could not get a whole input data for processing. You could also try the edge function with different parameters supported by Matable and compare your results with Matlab’s output. The following are some info form Matlab help for the Matlab function edge:
Some info for Matlab function edge:
>> help edge
EDGE Find edges in intensity image.
EDGE takes an intensity or a binary image I as its input, and returns a
binary image BW of the same size as I, with 1's where the function
finds edges in I and 0's elsewhere.
EDGE supports six different edge-finding methods:
The Sobel method finds edges using the Sobel approximation to the
derivative. It returns edges at those points where the gradient of
I is maximum.
The Roberts method finds edges using the Roberts approximation to
the derivative. It returns edges at those points where the gradient
of I is maximum.
…..
The parameters you can supply differ depending on the method you
specify. If you do not specify a method, EDGE uses the Sobel method.
Sobel Method
BW = EDGE(I,'sobel') specifies the Sobel method.
BW = EDGE(I,'sobel',THRESH) specifies the sensitivity threshold for
the Sobel method. EDGE ignores all edges that are not stronger than
THRESH. If you do not specify THRESH, or if THRESH is empty ([]),
EDGE chooses the value automatically.
BW = EDGE(I,'sobel',THRESH,DIRECTION) specifies directionality for the
Sobel method. DIRECTION is a string specifying whether to look for
'horizontal' or 'vertical' edges, or 'both' (the default).
[BW,thresh] = EDGE(I,'sobel',...) returns the threshold value.
Roberts Method
BW = EDGE(I,'roberts') specifies the Roberts method.
BW = EDGE(I,'roberts',THRESH) specifies the sensitivity threshold for
the Roberts method. EDGE ignores all edges that are not stronger than
THRESH. If you do not specify THRESH, or if THRESH is empty ([]),
EDGE chooses the value automatically.
[BW,thresh] = EDGE(I,'roberts',...) returns the threshold value.
Class Support
-------------
I can be of class uint8, uint16, or double. BW is of class uint8.
Example
-------
Find the edges of the rice.tif image using the Prewitt and Canny
methods:
I = imread('rice.tif');
BW1 = edge(I,'prewitt');
BW2 = edge(I,'canny');
imshow(BW1)
figure, imshow(BW2)
…
请加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
相关推荐
- Instagram自动化引流助手,ins精准私信神器,ig高效推广,ins协议号商
- 荣联科技集团出席华为四川新质生产力城市峰会
- Instagram私信引流神器,ins高效推广助手,ig全自动群发,ins协议号
- Instagram群发推广软件,ins高效引流助手,ig全自动采集,ins协议号批量出售
- 大运重卡经销商内蒙古豪烈公司盛大开业暨大客户交车仪式隆重举行
- 探索钢结构行业新纪元,钢结构信息平台引领未来
- 首届Style3D伙伴大会,与300+行业精英“乘风破浪”
- WhatsApp稳定批量群发 跨境电商的新选择
- WhatsApp高效批量群发 WS私信操作全攻略
- WhatsApp群发营销获客 跨境电商的得力助手
- 搜索
-
- 06-26Instagram自动化引流助手,ins精准私信神器,ig高效推广,ins协议号商
- 06-26荣联科技集团出席华为四川新质生产力城市峰会
- 06-26Instagram私信引流神器,ins高效推广助手,ig全自动群发,ins协议号
- 06-26Instagram群发推广软件,ins高效引流助手,ig全自动采集,ins协议号批量出售
- 06-26大运重卡经销商内蒙古豪烈公司盛大开业暨大客户交车仪式隆重举行
- 06-26探索钢结构行业新纪元,钢结构信息平台引领未来
- 06-26首届Style3D伙伴大会,与300+行业精英“乘风破浪”
- 06-26WhatsApp稳定批量群发 跨境电商的新选择
- 06-26WhatsApp高效批量群发 WS私信操作全攻略
- 06-26WhatsApp群发营销获客 跨境电商的得力助手
- 标签列表