Hi all,
I have 2 files created, one a .pyx file with a class named AndorCamersSDK
which has a function named LiveAcquisition(). The second file, a .py file
with a Class AndorCameraGUI which makes use of Tkinter to create a GUI.
This class has function LivePlot(), and RepeatPlot().Inside
LiveAcquisition() I am acquiring N number of frames and after acquiring
each frame I need to display it using LivePlot() and RepeatPlot(). Without
the display, just acquiring and storing for 300 frames takes 6.2 for
execution, which is fine by me. But When I start displaying even for 100
frames it takes 54sec. I need to acquire and display within 6 sec for 300
frames. How do I solve this?
?
File 1: .pyx code ; Present inside class AndorCameraSDK
def LiveAcquisition(self):
for i in range(no_of_frames):
data[i,:,:] = PyArray_NewFromDescr(<PyTypeObject *>
np.ndarray, np.dtype('<H'), 2,dims, strides,pBuf, np.NPY_C_CONTIGUOUS,
None)
if (i==0):
self.master.LivePlot(data[i,:,:])
elif (i==2) or (i==15) or (i ==65) or (i ==96):
self.master.RepeatPlot(data[i,:,:])
else:
pass
?
File 2 : .py code; Below functions are present inside a class named
AndorCameraGUI
def LivePlot(self,image):
self.count = 0
self.fig = Figure(figsize = (4, 5))
self.fig.patch.set_facecolor('xkcd:light grey') # When this is
removed a white color is seen in the background of the figure
self.a = self.fig.add_subplot(111)
self.a.set_xlim([0, self.image_width/int(self.HBin)])
self.a.set_ylim([0, self.image_height/int(self.VBin)])
image = image.transpose()
self.a.imshow(image,'gray')
self.canvas = FigureCanvasTkAgg(self.fig,self.master)
self.canvas.draw()
self.canvas.get_tk_widget().pack(side =LEFT)
self.toolbar = NavigationToolbar2TkAgg(self.canvas,self.master)
self.toolbar.update()
self.canvas._tkcanvas.pack(side = LEFT)# change this to TOP so
thee the navigation toolbar on the left down
def RepeatPlot(self,image):
image = image.transpose()
self.a.imshow(image,'gray')
self.canvas.draw()
···
--
Regards,
Aishwarya Selvaraj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20180605/2abb60d9/attachment-0001.html>