Posted By

whitetiger on 11/09/06


Tagged

css javascript image jpg png java python osx filter tiger images standards PIL replacement glob RGB j2me gray bit planes level matlab semantics screenshot screenshots tiff


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

gartenstuhl


Matlab - showBitPlanes


 / Published in: MatLab
 

  1. % Ritorna i Bit Plabes dell'immagine a toni di grigio
  2.  
  3. function showBitPlanes(img)
  4.  
  5. imgGray = double( rgb2gray(img) );
  6. titleString = 'bit planes ';
  7.  
  8. % MSB ... LSB
  9. k = 128;
  10.  
  11. for b=1:8
  12.  
  13. subplot(2, 4, b);
  14. imshow( (bitand(imgGray, k) / k) * 255 ); % Fa un and dei bit
  15. title([titleString int2str(b-1)]);
  16. k = k/2; % Shifta di 2 i bit
  17.  
  18. end;
  19.  
  20. return;

Report this snippet  

You need to login to post a comment.