Image acquisition speed using a photometrics camera
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
I have an imaging camera that I wanted to use and so I developed a Matlab GUI for this camera. The GUI displays 16 bits 128x128 images acquired from the camera at a specific rate. To change and manipulate properties of the camera I am using the MMCore library. The image acquisition works smoothly (as I am only displaying and not saving the images). Overtime as the images are being acquired, the speed of the acquisition slows down significantly (even if I have a circular buffer).
The code used for the displaying the images is as follows:
import mmcorej.*; 
mmc = CMMCore; 
mmc.loadDevice('Camera', 'PVCAM', 'Camera-1') 
mmc.initializeDevice(mmc.getCameraDevice()); 
mmc.initializeCircularBuffer(); 
mmc.detectDevice(mmc.getCameraDevice()); 
mmc.setCircularBufferMemoryFootprint(1000); 
mmc.startContinuousSequenceAcquisition(500); 
cap = mmc.getBufferTotalCapacity(); 
img = zeros(128,128, 7000); 
sig = zeros(1, 7000); 
i=2; 
n=0; 
format shortg; 
while (mmc.isSequenceRunning()) 
    i=i+1; 
    if (mmc.getRemainingImageCount()> 0) 
        img1 = mmc.popNextImage; 
        [pixelType] = pixel(mmc); 
        [img1] = camprop(mmc, img1,pixelType); 
        img(:,:,i) = transpose(img1); 
        imagesc(img(:,:,i)); 
        sig(i) = img(50,50,i); 
        sig(2)=1500; 
        Y =[sig(i),sig(i-1)]; 
        X = [i , i-1]; 
        subplot(2,1,1); 
        plot(X, Y); 
        hold on; 
        drawnow;   
        subplot(2,1,2); 
        imagesc(img(:,:,i)); 
        drawnow; 
    end 
    if i== 1000 
        mmc.stopSequenceAcquisition(); 
    end 
end 
exposuretime = mmc.getExposure(); 
i 
mmc.clearCircularBuffer(); 
mmc.unloadAllDevices();
How can I make sure the frames will not slow down in Matlab?
Thank you in advance
3 comentarios
Respuestas (0)
Ver también
Categorías
				Más información sobre Point Grey Hardware en Help Center y File Exchange.
			
	Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


