Effacer les filtres
Effacer les filtres

How to save current Image from Figure Plot

5 vues (au cours des 30 derniers jours)
Tallha Akram
Tallha Akram le 26 Fév 2013
Hi,
imshow(image1); hold
himage=imshow(image2);
set(himage, 'AlphaData', 0.3); % 0.3 control transparent behavior, 1=Not Transparent.
This Code show image1 and then image2 in one figure with Image2 is transparent and control with number, 0.3 here.
How to save the current figure ( Combination of Image1 and Image2) into some variable to be used later in workspace.
Regards.

Réponse acceptée

Walter Roberson
Walter Roberson le 26 Fév 2013
If you are trying to create a data array that is the two images combined with the upper one alpha 0.3, then especially if the images are the same size, the easiest way is to do the calculation yourself.
alphaval = 0.3;
image1d = im2double(image1); %use 0 to 1 range
image2d = im2double(image2); %use 0 to 1 range
combined = image1d .* (1-alphaval) + image2d .* alphaval;
The above code has the advantage of working even if the images were not originally the same data class.
If the images are originally the same data class, then you do not strictly need to covert to double, but you get better accuracy if you do.

Plus de réponses (1)

Youssef  Khmou
Youssef Khmou le 26 Fév 2013
hi, in the figure go to "File", and "Save as " and save it with ".fig" .
  1 commentaire
Tallha Akram
Tallha Akram le 26 Fév 2013
actually i am working on 100 images per folder and i have total 20 folders. it is not feasible to save manually.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by