Image Saving to Variable in Workspace (NOT imwrite)
7 views (last 30 days)
Show older comments
Daniel Posada
on 13 Feb 2020
Commented: Daniel Posada
on 14 Feb 2020
Hi everyone,
From a computational time point of view, I'm trying to save an image into the workspace instead of creating a figure and grabbing the image. I'm performing a very important task in a very short amount of time 10 sec, and have to perform this task repetitively.
Therefore saving the image using imwrite() is not acceptable due to the computational requirement of having to save the image in memory, and retrieving it. Attached is a code and an image of the figure I am creating as well. Instead of using imshow() in a figure, how can I save the image directly (LLLL).
CODE BEING USED:
figure('Name','Posible Brightness spots for quad-tree analysis');
imshow(sp_possible_quadtree, []);
axis image;
title('Potential blobs for croppping and performing quadtree', 'FontSize', captionFontSize);
LLLL = getimage;
OUTPUT OF THE CODE in a Figure:
then this is the image that is grabbed from the figure and saved.
------------------------------------------------------------------------------------------------------------
Instead of the code above, an ideal solution would be something like this or anything close that doesn't requiere to create an external window (figure handler) to grab it from there.
LLLL = ideal_unknown_function(sp_possible_quadtree, []);
Thanks for your help in advance.
3 Comments
Stephen23
on 14 Feb 2020
imshow shows an array of data in some axes whereas getimage returns an array of data from some axes, so what difference/s do you expect between sp_possible_quadtree and LLLL ?
Accepted Answer
More Answers (1)
Stephen23
on 14 Feb 2020
Edited: Stephen23
on 14 Feb 2020
"In this case sp_possible_quadtree is a double. where the contents are either 0 for Black, or an integer 1, 2, 3, 4, ... n"
LLLL = sp_possible_quadtree ./ n
Images stored as floating point are assumed to be scaled from 0 to 1, so you just need to rescale your image.
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!