Cropping an ellipse from an image
问题 I want to extract an elliptical region from an image (a portion of a face portion from an image) preferably in MATLAB: For example, in this image, I want to extract the region within red boundary. Can anyone help me with this ? 回答1: Cropping is easy, all you have to do is apply a proper mask. The trick is to create such a mask. Assuming A is your image, try this: %# Create an ellipse shaped mask c = fix(size(A) / 2); %# Ellipse center point (y, x) r_sq = [76, 100] .^ 2; %# Ellipse radii