Filter löschen
Filter löschen

how to crop an image equally

1 Ansicht (letzte 30 Tage)
Ruksana siddique
Ruksana siddique am 5 Mär. 2019
Beantwortet: Ruksana siddique am 8 Mär. 2019
i want to divide this picture equally from the centre of the optic disc on a angle of 30 degree. but i dont no how to dvide it. I need a algorithm for this. i am sharing an demo image.. i have to crop thi im592 image in demo type image
i want crop this image in patches so that i can extraxct its feature

Akzeptierte Antwort

KSSV
KSSV am 5 Mär. 2019
I = imread('Im592.jpg') ;
[ny,nx,nz] = size(I) ;
[X,Y] = meshgrid(1:nx,1:ny) ;
C = round([nx/2 ny/2]) ; % center
R = abs(min(C)-min(nx,ny)) ;
% circle
th = linspace(0,pi/2) ;
x = C(1)+R*cos(th) ;
y = C(2)+R*sin(th) ;
figure
imshow(I)
hold on
plot(x,y,'r')
% Get inside part / crop
xp = [0 x 0] ; yp = [0 y 0] ;
idx = inpolygon(X(:),Y(:),xp,yp) ;
%
for i = 1:3
T = I(:,:,i) ;
T(~idx) = 255 ;
I(:,:,i) = T ;
end
figure
imshow(I)
  6 Kommentare
Ruksana siddique
Ruksana siddique am 7 Mär. 2019
can i again show the picture.. how to cut the whole image sir
Ruksana siddique
Ruksana siddique am 7 Mär. 2019
Sir there is an attachment so that you understand better..

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Ruksana siddique
Ruksana siddique am 8 Mär. 2019
sir the program you send me. . in this the image is cut out at 30 degree
do you help me how will I crop the image from it's center

Kategorien

Mehr zu Image Processing and Computer Vision 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