ResizeOp

public class ResizeOp

画像処理の計算単位として、ユーザーが指定したサイズに画像のサイズを変更できます。

画像が引き伸ばされるときにピクセルが補間され、画像が圧縮されるときにピクセルが破棄されます。

ネストされたクラス

enum ResizeOp.ResizeMethod サイズ変更のアルゴリズム。

パブリック コンストラクタ

ResizeOp(int targetHeight、int targetWidth、ResizeOp.ResizeMethod楽しめる時間)
指定されたメソッドで画像を指定されたサイズにサイズ変更できる ResizeOp を作成します。

パブリック メソッド

TensorImage
applyTensorImage の画像)
指定された画像にサイズ変更を適用して、結果を返します。
整数
getOutputImageHeight(int inputImageHeight, int inputImageWidth)
入力画像サイズが指定されたときに、想定される出力画像の高さを計算します。
整数
getOutputImageWidth(int inputImageHeight, int inputImageWidth)
入力画像のサイズが指定されたときに、想定される出力画像の幅を計算します。
PointF
inverseTransform(PointF ポイント、int inputImageHeight、int inputImageWidth)
結果画像の座標系の点を、入力画像の座標系に変換します。

継承されるメソッド

パブリック コンストラクタ

public ResizeOp (int targetHeight, int targetWidth, ResizeOp.ResizeMethod resolveMethod)

指定されたメソッドで画像を指定されたサイズにサイズ変更できる ResizeOp を作成します。

パラメータ
targetHeight サイズ変更された画像の予想高さ。
targetWidth サイズ変更時の画像の想定幅。
resizeMethod サイズ変更に使用するアルゴリズム。オプション: ResizeOp.ResizeMethod

パブリック メソッド

public TensorImage apply TensorImage の画像)

指定された画像に定義済みのサイズ変更を適用し、結果を返します。

注: 入力 image の内容は変更され、image は出力と同じインスタンスになります。

パラメータ
イメージ 生成します。
戻り値
  • 出力画像。

public int getOutputImageHeight (int inputImageHeight, int inputImageWidth)

入力画像サイズが指定されたときに、想定される出力画像の高さを計算します。

パラメータ
inputImageHeight
inputImageWidth

public int getOutputImageWidth (int inputImageHeight, int inputImageWidth)

入力画像のサイズが指定されたときに、想定される出力画像の幅を計算します。

パラメータ
inputImageHeight
inputImageWidth

public PointF inverseTransform (PointF point, int inputImageHeight, int inputImageWidth)

結果画像の座標系の点を、入力画像の座標系に変換します。

パラメータ
point 結果の座標系から得た点です。
inputImageHeight 入力画像の高さ。
inputImageWidth 入力画像の幅です。
戻り値
  • 入力画像の座標系の座標を持つ点。