// Sobel Edge
#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
int dx,dy,apertureSize;
IplImage *img = cvLoadImage("c:\\lena.png");
IplImage *img1 = cvCloneImage(img);
dx=1; dy=0; apertureSize=3;
cvSobel(img,img1,dx,dy,apertureSize);
cvNamedWindow("SobelEdge",1);
cvShowImage("SobelEdge",img1);
cvWaitKey();
return 0;
}
// Sobel Edge
#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
int dx,dy,apertureSize;
IplImage *img = cvLoadImage("c:\\lena.png");
IplImage *img1 = cvCloneImage(img);
dx=1; dy=0; apertureSize=3;
cvSobel(img,img1,dx,dy,apertureSize);
cvNamedWindow("SobelEdge",1);
cvShowImage("SobelEdge",img1);
cvWaitKey();
return 0;
}
1 comment:
Sir,
I need to know how to compute the Gradient of every pixel in a block.
Post a Comment