MATLAB: How to crop left eye (255*255) in this image

crop image

i want to crop only one eye in this image,here is code clear all; a=imread(‘your image.png’);
% Parameter for cropping
x=input(‘Enter value of Row:’)
y=input(‘Enter value of Column:’) c=size(a) for i = x:1:c(1)-x for j = y:1:c(2)-y b(i+1-x,j+1-y)=a(i,j); end end figure() imshow(a) figure() imshow(b) size(b)

Best Answer

This example code might give you a little insight in how to crop:
A = magic(7)
r = [2 6]
c = [3 5]
rix = r(1):r(2)
cix = c(1):c(2)
croppedA = A(rix, cix)