Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding coordinates of each pixel using programming

Tags:

opencv

matlab

What is the way to find the coordinates of each pixel of the inner circle (or the outer one) in the following Image using programming(openCV or MATLAB)?
imtool gives this information but it is mouse driven.

enter image description here

Update

I used imtool to detect these locations, by putting my mouse cursor on each point on the circle and manual noting this value. But how do I do it using programming as manually I cant do it for so many pints on the circle.

like image 488
gpuguy Avatar asked Jul 26 '12 05:07

gpuguy


People also ask

How do you find the coordinates of a pixel?

In terms of coordinates, a pixel can be identified by a pair of integers giving the column number and the row number. For example, the pixel with coordinates (3,5) would lie in column number 3 and row number 5. Conventionally, columns are numbered from left to right, starting with zero.

What is a pixel coordinate?

The pixel coordinate is a number that identifies the location of a pixel in the image array.


1 Answers

In Matlab, you can just do:

im = imread('im.png');      %# load image
[y,x] = find(all(im<5, 3)); %# find black pixels
position = [x,y];           %# display them
like image 67
Oli Avatar answered Oct 03 '22 06:10

Oli