-
-
Save mohanteja1/775aa179df41cac21a500ebc69e6aa14 to your computer and use it in GitHub Desktop.
this is the matlab code i used
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function w = lcgWeight(pixelValue, alpha, beta) | |
w = 17.6 *( pixelValue ^ alpha * ((1-pixelValue)^beta)); | |
end | |
%initialize array 0 to 255 | |
weights = uint8(linspace(0,255,256)); | |
% converts them into float values | |
weights=im2double(weights); | |
% pass double values into weight function and get weights | |
weights=arrayfun(@(x)lcgWeight(x,1,6,1),weights);` | |
%convert them into ints again | |
weights=im2uint8(weights); | |
% compensate for zeros |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment