学习OpenCV课后题3.3
2010-07-13 16:50
344 查看
// Ex3_3.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <cv.h>
#include <cvcam.h>
#include <cxcore.h>
#include <highgui.h>
#pragma comment(lib,"cv.lib")
#pragma comment(lib,"cvcam.lib")
#pragma comment(lib,"cxcore.lib")
#pragma comment(lib,"highgui.lib")
int main(int argc, char* argv[])
{
CvMat *Mat = cvCreateMat(atoi( argv[1]), atoi(argv[2]), CV_8UC3);
cvSetZero(Mat);
for (int nHeight = 100; nHeight < 300; nHeight++)
{
for (int nWidth =100; nWidth < 300; nWidth++)
{
uchar *ptr =(uchar*)cvPtr2D(Mat,nHeight,nWidth);
ptr[1] = 255;
}
}
cvNamedWindow("Show");
cvShowImage("Show",Mat);
cvWaitKey();
return 0;
}
//
#include "stdafx.h"
#include <cv.h>
#include <cvcam.h>
#include <cxcore.h>
#include <highgui.h>
#pragma comment(lib,"cv.lib")
#pragma comment(lib,"cvcam.lib")
#pragma comment(lib,"cxcore.lib")
#pragma comment(lib,"highgui.lib")
int main(int argc, char* argv[])
{
CvMat *Mat = cvCreateMat(atoi( argv[1]), atoi(argv[2]), CV_8UC3);
cvSetZero(Mat);
for (int nHeight = 100; nHeight < 300; nHeight++)
{
for (int nWidth =100; nWidth < 300; nWidth++)
{
uchar *ptr =(uchar*)cvPtr2D(Mat,nHeight,nWidth);
ptr[1] = 255;
}
}
cvNamedWindow("Show");
cvShowImage("Show",Mat);
cvWaitKey();
return 0;
}
相关文章推荐
- 学习OpenCV课后题4.2
- OpenCV3.3深度学习模块(DNN)应用-图像分类
- 学习OpenCV 第四章课后题第一题(合并图像、缩放、字体)
- 学习opencv课后答案第三章
- 学习OpenCV课后题3.2
- 学习OpenCV课后题3.8(b)
- 学习opencv 课后8.5
- 学习OpenCV课后题3.4
- 学习OpenCV课后题4.3
- 学习Opencv第3章课后习题
- 学习opencv 课后8.5
- 基于QT5的opencv学习之《学习opencv课后练习3-7》
- 读取视频文件存盘(学习openCV课后题2.3)
- 学习OpenCV课后题4.4
- 学习Opencv第2章课后习题
- 【opencv】opencv3.3的DNN模块调用caffe训练结果——【caffe学习五】
- 学习OpenCV第三章课后题(打卡)
- 读取摄像头并存盘(学习openCV课后题2.3改进)
- 学习OpenCV课后题3.6
- 学习OpenCV课后题4.5(有点糙)