跳转至

图像操作

一、读写图像

  1. imread
  2. imwrite

二、读写像素

  1. 读一个GRAY像素点的像素值(CV_8UC1)

  2. Scalar intensity = img.at<uchar>(y,x)

  3. Scarlar intensity = img.at<uchar>(Point(x,y))

  4. 读一个RGB像素点的像素值

Vec3f intensity = img.at<Vec3f>(y,x);
float blue = intensity.val[0];
float green = intensity.val[1];
float red = intensity.val[2];

三、修改像素值