https://groups.google.com/d/topic/pyqtgraph/ofKMx-oWbx8/discussion



On Thursday, October 11, 2018 at 3:52:45 PM UTC-4, [email protected] wrote:
>
> Hello,
>
> I have a problem when displaying an image having all its pixels forced at 
> the same value, for example 0.
> This trivial example illustrates the problem :
>
> import numpy as np
> import pyqtgraph as pg
>
> imageData = np.zeros(shape=(150,150), dtype=np.int)
> pg.image(imageData)
>
>
> The result is :
>
> runfile('C:/Users/Marc/.spyder-py3/temp.py', 
> wdir='C:/Users/Marc/.spyder-py3')
> C:\Users\Marc\Anaconda3\lib\site-packages\pyqtgraph\graphicsItems\ImageItem.py:464:
>  
> RuntimeWarning: invalid value encountered in double_scalars
>   bins = np.arange(mn, mx+1.01*step, step, dtype=np.int)
> Traceback (most recent call last):
>
>   File 
> "C:\Users\Marc\Anaconda3\lib\site-packages\pyqtgraph\graphicsItems\HistogramLUTItem.py",
>  
> line 195, in imageChanged
>     h = self.imageItem().getHistogram()
>
>   File 
> "C:\Users\Marc\Anaconda3\lib\site-packages\pyqtgraph\graphicsItems\ImageItem.py",
>  
> line 464, in getHistogram
>     bins = np.arange(mn, mx+1.01*step, step, dtype=np.int)
>
> ValueError: arange: cannot compute length
>
>
> Any idea on the way to solve this without disabling the nice histogram 
> functionality ?
> My real application is displaying images updated slighly more than one 
> time per second, and sometimes a constant image is generated.
> As a work around when I find such an image, I add a small value to one of 
> the pixels, but this is not a nice solution because the auto adujstment of 
> the luminance scale displays a white dot on a black image ;-)
>
> Marc
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/a3f19f18-b2a4-4043-ac7a-673e75c09307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to