OpenCV Projects stands for Open Source Computer Vision
Applications OpenCV Projects
Key features of OpenCV Projects
OpenCV Image Transformations
OpenCV Projects Operators
Structure of OpenCV projects
#inclde “cv.h” // Include header files
#include “ highgui.h”
Int main()
{ IplImage * input; // Variable declaration
input = cvLoadImage(“shivendu.jpg”,1); // Loads the image
cvNamedWindow(“Output”,1); // Creates a window to display image
cvShowImage(“Output”, input); // Displays the image
cvWaitKey(0); // Waits till a key is pressed
cvDestroyWindow( “Output” ); //destroy the window
cvReleaseImage( &input ); //release the memory for the image }
Sample Code for Image Masking in OpenCV:
Typedef struct CvHistogram
{
int type;
CvArr* bins;
float thresh[CV_MAX_DTM] [2]; /* for uniform histograms*/
float** thresh2; /* for non-uniform histograms */
CvMatND mat; /* embedded matrix header for array histograms */
}
CvHistogram;
IplImage* mask;
mask = cvCreateImage( cvGetSize (hsv), IPL_DEPTH_8U, 1);
cvZero (mask);
cvRectangle (mask, cvPoint (10,10), cvPoint (100,100), cvScalarAll (255), CV_FILLED);
cvCalcHist (planes, hist, 0, mask); //Compute Histogram OpenCV Projects