MATLAB: How to make automatic crop

automatic cropcorecropfingerprinthelpsquare

Hello
How can I make automatic crop around core? like
.

Best Answer

Why do you need to crop it?
Anyway, if you do for some reason, you can just binarize and look for the min and max row and column.
binaryImage = imbinarize(grayImage);
[rows, columns] = find(binaryImage);
row1 = min(rows);
row2 = max(rows);
col1 = min(columns);
col2 = max(columns);
croppedGrayImage = grayImage(row1:row2, col1:col2);
imshow(croppedImage);
Related Question