最終更新: mikk_ni3_92 2009年11月20日(金) 16:30:16履歴
現在地 >> メニュー >> OpenCV >> CvMat編02 >> CvMat編02::まとめ5
#include <iostream> #include <cv.h> #include <highgui.h> //-------- メイン関数 ---------// int main() { CvMat *matA = cvCreateMat(400,400,CV_32FC1); cvSetZero(matA); for(int row = 50;row <100;++row) { for(int col = 100;col < 150;++col) { cvmSet(matA,row,col,255.0); } } std::cout <<"(x,y) : (100,49) -> " << cvmGet(matA,49,100) << "\n"; std::cout <<"(x,y) : (100,50) -> " << cvmGet(matA,50,100) << "\n"; cvNamedWindow("cvmSet and cvmGet"); cvShowImage("cvmSet and cvmGet",matA); cvWaitKey(); cvReleaseMat(& matA); cvDestroyAllWindows(); return 0; }