用法:
cucim.skimage.exposure.histogram(image, nbins=256, source_range='image', normalize=False)
返回圖像的直方圖。
與
numpy.histogram
不同,此函數返回 bin 的中心,並且不會重新組合整數數組。對於整數數組,每個整數值都有自己的 bin,這提高了速度和intensity-resolution。在展平圖像上計算直方圖:對於彩色圖像,應在每個通道上單獨使用該函數以獲得每個顏色通道的直方圖。
- image:數組
輸入圖像。
- nbins:整數,可選
用於計算直方圖的 bin 數量。對於整數數組,此值將被忽略。
- source_range:字符串,可選
‘image’(默認)確定輸入圖像的範圍。 ‘dtype’ 確定該數據類型圖像的預期範圍。
- normalize:布爾型,可選
如果為 True,則通過其值的總和對直方圖進行歸一化。
- hist:數組
直方圖的值。
- bin_centers:數組
bin 中心的值。
參數:
返回:
例子:
>>> import cupy as cp >>> from skimage import data >>> from cucim.skimage import exposure, img_as_float >>> image = img_as_float(cp.array(data.camera())) >>> cp.histogram(image, bins=2) (array([ 93585, 168559]), array([0. , 0.5, 1. ])) >>> exposure.histogram(image, nbins=2) (array([ 93585, 168559]), array([0.25, 0.75]))
相關用法
- Python cucim.skimage.exposure.rescale_intensity用法及代碼示例
- Python cucim.skimage.exposure.cumulative_distribution用法及代碼示例
- Python cucim.skimage.exposure.adjust_gamma用法及代碼示例
- Python cucim.skimage.exposure.is_low_contrast用法及代碼示例
- Python cucim.skimage.feature.shape_index用法及代碼示例
- Python cucim.skimage.restoration.richardson_lucy用法及代碼示例
- Python cucim.skimage.util.invert用法及代碼示例
- Python cucim.skimage.data.binary_blobs用法及代碼示例
- Python cucim.skimage.filters.roberts_neg_diag用法及代碼示例
- Python cucim.skimage.color.lch2lab用法及代碼示例
- Python cucim.skimage.measure.label用法及代碼示例
- Python cucim.skimage.color.rgb2gray用法及代碼示例
- Python cucim.skimage.filters.gabor用法及代碼示例
- Python cucim.skimage.transform.rescale用法及代碼示例
- Python cucim.skimage.filters.roberts_pos_diag用法及代碼示例
- Python cucim.skimage.segmentation.random_walker用法及代碼示例
- Python cucim.skimage.filters.roberts用法及代碼示例
- Python cucim.skimage.morphology.dilation用法及代碼示例
- Python cucim.skimage.feature.corner_foerstner用法及代碼示例
- Python cucim.skimage.measure.moments_coords用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cucim.skimage.exposure.histogram。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。