Skip to content

Instantly share code, notes, and snippets.

@mohanteja1 mohanteja1/.m Secret
Created Mar 14, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.