how to change the value of Neighbour pixels
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hello,
i wonder how can i change the value of Neighbour pixels around specific point without using massive loop..?
for example:
i have binary image and i want to remove (change the value of the pixel) an area of 5x5 pixels around specific point (x,y). i.e
is there any easy way to do this?
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
i want to the pixels in the range of 3x3 matrix around the point i,j=(3,5) will turn zero's
1 1 1 1 1 1 1 1 1 1
1 1 1 0 0 0 1 1 1 1
1 1 1 0 1 0 1 1 1 1
1 1 1 0 0 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 commentaire
Réponse acceptée
Iain
le 31 Juil 2013
map = false(size(image_to_mod));
map(down,along) = true;
dmap = imdilate(map,true(3,3));
change = xor(map,dmap);
image_to_mod(change) = false;
0 commentaires
Plus de réponses (1)
Image Analyst
le 31 Juil 2013
% Create original binary image.
binaryImage = true(5, 10)
% Assign ring of false
binaryImage(2:4, 4:6) = [false, false, false; false, true, false; false, false, false]
0 commentaires
Voir également
Catégories
En savoir plus sur Modify Image Colors dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!