Advertisement
Voldemord

Untitled

Mar 10th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. obraz_we = double(obraz_we);
  2.  
  3. a = prog_dolny + round((prog_gorny - prog_dolny)/2);
  4.  
  5. x = size(obraz_we,1);
  6. y = size(obraz_we,2);
  7.  
  8. for i=1:x
  9. if obraz_we(i,1) < a
  10. obraz_we(i,1) = 0;
  11. else
  12. obraz_we(i,1) = 255;
  13. end
  14. disp(obraz_we(i,1));
  15. end
  16.  
  17. for i=1:x
  18. for j=2:y
  19. if obraz_we(i,j) <= prog_dolny
  20. obraz_we(i,j) = 0;
  21. elseif prog_dolny < obraz_we(i,j) && obraz_we(i,j) <= prog_gorny
  22. obraz_we(i,j) = obraz_we(i,j-1);
  23. elseif obraz_we(i,j) > prog_gorny
  24. obraz_we(i,j) = 255;
  25. end
  26. end
  27. end
  28.  
  29. obraz_wy = uint8(obraz_we);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement