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
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 个评论
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 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!