How can I make automatic crop?
1 回表示 (過去 30 日間)
古いコメントを表示
Hello
How can I make automatic crop around core? like
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191456/image.jpeg)
.
2 件のコメント
Rik
2018 年 6 月 24 日
Have a read here (or here for more general advice) and here. It will greatly improve your chances of getting an answer.
採用された回答
Image Analyst
2018 年 6 月 24 日
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);
5 件のコメント
Image Analyst
2018 年 6 月 24 日
編集済み: Image Analyst
2018 年 6 月 24 日
Well there's the problem. You totally ignored my code in my answer, and did it your own (wrong) way. Why?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!