how can i find pixels of image's border
古いコメントを表示
i have a set of images and i would like to test if there is a a black border on limits on the image, such this one:

i will appreciate any help ,thank you ^^
採用された回答
その他の回答 (1 件)
Image Analyst
2015 年 12 月 28 日
Your image has white columns on the left and right side - did you know that? So there are no all zero rows. To see if all pixels in a row or column are 0, use all():
allZeroColumns = all(grayImage == 0, 1);
allZeroRows = all(grayImage == 0, 2);
These are logical vectors. If you want, you can then use them to remove all zero rows or columns:
grayImage(:, allZeroColumns) = [];
grayImage(allZeroRows, :) = [];
カテゴリ
ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
