Control readout frequency

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Control readout frequency

aniri
I am using a Photometrics evolve camera and have had trouble with the speed display of the images as time gets bigger. I am using matlab with the CMMCore library. My initial thought when coming to this problem is the readout frequency of the camera and or the efficiency of my code.
The purpose of my code is not to register any picture but just to display and then discard (right away).
My code looks like follow:

 while (handles.mmc.isSequenceRunning())
         
         xlim([1 120]);%Identify the X axis
         hold on;
         i=i+1;
         if (handles.mmc.getRemainingImageCount()> 0)
            img1 = handles.mmc.getLastImage;%Recieve the image
          %  img1 = handles.mmc.popNextImage;
            [pixelType] = pixel(handles.mmc);%Define the pixel type, 8or16 bits. In our case it is 16
            [img1] = camprop(handles.mmc, img1,pixelType);%Properties needed by the camera
            img = transpose(img1);%Transpose the matrix to get the right picture
           
            %%%First signal
            sig(xp) = img(handles.X1,handles.Y1); %Knows the x and y coordinated and plots the signal
            sig(1)=img(handles.X1,handles.Y1); %Define the first value of sig
            %%%Second signal
            sig2(xp) = img(handles.X2,handles.Y2);%Knows the x and y coordinated and plots the signal
            sig2(1)=img(handles.X2,handles.Y2);%Define the first value of sig
            Y =[sig(xp),sig(xp-1)]; %Signal 1 interpolation
            Y2 =[sig2(xp),sig2(xp-1)]; %Signal 1 interpolation
            X = [xp , xp-1];    % X value of signal 1 and 2 which was set in the begining of the while loop
            axes(handles.axes1); % First axes where we will draw the first signal
           
            %%%Ploting of the first signal
            %%%%%%White rectangle that updates the signal
            if (xp < 120)
                 rectangle('Position',[xpm1 0 3 3000],'FaceColor','w','EdgeColor','w');
            end
            plot(X,Y);
            hold on;
            drawnow;
           
            %%%Potting of the second signal
            xlim([1 120]) %Defining the limit for the X axis
            hold on
            axes(handles.axes2);
            %%%%%%White rectangle that updates the signal
            if (xp < 120)
                 rectangle('Position',[xpm1 0 3 3000],'FaceColor','w','EdgeColor','w');
            end
            plot(X,Y2);
            hold on;
            drawnow;
            xp = xp+1;
            xpm1 = xpm1+1;
            if (xp > 120)
                xp = 2;
                 xpm1 = 1;
            end
            tt = tt+1;
         end
          handles.mmc.getImageBufferSize()
         
    end


Thank you in advance.