用法:
skimage.exposure.adjust_gamma(image, gamma=1, gain=1)
對輸入圖像執行 Gamma 校正。
也稱為冪律變換。在將每個像素縮放到 0 到 1 的範圍後,此函數根據等式
O = I**gamma
對輸入圖像進行逐像素變換。- image:ndarray
輸入圖像。
- gamma:浮點數,可選
非負實數。默認值為 1。
- gain:浮點數,可選
常數乘數。默認值為 1。
- out:ndarray
伽瑪校正的輸出圖像。
參數:
返回:
注意:
對於大於 1 的 gamma,直方圖將向左移動,輸出圖像將比輸入圖像更暗。
對於小於 1 的 gamma,直方圖將向右移動,輸出圖像將比輸入圖像更亮。
參考:
例子:
>>> from skimage import data, exposure, img_as_float >>> image = img_as_float(data.moon()) >>> gamma_corrected = exposure.adjust_gamma(image, 2) >>> # Output is darker for gamma > 1 >>> image.mean() > gamma_corrected.mean() True
相關用法
- Python skimage.exposure.histogram用法及代碼示例
- Python skimage.exposure.rescale_intensity用法及代碼示例
- Python skimage.exposure.is_low_contrast用法及代碼示例
- Python skimage.exposure.cumulative_distribution用法及代碼示例
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.color.lab2lch用法及代碼示例
- Python skimage.draw.random_shapes用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
- Python skimage.feature.blob_dog用法及代碼示例
- Python skimage.filters.unsharp_mask用法及代碼示例
- Python skimage.registration.optical_flow_tvl1用法及代碼示例
- Python skimage.filters.rank.noise_filter用法及代碼示例
- Python skimage.filters.gaussian用法及代碼示例
- Python skimage.feature.graycoprops用法及代碼示例
- Python skimage.segmentation.active_contour用法及代碼示例
- Python skimage.feature.corner_orientations用法及代碼示例
- Python skimage.morphology.h_minima用法及代碼示例
- Python skimage.filters.threshold_otsu用法及代碼示例
- Python skimage.feature.structure_tensor用法及代碼示例
- Python skimage.transform.hough_circle_peaks用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.exposure.adjust_gamma。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。