cropping image based on markers

7 ビュー (過去 30 日間)
thomas chalmers
thomas chalmers 2022 年 2 月 1 日
コメント済み: Image Analyst 2022 年 2 月 2 日
I have an aerial image that i need to crop at certain markers in the image. is it possible to crop the image between the markers in code without manually cropping the image. I have attached an example image below.TIA
  3 件のコメント
laurent jalabert
laurent jalabert 2022 年 2 月 1 日
Define a Region of Interest (ROI) maybe ?
DGM
DGM 2022 年 2 月 2 日
Today I learned that there's a size limit on attached images, but apparently not on inline images.
I was going to ask a question about the problem, but I forgot what it was sometime while waiting for the editor to open for the last ten minutes.

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2022 年 2 月 2 日
Get the mask of the white pixels then use find() and min() and max() and indexing.
[r,g,b] = imsplit(rgbImage);
whiteMask = r == 255 & g == 255 & b == 255;
[r, c] = find(whiteMask);
row1 = min(r)
row2 = max(r)
col1 = min(c)
col2 = max(c)
croppedImage = rgbImage(row1 : row2, col1 : col2, :);
  2 件のコメント
thomas chalmers
thomas chalmers 2022 年 2 月 2 日
Thank you so much
Image Analyst
Image Analyst 2022 年 2 月 2 日
If it worked, could you click the "Accept this Answer" link. Otherwise let me know it didn't work and I'll fix it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by