Acquire images in loop and save as different name
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    simon
 el 4 de Jul. de 2016
  
    
    
    
    
    Comentada: Image Analyst
      
      
 el 4 de Jul. de 2016
            Hey,
I'm running a for loop where I acquire images from my webcam using snapshot(). Through each iteration of the loop, I'd like to have each image have a different name so I can look at them all at the end, without the previous ones being overwritten.
I do NOT want to save them to the disk, just a different name in the script, and I have no idea how to do this.
Hope you guys can help! :)
Thanks!
0 comentarios
Respuesta aceptada
  Stephen23
      
      
 el 4 de Jul. de 2016
        
      Editada: Stephen23
      
      
 el 4 de Jul. de 2016
  
      Simply put the frames into a cell array:
 C = {};
 for ... % your loop
     C{end+1} = snapshot(...);
 end
And then use indexing to access them. Simple!
Creating new variables dynamically is slow and buggy:
2 comentarios
  Image Analyst
      
      
 el 4 de Jul. de 2016
				Sometimes it's tricky to figure out when to use braces, parentheses, or brackets. We try to explain it in the FAQ entry on cell arrays: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
Más respuestas (0)
Ver también
Categorías
				Más información sobre Image Preview and Device Configuration en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


