Thursday, April 29, 2010

Sobel edge detection on OpenCV

In this system, Finding the edge image by Sobel Edge Detection in Digital image process by OpenCV libary. That is find edge by use template size 3x3 with two templates to use the first template for the difference in the horizontal (Xdiff) and The difference in the vertical (Ydiff) by at

Y_difference(x,y) = value(x,y) - value(x,y+1)
X_difference(x,y) = value(x,y) - value(x-1,y)

example use function in OpenCV

//Convert to Sobel
IplImage *pSobel=cvCreateImage(cvGetSize(pimage),IPL_DEPTH_16S,1);
cvSobel( pGray,pSobel,1,1,7 );
cvNamedWindow("Sobel",CV_WINDOW_AUTOSIZE);
cvShowImage("Sobel", pSobel);

result:


Digital image process



0 comments:

Post a Comment

 
Copyright 2009 About of Image Processing