Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ObrazWejsciowy=double(ObrazWej);
- lw=size(ObrazWejsciowy,1);
- lk=size(ObrazWejsciowy,2);
- histogram=zeros(2, 256);
- dystrybuanta=zeros(2,256);
- for i=1:lk
- histogram(2,i) = i - 1;
- end
- for k=1:lw
- for j=1:lk
- histogram(1,ObrazWejsciowy(k,j)) = histogram(1,ObrazWejsciowy(k,j)) + 1;
- end
- end
- dystrybuanta(1,1) = histogram(1,1);
- for m=2:lw
- dystrybuanta(1,m) = dystrybuanta(1,m-1)+histogram(1,m);
- end
- for k=1:lw
- for j=1:lk
- ObrazWyjsciowy(k,j)=round(((dystrybuanta(1,ObrazWejsciowy(k,j) - dystrybuanta(1,1)))/dystrybuanta(1,256))*255);
- end
- end
- ObrazWyjsciowy=uint8(ObrazWyjsciowy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement