tensorflow::ops::EncodeJpeg
#include <image_ops.h>เข้ารหัสภาพเป็นไฟล์ JPEG
สรุป
image เป็น เทนเซอร์ uint8 3 มิติ ที่มีรูปร่าง [height, width, channels]
format แอตทริบิวต์สามารถใช้เพื่อแทนที่รูปแบบสีของเอาต์พุตที่เข้ารหัสได้ ค่าที่สามารถเป็นได้คือ:
- `''
: Use a default format based on the number of channels in the image. *grayscale: Output a grayscale JPEG image. Theช่องdimension ofภาพmust be 1. *rgb: Output an RGB JPEG image. Theจำนวนช่องdimension ofภาพต้องเป็น 3
หากไม่ได้ระบุ format หรือเป็นสตริงว่าง ระบบจะเลือกรูปแบบเริ่มต้นโดยขึ้นอยู่กับจำนวนช่องสัญญาณใน image :
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- ภาพ: 3 มิติ ที่มีรูปร่าง
[height, width, channels]
คุณลักษณะเสริม (ดูที่ Attrs ):
- รูปแบบ: รูปแบบภาพต่อพิกเซล
- คุณภาพ: คุณภาพของการบีบอัดข้อมูลตั้งแต่ 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: ภาพที่เข้ารหัส JPEG แบบ 0 มิติ
ตัวสร้างและตัวทำลาย | |
|---|---|
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
ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต
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 )