openCV 操作像素矩阵

来源:互联网 发布:2017优化重组数学答案 编辑:程序博客网 时间:2024/06/05 11:28
void PixelOperate(const CvMat* mat){float s = 0.0f;for (int row = 0; row < mat->rows; row++){const float* ptr = (const float*)(mat->data.ptr + row * mat->step);//mat->step指内存中矩阵的行程(可能做了扩展),这样写最安全for (int col = 0; col < mat->cols; col++){//做一些像素级的操作}}}

0 0