How to assign zero pixel location of one image to other
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I need to assign zero pixel location of one image to the zero pixel location of other
Can anybody suggest something about this
Thanks in advance
2 Commenti
David Young
il 22 Set 2011
Your question is not clear: please can you explain what you mean, perhaps with a small example of the images before and after assignment.
Risposte (2)
Image Analyst
il 22 Set 2011
Do you mean like you want image2 to be zero in the same places that image1 is? Like this(untested):
image2(image1==0) = 0;
Please clarify.
2 Commenti
Image Analyst
il 22 Set 2011
Try this:
image1 = [1 2 0;3 0 1;0 7 5]
image2 = [2 2 3;5 5 1;7 7 5]
pixelsToReplace = image1 == 0
image1(pixelsToReplace) = image2(pixelsToReplace)
1 Commento
Image Analyst
il 22 Set 2011
You should note that I already showed you this concept in your nearly identical question: http://www.mathworks.com/matlabcentral/answers/16350-how-to-remove-pixels-in-an-image
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!