Menampilkan property images
Last Updated on Sunday, 18 April 2010 17:27 Written by Widodo Budiharto Sunday, 18 April 2010 17:24
Ini adalah contoh program menampilkan property dari suatu image:
#include <iostream>
#include <iomanip>
#include "cv.h"
#include "highgui.h"
using namespace std;
int main( int argc, char** argv )
{
// Create an IplImage object *image
IplImage *image = cvLoadImage( argv[1]);
// Display Image Attributes by accessing a IplImage object's data members
cout << left << setfill(' ') << setw(15) << "Image filename:" << argv[1] << endl;
cout << setw(15) << "Width:" << image->width << endl;
cout << setw(15) << "Height:" << image->height << endl;
cout << setw(15) << "Pixel Depth:" << image->depth << endl;
cout << setw(15) << "Channels:" << image->nChannels << endl;
cout << setw(15) << "Width Step:" << image->widthStep << endl;
cout << setw(15) << "Image Size:" << image->imageSize << endl;
return 0;
}


