how to assign zero value to all pixels in an image ?
Afficher commentaires plus anciens
assign zero value to pixel
Réponse acceptée
Plus de réponses (2)
sidra
le 11 Sep 2013
I don't understand what purpose setting all the pixel values to zero would achieve.
Nevertheless One of the method is:
You can use two for loops starting from 1 to you image size and the within these loops set the pixel values to zero. Something of this sort
for i=1:n
for j=1:m
img(i,j)=0;
end
end
where n and m are the number of rows and columns respectively.
2 commentaires
sheno39
le 11 Sep 2013
Image Analyst
le 11 Sep 2013
% Find all pixels < 3
binaryImage = f < 3; % binaryImage is what you called x
Now, what's f(n)? What is n? In f(x), x is all pixels less than 3. But what is n in f(n)?
Image Analyst
le 11 Sep 2013
Yet another way
grayImage = zeros(size(grayImage), 'uint8');
1 commentaire
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!