SHARE
TWEET

Untitled

a guest May 16th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. image = imread('test.bmp');
  2. height = size(image)(1)
  3. width = size(image)(2)
  4.  
  5. data = [];
  6. counter = 1;
  7.  
  8. color = image(1)
  9.  
  10. for x = 1:height
  11.   for y = 1:width
  12.    
  13.     curentColor = image(x,y);
  14.    
  15.     if (curentColor == color)
  16.       counter ++;
  17.     else
  18.       d = [color,counter];
  19.       data = [data;d];
  20.       counter = 1;
  21.       color = curentColor;
  22.     end
  23.   end
  24. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top