Image Saving to Variable in Workspace (NOT imwrite)
9 ビュー (過去 30 日間)
古いコメントを表示
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/271491/image.png)
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 件のコメント
Stephen23
2020 年 2 月 14 日
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 ?
採用された回答
その他の回答 (1 件)
Stephen23
2020 年 2 月 14 日
編集済み: Stephen23
2020 年 2 月 14 日
"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.
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!