Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I am trying to get all the different pixel values from an image and display the same?

The problem is I can access pixel values from an image but how to compare them is where I am stuck!!!

Accessing pixel is simple, I am using the following code for this:-

Mat image = img;

for(int y=0;y<img.rows;y++ ){  
for(int x=0;x<img.cols;x++)
{
    // get pixel
    Vec3b color = image.at<Vec3b>(Point(x,y)); }
}