Image Manipulation

Feb 28, 2011 by admin    No Comments    Posted under: Programming

Perform a simple Gaussian blur function on the test image

/*
 *      Author: Dimitrios Prodromou
 *      office@robotas.at
 */
 
#include <stdlib.h>
#include <stdio.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>
 
int main()
{
 
	IplImage* img = cvLoadImage("test.jpg");
	cvNamedWindow("Example3-in");
	cvNamedWindow("Example3-out");
 
	//show original window
	cvShowImage("Example3-in",img);
 
	//create img for the output
	IplImage* out = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 3);
 
	//Perform a Gaussian blur
	cvSmooth(img, out, CV_GAUSSIAN, 11, 11);
 
	//show the processed image
	cvShowImage("Example3-out", out);
 
	cvWaitKey(0);
	cvReleaseImage(&img);
	cvReleaseImage(&out);
	cvDestroyAllWindows();
 
return 0;
 
}

Got anything to say? Go ahead and leave a comment!

You must be logged in to post a comment.