このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
imsubtract
イメージを他のイメージから減算する、またはイメージから定数を減算する
説明
例
2 つの uint8 配列の減算
この例では、2 つの uint8
配列を減算する方法を説明します。結果が負になるものは、0 に丸められていることに注意してください。
X = uint8([ 255 0 75; 44 225 100]); Y = uint8([ 50 50 50; 50 50 50 ]); Z = imsubtract(X,Y)
Z = 2x3 uint8 matrix
205 0 25
0 175 50
イメージの背景の減算
グレースケール イメージをワークスペースに読み取ります。
I = imread('rice.png');
背景を推定します。
background = imopen(I,strel('disk',15));
イメージから背景を減算します。
J = imsubtract(I,background);
元のイメージと処理後のイメージを表示します。
imshow(I)
figure imshow(J)
イメージからの定数の減算
イメージをワークスペースに読み取ります。
I = imread('rice.png');
イメージから定数値を減算します。
J = imsubtract(I,50);
元のイメージと結果を表示します。
imshow(I)
figure imshow(J)
入力引数
出力引数
バージョン履歴
R2006a より前に導入
参考
imabsdiff
| imadd
| imcomplement
| imdivide
| imlincomb
| immultiply
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)