Need help finding coordinates of an image.

3 次查看(过去 30 天)
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 个评论
KSSV
KSSV 2020-11-22
What coordinates you want to get for an image?
Meredith van der Merwe
The x and y coordinates, as if it were plotted onto a graph.

请先登录,再进行评论。

采纳的回答

KSSV
KSSV 2020-11-22
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 个评论
Meredith van der Merwe
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 2020-11-22
编辑:Image Analyst 2020-11-22
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by