Fix ImageItem rgb histogram calculation
This commit is contained in:
parent
fcf4503671
commit
c3e52f15b0
@ -489,14 +489,17 @@ class ImageItem(GraphicsObject):
|
|||||||
bins = [mn, mx]
|
bins = [mn, mx]
|
||||||
|
|
||||||
kwds['bins'] = bins
|
kwds['bins'] = bins
|
||||||
stepData = stepData[np.isfinite(stepData)]
|
|
||||||
if perChannel:
|
if perChannel:
|
||||||
hist = []
|
hist = []
|
||||||
for i in range(stepData.shape[-1]):
|
for i in range(stepData.shape[-1]):
|
||||||
h = np.histogram(stepData[..., i], **kwds)
|
stepChan = stepData[..., i]
|
||||||
|
stepChan = stepChan[np.isfinite(stepChan)]
|
||||||
|
h = np.histogram(stepChan, **kwds)
|
||||||
hist.append((h[1][:-1], h[0]))
|
hist.append((h[1][:-1], h[0]))
|
||||||
return hist
|
return hist
|
||||||
else:
|
else:
|
||||||
|
stepData = stepData[np.isfinite(stepData)]
|
||||||
hist = np.histogram(stepData, **kwds)
|
hist = np.histogram(stepData, **kwds)
|
||||||
return hist[1][:-1], hist[0]
|
return hist[1][:-1], hist[0]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user