เทนเซอร์โฟลว์:: ปฏิบัติการ:: เข้ารหัสJpeg
#include <image_ops.h>
JPEG เข้ารหัสรูปภาพ
สรุป
image
เป็น 3-D uint8 Tensor ของรูปร่าง [height, width, channels]
format
attr สามารถใช้เพื่อแทนที่รูปแบบสีของเอาต์พุตที่เข้ารหัสได้ ค่าสามารถเป็น:
- `''
: Use a default format based on the number of channels in the image. *
ระดับสีเทา: 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 (ยิ่งสูงก็ยิ่งดีและช้าลง)
- โปรเกรสซีฟ: หากเป็นจริง ให้สร้าง 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) |
งานสาธารณะ | |
---|---|
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) |
โครงสร้าง | |
---|---|
เทนเซอร์โฟลว์:: 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