Created
November 12, 2013 05:09
-
-
Save sumit4iit/7425799 to your computer and use it in GitHub Desktop.
Laplacian of Gaussian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* eyeExtract.cpp | |
* | |
* Created on: Nov 10, 2013 | |
* Author: sumit4iit | |
*/ | |
#include<iostream> | |
#include "cv.h" | |
#include "highgui.h" | |
#include <cstring> | |
using namespace cv; | |
using namespace std; | |
int main() | |
{ | |
string path = "res/download.jpg"; | |
Mat src = imread(path,CV_LOAD_IMAGE_GRAYSCALE); | |
if(!src.data) | |
{ | |
cout<<"fail\n"; | |
return -1; | |
} | |
Mat1i destG, destL,dest; | |
// Point anchor = Point(-1,-1); | |
double delta = 0; | |
int ddepth = -1; | |
GaussianBlur(src,destG,Size(3,3),1,1,BORDER_DEFAULT); | |
Laplacian(destG, destL, ddepth, 3, 1, delta, BORDER_DEFAULT); | |
convertScaleAbs(destL,dest); | |
namedWindow("original",CV_WINDOW_AUTOSIZE); | |
namedWindow("Gaussian",CV_WINDOW_AUTOSIZE); | |
namedWindow("Laplacian",CV_WINDOW_AUTOSIZE); | |
namedWindow("ConvertScale",CV_WINDOW_AUTOSIZE); | |
imshow("original",src); | |
imshow("Laplacian",destL); | |
imshow("Gaussian",destG); | |
imshow("ConvertScale",dest); | |
waitKey(0); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment