tensorflow::ops::EncodeJpeg
#include <image_ops.h>Mengonversi gambar ke format JPEG.
Ringkasan
image adalah Tensor uint8 3-D dengan bentuk [height, width, channels] .
format `attr` dapat digunakan untuk mengganti format warna dari output yang dikodekan. Nilainya bisa berupa:
- `''
: Use a default format based on the number of channels in the image. *grayscale: Output a grayscale JPEG image. Thedimension ofsaluran gambarmust be 1. *rgb: Output an RGB JPEG image. Thedimension ofsaluran gambar harus 3.
Jika format tidak ditentukan atau berupa string kosong, format default akan dipilih berdasarkan jumlah saluran pada image :
- 1: Menghasilkan gambar skala abu-abu.
- 3: Keluarkan gambar RGB.
Argumen:
- Cakupan: Objek Cakupan
- gambar: 3-D dengan bentuk
[height, width, channels].
Atribut opsional (lihat Attrs ):
- Format: Format gambar per piksel.
- Kualitas: Kualitas kompresi dari 0 hingga 100 (semakin tinggi semakin baik dan semakin lambat).
- progresif: Jika True, buat JPEG yang dimuat secara bertahap (dari kasar ke halus).
- optimize_size: Jika True, gunakan CPU/RAM untuk mengurangi ukuran tanpa perubahan kualitas.
- Pengurangan_sampel_kroma: Lihat http://en.wikipedia.org/wiki/Chroma_subsampling .
- density_unit: Satuan yang digunakan untuk menentukan
x_densitydany_density: piksel per inci ('in') atau sentimeter ('cm'). - x_density: Piksel horizontal per satuan kepadatan.
- y_density: Piksel vertikal per satuan kepadatan.
- xmp_metadata: Jika tidak kosong, sematkan metadata XMP ini di header gambar.
Mengembalikan:
-
Output: 0-D. Gambar yang dikodekan 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 | Pengaturan atribut opsional untuk EncodeJpeg . |
Atribut publik
isi
::tensorflow::Output contents
operasi
Operation operation
Fungsi publik
EncodeJpeg
EncodeJpeg( const ::tensorflow::Scope & scope, ::tensorflow::Input image )
EncodeJpeg
EncodeJpeg( const ::tensorflow::Scope & scope, ::tensorflow::Input image, const EncodeJpeg::Attrs & attrs )
simpul
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Fungsi statis publik
Pengurangan Ukuran 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 )
Metadata Xmp
Attrs XmpMetadata( StringPiece x )
Kepadatan Y
Attrs YDensity( int64 x )