Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I'm using Visual C++ and OpenCV.

I want to ask, how can I access to a pixel element in a Mat in OpenCV.

I mean, I want to verify in a binary Mat image if a pixel it's 1 or 0...how can I do to access to a pixel with x and y (or rows and coloumn)?

Can you help me? Thanks in advance.
Posted

1 solution

Quote:

int pixel = MatImage.at<uchar>(Row,Column) ;
//pixel will give pixel value of image present at that particular Row & Column.
//MatImage is "Mat" Type.

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900