How to delete every second pixel of each row from a photo?
Afficher commentaires plus anciens
Hi everyone,
I need to write a program which will take a photo as a input and then I want to delete every second pixel of each row from a photo.
How can i do this? Thank you very much.
regards
ferdows
Réponse acceptée
Plus de réponses (2)
Rushikesh Tade
le 13 Sep 2014
Modifié(e) : Rushikesh Tade
le 13 Sep 2014
Try following code:
function output_image=alternate_rows(input_image)
output_image=[];
for i=1:size(input_image,1)
output_image=[output_image input_image(i,1:2:size(input_image,2))]
end
Adam
le 13 Sep 2014
nCols = size( photo, 2 );
photo = photo( :, 1:2:nCols );
Catégories
En savoir plus sur Image Processing Toolbox 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!