Skip to content

Instantly share code, notes, and snippets.

@mohanteja1

mohanteja1/.m Secret

Created March 14, 2019 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohanteja1/775aa179df41cac21a500ebc69e6aa14 to your computer and use it in GitHub Desktop.
Save mohanteja1/775aa179df41cac21a500ebc69e6aa14 to your computer and use it in GitHub Desktop.
this is the matlab code i used
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