Explain the following encoding code

Below code is used in encoding where B=pic(:,:,1) is matrix of image.
for v v = 1:1000 % This is the encoder.
for uu = 1:7
if msgmat(vv,uu)==1;
if rem(B(idx(uu+7*(vv-1))),2)==0
B(idx(uu+7*(vv-1))) = B(idx(uu+7*(vv-1)))+1;
end
elseif rem(B(idx(uu+7*(vv-1))),2)==1
B(idx(uu+7*(vv-1))) = B(idx(uu+7*(vv-1)))-1;
end
end
Please tell me whats going on in above code ???? v v and uu are variables

답변 (1개)

Walter Roberson
Walter Roberson 2014년 3월 6일

0 개 추천

The code sets the bottom bit of a location in B to be the same as the value of msgmat() at a location.
idx(uu+7*(vv-1)) would work out the same as idx(uu,vv) provided that idx had 7 rows.

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

태그

질문:

2014년 3월 6일

답변:

2014년 3월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by