公用類別 TransformToGrayscaleOp
將圖片轉換成 GrayScale 做為圖片處理單元。
支援的色域:
轉換是以 OpenCV RGB 至 GRAY 轉換 https://docs.opencv.org/master/de/d25/imgproc_color_conversions.html#color_convert_rgb_gray
公用建構函式
TransformToGrayscaleOp()
建立 TransformToGrayscaleOp。
|
公用方法
TensorImage | |
int |
getOutputImageHeight(int inputImageHeight, int inputImageWidth)
指定輸入圖片大小時,計算預期輸出圖片的高度。
|
int |
getOutputImageWidth(int inputImageHeight, int inputImageWidth)
指定輸入映像檔大小時,計算預期輸出圖片的寬度。
|
PointF |
inverseTransform(PointF 點、int inputImageHeight、int inputImageWidth)
將結果圖片的座標系統,轉換為其中一張輸入圖片。
|
繼承的方法
公用建構函式
public TransformToGrayscaleOp ()
建立 TransformToGrayscaleOp。
公用方法
公開 TensorImage 套用 (TensorImage 映像檔)
將轉換套用至灰階,並傳回 TensorImage
。
如果輸入圖像已經是 ColorSpaceType.GRAYSCALE
,則這項操作為免人工管理。
參數
圖片 |
---|
擲回
IllegalArgumentException | image 不是 ColorSpaceType.RGB 或 ColorSpaceType.GRAYSCALE 。 |
---|
public int getOutputImageHeight (int inputImageHeight, int inputImageWidth)
指定輸入圖片大小時,計算預期輸出圖片的高度。
參數
inputImageHeight | |
---|---|
inputImageWidth |
public int getOutputImageWidth (int inputImageHeight, int inputImageWidth)
指定輸入映像檔大小時,計算預期輸出圖片的寬度。
參數
inputImageHeight | |
---|---|
inputImageWidth |
public PointF inverseTransform (PointF Point、int inputImageHeight、int inputImageWidth)
將結果圖片的座標系統,轉換為其中一張輸入圖片。
參數
分 | 擷取自結果座標系統的點。 |
---|---|
inputImageHeight | 都與輸入圖片的高度有關 |
inputImageWidth | 都與輸入圖片的寬度相等 |
傳回
- 帶有輸入圖片座標系統座標的點。