how to assign zero value to all pixels in an image ?
41 visualizzazioni (ultimi 30 giorni)
Jan il 11 Set 2013
It depends on what an "image" is. Please post more details in future questions. Fortunately the procedure to set the values to 1 is equal:
Img = rand(1024, 768, 3); % RGB image
Img(:) = 0;
Img2 = randi([0, 255], 1024, 768, 'uint8');
Img2(:) = 0;
Più risposte (2)
sidra il 11 Set 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
where n and m are the number of rows and columns respectively.