ドキュメンテーションヘルプ センター
最新のリリースでは、このページがまだ翻訳されていません。 このページの最新版は英語でご覧になれます。
ワーピング イメージの出力表示の作成
Rout = affineOutputView(sizeA,tform)
Rout = affineOutputView(sizeA,tform,'BoundsStyle',style)
Rout = affineOutputView(sizeA,tform) は、入力イメージのサイズ sizeA とアフィン幾何学的変換 tform を受け取り、空間参照オブジェクト Rout を返します。このオブジェクトを imwarp への入力として使用し、ワープされたイメージの出力範囲とグリッド間隔を制御できます。
Rout
sizeA
tform
imwarp
例
また、Rout = affineOutputView(sizeA,tform,'BoundsStyle',style) では、出力表示に出力イメージ全体が含まれるかどうか、出力表示が入力範囲に一致するかどうかなど、出力表示の空間範囲の制約も指定します。
style
すべて折りたたむ
イメージを読み取って表示します。イメージの空間範囲を確認するには、座標軸を表示します。
A = imread('kobi.png'); iptsetpref('ImshowAxesVisible','on') imshow(A)
2 次元アフィン変換を作成します。この例では、範囲 [1.2, 2.4] の係数でのスケーリング、範囲 [-45, 45] 度の角度での回転、範囲 [100, 200] ピクセルの距離での水平方向の平行移動で構成されるランダムな変換を作成します。
tform = randomAffine2d('Scale',[1.2,2.4],'XTranslation',[100 200],'Rotation',[-45,45]);
イメージと変換について 3 つの異なる出力表示を作成します。
centerOutput = affineOutputView(size(A),tform,'BoundsStyle','CenterOutput'); followOutput = affineOutputView(size(A),tform,'BoundsStyle','FollowOutput'); sameAsInput = affineOutputView(size(A),tform,'BoundsStyle','SameAsInput');
異なる出力表示スタイルをそれぞれ使用して、入力イメージに変換を適用します。
BCenterOutput = imwarp(A,tform,'OutputView',centerOutput); BFollowOutput = imwarp(A,tform,'OutputView',followOutput); BSameAsInput = imwarp(A,tform,'OutputView',sameAsInput);
結果のイメージを表示します。
imshow(BCenterOutput) title('CenterOutput Bounds Style');
imshow(BFollowOutput) title('FollowOutput Bounds Style');
imshow(BSameAsInput) title('SameAsInput Bounds Style');
iptsetpref('ImshowAxesVisible','off')
入力イメージのサイズ。2 次元イメージ入力の 2 要素数値ベクトルまたは 3 次元ボリューム イメージ入力の 3 要素数値ベクトルとして指定します。
affine2d
affine3d
アフィン幾何学的変換。affine2d または affine3d オブジェクトとして指定します。
'CenterOutput'
'FollowOutput'
'SameAsInput'
境界のスタイル。次のいずれかの値に指定します。
imref2d
imref3d
空間参照。imref2d または imref3d オブジェクトとして返されます。Rout を関数 imwarp の OutputView 引数として使用し、ワープされた出力の空間参照を指定します。
OutputView
imwarp | randomAffine2d | randomAffine3d
randomAffine2d
randomAffine3d
この例の変更されたバージョンがシステム上にあります。代わりにこのバージョンを開きますか?
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office