Searching

Poll

Materi yang ingin ditampilkan






Results

Yahoo Mesg:

prof_widodo

Menampilkan property images

Attention: open in a new window. PDFPrintE-mail

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;
}