Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- R = input(:, :, 1);
- G = input(:, :, 2);
- B = input(:, :, 3);
- R_white = white(1);
- G_white = white(2);
- B_white = white(3);
- R_balanced = R / R_white;
- G_balanced = G / G_white;
- B_balanced = B / B_white;
- R_balanced(R_balanced > 1) = 1;
- G_balanced(G_balanced > 1) = 1;
- B_balanced(B_balanced > 1) = 1;
- result = cat(3,R_balanced,G_balanced,B_balanced);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement