aliran tensor:: operasi:: EnkodeJpeg

#include <image_ops.h>

JPEG-mengkodekan gambar.

Ringkasan

image adalah Tensor uint8 3-D dengan bentuk [height, width, channels] .

format attr dapat digunakan untuk mengganti format warna dari keluaran yang dikodekan. Nilai dapat berupa:

  • `'' : Use a default format based on the number of channels in the image. * skala abu-abu : Output a grayscale JPEG image. The dimension of : Output a grayscale JPEG image. The gambar must be 1. * rgb : Output an RGB JPEG image. The dimension of : Output an RGB JPEG image. The gambar` harus 3.

Jika format tidak ditentukan atau berupa string kosong, format default dipilih berdasarkan jumlah saluran dalam image :

Argumen:

  • ruang lingkup: Objek Lingkup
  • gambar: 3-D dengan bentuk [height, width, channels] .

Atribut opsional (lihat Attrs ):

  • format: Format gambar per piksel.
  • kualitas: Kualitas kompresi dari 0 hingga 100 (lebih tinggi lebih baik dan lebih lambat).
  • progresif: Jika Benar, buat JPEG yang dimuat secara progresif (kasar hingga halus).
  • optimize_size: Jika Benar, habiskan CPU/RAM untuk mengurangi ukuran tanpa perubahan kualitas.
  • chrome_downsampling: Lihat http://en.wikipedia.org/wiki/Chroma_subsampling .
  • densitas_unit: Satuan yang digunakan untuk menentukan x_density dan y_density : piksel per inci ( 'in' ) atau sentimeter ( 'cm' ).
  • x_density: Piksel horizontal per unit kepadatan.
  • y_density: Piksel vertikal per unit kepadatan.
  • xmp_metadata: Jika tidak kosong, sematkan metadata XMP ini di header gambar.

Pengembalian:

  • Output : 0-D. Gambar berkode JPEG.

Konstruktor dan Destruktor

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

Atribut publik

contents
operation

Fungsi publik

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

Fungsi statis publik

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)

Struktur

tensorflow:: ops:: EncodeJpeg:: Attrs

Penyetel atribut opsional untuk EncodeJpeg .

Atribut publik

isi

::tensorflow::Output contents

operasi

Operation operation

Fungsi publik

EnkodeJpeg

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

EnkodeJpeg

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

simpul

::tensorflow::Node * node() const 

operator::tensorflow::Masukan

 operator::tensorflow::Input() const 

operator::tensorflow::Keluaran

 operator::tensorflow::Output() const 

Fungsi statis publik

Pengambilan Sampel Chroma

Attrs ChromaDownsampling(
  bool x
)

Satuan Kepadatan

Attrs DensityUnit(
  StringPiece x
)

Format

Attrs Format(
  StringPiece x
)

OptimalkanUkuran

Attrs OptimizeSize(
  bool x
)

Progresif

Attrs Progressive(
  bool x
)

Kualitas

Attrs Quality(
  int64 x
)

Kepadatan X

Attrs XDensity(
  int64 x
)

XmpMetadata

Attrs XmpMetadata(
  StringPiece x
)

YKepadatan

Attrs YDensity(
  int64 x
)