how to create a fan shape/ arc inside an image?

7 Ansichten (letzte 30 Tage)
BA am 11 Okt. 2022
Kommentiert: BA am 12 Okt. 2022
I want to change the rectangular into fan-shape or arc.
  3 Kommentare
BA am 12 Okt. 2022
Bearbeitet: BA am 12 Okt. 2022
@DGM@KSSVit's one image and I want to convert the rectangular into fan-shape/polar (attached is the example of the fan-shape). In fact, the rect's image is done in python, here is the code:
roi_upper = 310
roi_lower = 140
roi_left = 80
roi_right = 525
rec = np.zeros(df.shape, dtype=m_df.dtype)
rec[roi_lower:roi_upper,roi_left:roi_right] = 1
img_ro = df * rec

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KSSV am 12 Okt. 2022
May be something like this:
[I,map] = imread('') ;
[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) ;
  3 Kommentare
BA am 12 Okt. 2022
@KSSVdo you have an idea to convert your code into python so I can try on that on original image?

Melden Sie sich an, um zu kommentieren.


Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by