How can I convert an image to polar coordinates ?

74 ビュー (過去 30 日間)
raheem mian
raheem mian 2020 年 1 月 7 日
回答済み: Walter Roberson 2020 年 1 月 7 日
Hi I have attached the lena image, and I wanted to convert this image to polar coordinates. Could anyone guide me.
Thanks.

回答 (2 件)

Meg Noah
Meg Noah 2020 年 1 月 7 日
I'm not really sure what you're trying to accomplish, but if it is to have a set of 2D arrays that represent the distance from the image center (radius) and the angle subtended by a central X, Y system to that pixel, then:
clc
close all
clear all
[img,cmap] = imread('lena.png');
img = img(:,:,1);
[ny,nx] = size(img);
% since there are an even number of columns and rows...
y1d = -ny/2+1/2:-1/2+ny/2;
x1d = -nx/2+1/2:-1/2+nx/2;
[X2D,Y2D] = meshgrid(x1d,y1d);
figure()
imagesc(x1d,y1d,img);
[theta2D,radius2D] = cart2pol(X2D,Y2D);

Walter Roberson
Walter Roberson 2020 年 1 月 7 日

カテゴリ

Help Center および File ExchangePolar Plots についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by