Esempio n. 1
0
video = add(video1,video2)

#video = ((np.ones(SIMSHAPE,dtype = "uint16")*2**8,)*2 for i in range(NFRAMES))

#: crop video to selected region of interest 
video = crop(video, roi = ((0,SHAPE[0]), (0,SHAPE[1])))

#: apply dust particles
dust1 = plt.imread(DUST1_PATH)[...,0] #float normalized to (0,1)
dust2 = plt.imread(DUST2_PATH)[...,0]
dust = ((dust1,dust2),)*NFRAMES

video = multiply(video, dust)


video = (tuple((adc(f, noise_model = NOISE_MODEL, saturation = SATURATION, readout_noise = READOUT_NOISE, bit_depth = ADC_BIT_DEPTH) for f in frames)) for frames in video)


if __name__ == "__main__":

    #: no need to load video, but this way we load video into memory, and we 
    #: can scroll back and forth with the viewer. Uncomment the line below
    #video = load(video, NFRAMES) # loads and displays progress bar

    #: camera 1
    viewer1 = VideoViewer(video, count = NFRAMES, id = 0, vmin = 0, cmap = "gray")
    viewer1.show()
    
    #: camera 2
    viewer2 = VideoViewer(video, count = NFRAMES, id = 1, vmin = 0, cmap = "gray")
    viewer2.show()
Esempio n. 2
0
                              dtype="uint16")

#: crop video to selected region of interest
video = crop(video, roi=((0, SHAPE[0]), (0, SHAPE[1])))

#: apply dust particles
if APPLY_DUST:
    dust = plt.imread(DUST1_PATH)[0:SHAPE[0], 0:SHAPE[1],
                                  0]  #float normalized to (0,1)
    dust = ((dust, ), ) * NFRAMES_FULL
    video = multiply(video, dust)

video = (tuple((adc(f,
                    noise_model=NOISE_MODEL,
                    saturation=SATURATION,
                    readout_noise=READOUT_NOISE,
                    bit_depth=BIT_DEPTH) for f in frames)) for frames in video)

if __name__ == "__main__":
    #: no need to load video, but this way we load video into memory, and we
    #: can scroll back and forth with the viewer. Uncomment the line below.
    #video = load(video, NFRAMES) # loads and displays progress bar

    #: VideoViewer either expects a multi_frame iterator, or a numpy array
    viewer = VideoViewer(video,
                         count=NFRAMES_FULL,
                         vmin=0,
                         cmap="gray",
                         vmax=VMAX)
    viewer.show()