テンソルフロー::作戦:: JPEG をエンコードする

#include <image_ops.h>

画像を JPEG エンコードします。

まとめ

imageは、形状[height, width, channels]の 3 次元 uint8テンソルです。

attr format使用すると、エンコードされた出力のカラー形式をオーバーライドできます。値は次のとおりです。

  • `'' : Use a default format based on the number of channels in the image. * greyscale : Output a grayscale JPEG image. The画像dimension of : Output a grayscale JPEG image. The must be 1. * rgb : Output an RGB JPEG image. The image` dimension of : Output an RGB JPEG image. Theである必要があります。

formatが指定されていない場合、または空の文字列である場合は、 image内のチャネル数に応じてデフォルトの形式が選択されます。

引数:

  • スコープ:スコープオブジェクト
  • 画像: 形状[height, width, channels]を持つ 3-D。

オプションの属性 ( Attrsを参照):

  • format: ピクセルごとの画像フォーマット。
  • 品質: 0 から 100 までの圧縮の品質 (高いほど良く、遅くなります)。
  • Progressive: True の場合、段階的に (粗いものから細かいものへ) ロードする JPEG を作成します。
  • optimize_size: True の場合、品質を変更せずにサイズを削減するために CPU/RAM を消費します。
  • chroma_downsampling: http://en.wikipedia.org/wiki/Chroma_subsamplingを参照してください。
  • density_unit: x_densityおよびy_density指定に使用される単位: インチあたりのピクセル ( 'in' ) またはセンチメートル ( 'cm' )。
  • x_density: 密度単位ごとの水平ピクセル数。
  • y_density: 密度単位ごとの垂直ピクセル数。
  • xmp_metadata: 空でない場合は、この XMP メタデータを画像ヘッダーに埋め込みます。

戻り値:

  • Output : 0-D。 JPEG エンコードされた画像。

コンストラクターとデストラクター

EncodeJpeg (const :: tensorflow::Scope & scope, :: tensorflow::Input image)
EncodeJpeg (const :: tensorflow::Scope & scope, :: tensorflow::Input image, const EncodeJpeg::Attrs & attrs)

パブリック属性

contents
operation

公共機能

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

パブリック静的関数

ChromaDownsampling (bool x)
DensityUnit (StringPiece x)
Format (StringPiece x)
OptimizeSize (bool x)
Progressive (bool x)
Quality (int64 x)
XDensity (int64 x)
XmpMetadata (StringPiece x)
YDensity (int64 x)

構造体

tensorflow:: ops:: EncodeJpeg:: Attrs

EncodeJpegのオプションの属性セッター。

パブリック属性

コンテンツ

::tensorflow::Output contents

手術

Operation operation

公共機能

JPEG をエンコードする

 EncodeJpeg(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input image
)

JPEG をエンコードする

 EncodeJpeg(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input image,
  const EncodeJpeg::Attrs & attrs
)

ノード

::tensorflow::Node * node() const 

演算子::tensorflow::入力

 operator::tensorflow::Input() const 

演算子::tensorflow::出力

 operator::tensorflow::Output() const 

パブリック静的関数

クロマダウンサンプリング

Attrs ChromaDownsampling(
  bool x
)

密度単位

Attrs DensityUnit(
  StringPiece x
)

フォーマット

Attrs Format(
  StringPiece x
)

サイズの最適化

Attrs OptimizeSize(
  bool x
)

プログレッシブ

Attrs Progressive(
  bool x
)

品質

Attrs Quality(
  int64 x
)

X密度

Attrs XDensity(
  int64 x
)

Xmpメタデータ

Attrs XmpMetadata(
  StringPiece x
)

Y密度

Attrs YDensity(
  int64 x
)