Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [ Y ] = histtransform(X, h, v)
- [M ,N]=size(X);
- x_pixels=M*N;
- Y=zeros(M,N);
- %taksinomisi tou pinaka se auksousa seira
- %for k=1:...
- %while numofv(i)/numofpixels < h(i)
- % y(k)=v(i)
- % y=unique(X);
- resh=reshape(X,[256*256,1]);
- tab=tabulate(resh);
- a=tab(:,1);
- b=tab(:,2);
- v_pixels=0;
- y_counter=1;
- for k=1:max(size(v))
- while ((v_pixels/x_pixels)<h(k)&&(y_counter<=length(a)))
- Y( X == a(y_counter) ) = v(k);
- v_pixels = v_pixels + b(y_counter);
- y_counter = y_counter+1;
- % for i=1:M
- % for j=1:N
- % if ( X(i,j)== y(i))
- % Y(i,j)=v(k);
- % v_pixels= v_pixels +1;
- % end
- % end
- % end
- %b_count = b_count+ 1;
- end
- v_pixels=0;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement