Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.40 KB | None | 0 0
  1. %ler a imagem
  2. imagem = imread('nome_arquivo.jpg')
  3. %%numero de linhas, colunas e canais
  4. [rows, cols, channels] = size(imagem)
  5.  
  6.  
  7. for i = 1:rows
  8.     for j = 1:cols
  9.         red(i,j) = imagem(i,j,1);
  10.         green(i,j) = imagem(i,j,2);
  11.         blue(i,j) = imagem(i,j,3);
  12.     end
  13. end
  14.  
  15. subplot(2,2,1)
  16. imshow(imagem)
  17. subplot(2,2,2)
  18. imshow(red)
  19. subplot(2,2,3)
  20. imshow(green)
  21. subplot(2,2,4)
  22. imshow(blue)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement