opencv 鼠标取图片中的像素值

用鼠标取图片中的像素值

#include
#include
using namespace cv;
using namespace std;
bool flag = false;
int xvalue = 0;
int yvalue = 0;
Mat image,image1,image2;
void mousecallback(int event, int x, int y, int flags, void* userdata);
int main(int argc, char* argv[])
{
 namedWindow("imageshow", 0);
 Mat image = imread("F:\\6.jpg", 1);
 if(!image.data)
 {
  cout<<"the image is error"<(yvalue, xvalue)[0];
    int g = image1.at(yvalue, xvalue)[1];
    int r = image1.at(yvalue, xvalue)[2];
    cout<<"B:"<

你可能感兴趣的:(opencv 鼠标取图片中的像素值)