#include <iostream> #include <cv.h> #include <highgui.h> //------------- メイン関数 ---------------// int main( int argc, char **argv) { cv::Ptr<IplImage> imgA = cvLoadImage("test.jpg"); if(imgA.empty()) { std::cerr << "Can't Load Image \n"; return -1; } cvNamedWindow("hello OpenCV"); cvShowImage("hello OpenCV",imgA); cvWaitKey(); cvDestroyAllWindows(); //全ウィンドウの破棄 return 0; }//ここでIplImageのメモリは破棄される