#include "cv.h" #include "highgui.h" #include int main () { // new IplImage structure 'img', using 8-bit unsigned integer representation // over 3 channels. This constructs a colour image with blue, green and red // channels (in that order) with each colour value being an 8-bit unsigned // integer (0-255). IplImage *img = cvCreateImage(cvSize(100, 100), IPL_DEPTH_8U, 3); // fill every third channel (all the red ones) with value 255. int i; for (i = 2; i < img->imageSize; i+=3) img->imageData[i] = 255; // a visualization window is created with title 'image' cvNamedWindow ("image", 1); // img is shown in 'image' window cvShowImage ("image", img); // wait for infinite delay for a keypress cvWaitKey (0); // memory release for img before exiting the application cvReleaseImage (&img); // Self-explanatory cvDestroyWindow("image"); return (0); }