[ create a new paste ] login | about

Link: http://codepad.org/a65dtOfe    [ raw code | output | fork ]

C, pasted on Apr 24:
[filename, pathname] = uigetfile ({'*.jpg';'*.png'},'Select Images');
img_default = imread(filename);
A= rgb2gray(img_default);
P=A;
row = size(img_default,1);
coluum = size(img_default,2);
level =127;
max = 255;
min = 0;
for  x = 1: row
      for y = 1: coluum
          var = A(x,y);
          if var > level
              A(x,y) = max;
          end
      
      if var<= level
          A(x,y)= min;
      end
      end
end

subplot(1,3,1);
imshow(img_default);
title('default')


subplot(1,3,3);
imshow(A);
title('tach nguong')

subplot(1,3,2);
imshow(P);
title('xam')   


Output:
Line 1: error: expected identifier or '(' before '[' token
Line 35: warning: character constant too long for its type
Line 43: warning: character constant too long for its type
Line 1: error: expected identifier or '(' before ',' token
Line 52: warning: character constant too long for its type
Line 2: warning: data definition has no type or storage class
Line 2: error: 'filename' undeclared here (not in a function)
Line 2: error: initializer element is not constant
Line 3: warning: data definition has no type or storage class
Line 3: error: initializer element is not constant
Line 4: warning: data definition has no type or storage class
Line 4: error: initializer element is not constant
Line 5: warning: data definition has no type or storage class
Line 5: error: initializer element is not constant
Line 6: warning: data definition has no type or storage class
Line 6: error: initializer element is not constant
Line 7: warning: data definition has no type or storage class
Line 8: warning: data definition has no type or storage class
Line 9: warning: data definition has no type or storage class
Line 10: error: expected identifier or '(' before 'for'
Line 13: error: expected identifier or '(' before 'if'
Line 17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if'
Line 20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'end'
Line 24: warning: data definition has no type or storage class
Line 24: warning: parameter names (without types) in function declaration
Line 6: warning: character constant too long for its type
Line 25: error: expected declaration specifiers or '...' before '\x61756c74'
In function 'title':
Line 28: error: expected declaration specifiers before 'subplot'
Line 29: error: expected declaration specifiers before 'imshow'
Line 30: error: expected declaration specifiers before 'title'
Line 6: warning: character constant too long for its type
Line 33: error: expected declaration specifiers before 'imshow'
Line 34: error: expected declaration specifiers before 'title'
Line 6: warning: multi-character character constant


Create a new paste based on this one


Comments: