Need help finding coordinates of an image.
3 views (last 30 days)
Show older comments
Meredith van der Merwe
on 22 Nov 2020
Edited: Image Analyst
on 22 Nov 2020
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
Accepted Answer
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
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.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!