how to create a fan shape/ arc inside an image?
4 views (last 30 days)
Show older comments
I want to change the rectangular into fan-shape or arc.
3 Comments
Answers (1)
KSSV
on 12 Oct 2022
May be something like this:
[I,map] = imread('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1152743/rect.png') ;
[m,n,p] = size(I) ;
R = linspace(0.5,1,n) ;
th = linspace(pi/4,3*pi/4,m) ;
[R,T] = meshgrid(R,th) ;
X = R.*cos(T) ;
Y = R.*sin(T) ;
warp(X,Y,ones(size(X)),I)
view(2)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!