save resulted image of fill

1 vue (au cours des 30 derniers jours)
jack
jack le 29 Déc 2015
Commenté : Walter Roberson le 29 Déc 2015
Hi guys,
I need your help in solving the following problem:
How can i save the resulted image of fill?
Thanks in advance.

Réponses (1)

Walter Roberson
Walter Roberson le 29 Déc 2015
also, saveas() and print()
More generally, if you are just working with ordinary fill then you can take the coordinates and use poly2mask() to determine array locations that would be affected, and then you can scribble in those locations:
YourImage = zeros(m, n, 3, 'uint8');
...
RedValue = 0; GreenValue = 255; BlueValue = 255; %for example yellow
mask = poly2mask(x,y,m,n);
%now store the color at the masked locations
idx = find(mask);
YourImage(idx + 0*(m*n)) = RedValue;
YourImage(idx + 1*(m*n)) = GreenValue;
YourImage(idx + 2*(m*n)) = BlueValue;
  2 commentaires
jack
jack le 29 Déc 2015
each of these (except poly2mask() since i don't have matlab 2015) change the resolution of images meaning that i don't get the expected result!!!!
Walter Roberson
Walter Roberson le 29 Déc 2015
poly2mask() was introduced before R2006a, but it is part of the Image Processing Toolkit.
If you are concerned about resolution in ways that the saveas() and print() resolution parameters cannot overcome, then you need to use savefig() or hgsave() to save as a figure. Possibly you overlooked the resolution documentation in print()? http://www.mathworks.com/help/matlab/ref/print.html#inputarg_resolution

Connectez-vous pour commenter.

Catégories

En savoir plus sur Printing and Saving 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