L
L
Limons2021-11-30 20:15:21
C++ / C#
Limons, 2021-11-30 20:15:21

How to get the RGB value of the XY coordinates of an image using opencv?

All libraries are connected correctly, at least they work.

Here is the code:

int main(){
        Mat image  = imread("C:\\png\\1.jpg");
  Point3_<uchar>* p = image.ptr<Point3_<uchar> >(1, 1);
  cout << "RGB:  " << p->z << "  " << p->y << "  " << p->x;
  return 0;
}


Is there some mistake?
And what is "->";

Here is the image, jpg format:
61a65c272fef7016675233.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
calculator212, 2021-12-01
@Limons

This?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question