Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.36 KB | None | 0 0
  1. function obrazek = binaryzacja(A, prog)
  2.   [x, y] = size(A);
  3.   for (ii = 1 : x)
  4.     for (jj = 1 : y)                      
  5.       if (A(ii, jj) > prog)             % Przyporządkowanie wartości 0 lub 255
  6.         obrazek(ii, jj) = 255;          % w zależności od progu
  7.       else
  8.         obrazek(ii, jj) = 0;
  9.       endif  
  10.     endfor
  11.   endfor
  12. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement