Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- image = imread('test.bmp');
- height = size(image)(1)
- width = size(image)(2)
- data = [];
- counter = 1;
- color = image(1)
- for x = 1:height
- for y = 1:width
- curentColor = image(x,y);
- if (curentColor == color)
- counter ++;
- else
- d = [color,counter];
- data = [data;d];
- counter = 1;
- color = curentColor;
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement