現在地 >> メニュー >> 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;
}

目次

― その他 ―

Wiki内検索

計測中...(07.10.8〜)

Save The World






▲よろしければ広告のクリックもお願いします


▲ランキングに参加しました

管理人/副管理人のみ編集できます