画像の切り取りをMATLABで行いたい

17 views (last 30 days)
Haruki Kimura
Haruki Kimura on 9 Dec 2019
Answered: Shunichi Kusano on 9 Dec 2019
matlabで画像を四角とかではなく任意の形に切り取ることは可能ですか?
例としては、画像の背景部分だけを切り取ったり、物の形に沿って切り取ったりです。
よろしくお願いします。

Accepted Answer

Shunichi Kusano
Shunichi Kusano on 9 Dec 2019
こんにちは。
関数で言うとdrawpolygonでできます。処理の流れとしては、
  1. h = drawpolygon で、ROIを取得
  2. BW = createMask(h, img)  で、マスクを作成
  3. img(~BW) = 0 で画像にマスクを適用
みたいな感じです。細かいところは、各関数のドキュメントをご覧ください。

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!