How to crop only a region that is surrounded by a boundary

2 ビュー (過去 30 日間)
Samarth Bharadwaj DD
Samarth Bharadwaj DD 2017 年 2 月 3 日
回答済み: Walter Roberson 2017 年 2 月 3 日
I am working on sign boards detection.Want to crop region surrounded by red circle boundary so i can compare with standard imag.Can anybody help me with the steps or code for it

回答 (2 件)

KSSV
KSSV 2017 年 2 月 3 日

Walter Roberson
Walter Roberson 2017 年 2 月 3 日
First you need to detect the red pixels to create a binary image whose pixels are set at the red. Next imfill() to fill the holes. Now zero the locations where the boundary was, to remove the place the red pixels themselves were. What remains is a mask of the locations inside the circle.
You can then use regionprops to find the bounding box, and then you can use that bounding box to crop using the imcrop that KSSV recommends.

カテゴリ

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