Image Processing
    2 ビュー (過去 30 日間)
  
       古いコメントを表示
    
Hi 2 all,
I have one formula for finding moments But i could not know how to proceed further i.e) how to write matlab code for this.Anyone can clarify this? Please send ur suggestion....
imagemoment=summation(imagepixel(i,j)*(x-x')2) / summation(imagepixel(i,j))
summation will be perfformed from 1 to 8
My code:
im=imread('image.jpg'); %binary image of 256x256
u1=xcos(0)+ysin(0);
for i=1:256
for j=1:256 
   for k=1:8
      for l=1:8
         sigma(k,l)=im(k,l)*u1; %doubtful statement
end
end
end
end
%here sigma value must be the summation of 64 values that means in x axis 8 values and y axis 8 values(8x8 block) How to perform this cumulative addition Please post how to perform basic summation Thx in advance........
im1=
x=1 to 8
x'=summation(imagepixel*x) / summation(image pixel)
i,j varies from 1 to 8
13 件のコメント
  Jan
      
      
 2011 年 9 月 20 日
				Please write a comment to proecsm's answer. Does it solve your problem? If not, why? What modifications are needed? 
採用された回答
  bym
      
 2011 年 9 月 18 日
        for each 8x8 block, you will want to calculate:
im = rand(8)>.5;             % generate image data
xbar = 4.5;                  % mean x
ybar = xbar;                 % mean y
im2moment = zeros(8);       % allocate memory 
for c = 1:8
    for r = 1:8
        im2moment(r,c) = (r-ybar).^2*(c-xbar).^2*im(r,c);
    end
end
imagemoment = sum(sum(im2moment))/sum(sum(im));
その他の回答 (1 件)
  heba ahmed
 2020 年 2 月 23 日
        b=uint8(zeros(256,256));
>> [i j]=size(b);
>> for i=1:256 for j=1:256 b(i,j)=i;
end
end
>> imshow(b,[8]);
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




