特定の範囲における二値化についてです
1 view (last 30 days)
Show older comments
画像の二値化においてimbinarizeを使っています。
特定の範囲をimbinarizeで二値化し、 それ以外の範囲は二値化せず白くしたいです。
何か方法はあるでしょうか?
1 Comment
Naoya
on 27 Jan 2021
特定の領域は画像の関心領域のみに2値化を適用となりましたでしょうか?
関心領域のみ特定の処理を行う機能として roifilt2が利用できます。
以下のようなフローはいかがでしょうか?
% 画像読み込み
>> I = imread('cameraman.tif');
% 関心領域をマウスを使ってインタラクティブに多角形で選択
>> mask = roipoly(I);
% roifilt2を使って関心領域のみに2値化
J = roifilt2(I, mask, @(I) imbinarize(I,0.5));
% 結果の表示
imshow(J)
Answers (0)
See Also
Categories
Find more on イメージ タイプの変換 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!