資源簡介
利用opencv2.4.9求取圖像的平均灰度值,可以直接運行,并打印平均值的結果
代碼片段和文件信息
#include?
#include?
#include?
#include?
using?namespace?cv;
using?namespace?std;
int?main()
{
//定義彩色圖片文件的位置
????Mat?srcImage?=?imread(“full.jpg“?CV_LOAD_IMAGE_COLOR);??
????//判斷圖像是否為空
????if(srcImage.empty())
????{
????????cout<<“error“;
????????return?-1;
????}
????//圖像的寬度和高度
????int?Width=0;
int?Height=0;
Width=srcImage.cols;
Height=srcImage.rows;
????Mat
- 上一篇:bp車牌識別源代碼
- 下一篇:C++版學生管理系統
評論
共有 條評論