Need help finding coordinates of an image.

3 views (last 30 days)
Hi there,
I was just wondering if there is anyway that I can insert an image into Matlab and recieve the coordinates of the image.
The aim would be to recieve the coordinates of the image so that I could use Fouriers Transform and Epicycles in order to redraw the image.
  2 Comments
KSSV
KSSV on 22 Nov 2020
What coordinates you want to get for an image?
Meredith van der Merwe
Meredith van der Merwe on 22 Nov 2020
The x and y coordinates, as if it were plotted onto a graph.

Sign in to comment.

Accepted Answer

KSSV
KSSV on 22 Nov 2020
The image will be plotted wrt it's indices. If I is your image.
[m, n, p] = size (I);
x = 1: n;
y = 1: m;
[X, Y] = meshgrid (x, y);
  2 Comments
Meredith van der Merwe
Meredith van der Merwe on 22 Nov 2020
Thank you so much, but how do i get it to give me every individual coordinate for the image? It is just displaying the image on a plot for me.
Image Analyst
Image Analyst on 22 Nov 2020
Edited: Image Analyst on 22 Nov 2020
Try this:
[rows, columns, numberOfColorChannels] = size (I);
x = 1 : columns;
y = 1 : rows;
[X, Y] = meshgrid(x, y);
xy = [X(:), Y(:)];
This will give you a 2-D array of x,y values. The x are in the first column and the y are in the second column. It will have one row for every pixel in the image.
IMPORTANT: realize that image variables are not indexed (x,y), they are indexed (row, column), which is like grayImage(y, x) if you want to retrieve the gray level of the pixel at row=y and column = x.
For what it's worth, I'm attaching a demo to turn an image into a CSV file.

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!