Hi, i need to divide all 5 images into 16x16 block, then perform "minus" operation (i.e 1st from 3rd image, then calculate "mean").Likewise for (3rd and 5th image) and (2nd and 4th image) using block process

조회 수: 2 (최근 30일)
Thanks in advance

채택된 답변

Walter Roberson
Walter Roberson 2016년 6월 29일
See mat2cell() and cellfun()

추가 답변 (1개)

kaavya subramani
kaavya subramani 2016년 6월 29일
편집: Walter Roberson 2016년 6월 29일
Thanks a lot sir, i have tried code using those 2 function, please check whether it is correct.
n=16*ones(1,16)
k=[img1 img2 img3 img4 img5]
for i=1:length(k)
blockres(i)=mat2cell(i,n,n)
end
for p=1:length(blockres)-2
for q=2+p:length(blockres)
minus(p)=cellfun(@minus,p,q,'uniform',0)
end
sum(p)=cellfun(@sum,minus,'uniform',0)
end
mean(p)=cellfun(@mean,sum,'uniform',0)
  댓글 수: 5
kaavya subramani
kaavya subramani 2016년 6월 29일
Sorry sir,i noticed that from comment, but i not corrected in my code. n=16*ones(1,16) k={img1 img2 img3 img4 img5} for i=1:length(k) blockres(i)=mat2cell(k{i},n,n) end for p=1:length(blockres)-2 for q=2+p:length(blockres) minus(p)=cellfun(@minus,p{blockres},q{blockres},'uniform',0) end mean(p)=cellfun(@mean,sum,'uniform',0) end
kaavya subramani
kaavya subramani 2016년 6월 29일
k sir. n=16*ones(1,16) k={img1 img2 img3 img4 img5} for i=1:length(k) blockres(i)=mat2cell(k{i},n,n) end for p=1:length(blockres)-2 for q=2+p:length(blockres) res1(p)=cellfun(@minus,p{blockres},q{blockres},'uniform',0) end res2(p)=cellfun(@mean,sum,'uniform',0) end

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Signal Attributes and Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by