Image Processing
이전 댓글 표시
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월 14일
@Jana: Please post at least a pseudo-code. It is not clear, where the "i,j varies from 1 to 8" should be applied.
harjan
2011년 9월 15일
Jan
2011년 9월 15일
@Jana: Please show, what you have done so far and post either Matlab or pseudo-code. It is your turn to make it as clear as possible, what you want to calculate. "Summation will be form i to j (1 to 8)" is simply cryptic. Therefore suggesting any implementations would be wild guessing only. Of course it is possible to guess, what you could need.
Please edit your original question and insert the algorithm in a meaningful notation (ask WikiPedia for "pseudo-code"). Then define the imputs exactly, e.g. "imagepixel" could be a be DOUBLE or UINT8.
harjan
2011년 9월 17일
Jan
2011년 9월 18일
@Jana: I'm not a native speaker and parsing your message is very hard for me. I'd appreciate, if you try to use proper English. Thanks.
Image Analyst
2011년 9월 18일
Even for a native English speaker like me it appears as gibberish, and takes twice as long to figure out what she means than if she had just written in standard English.
harjan
2011년 9월 19일
Jan
2011년 9월 19일
@Jana: "Sorry for the inconvenience" on one hand, but a repetition of "k Let i explain my qn clearly " on the other. This is not funny, nor fancy nor efficient - this is simply hard to read. Obviously you are not interested in my assistence. Perhaps there are enough others who like this slang. Good luck.
@Image Analyst: I'm not using standard English also, but I really try to get as near as I can.
harjan
2011년 9월 19일
Image Analyst
2011년 9월 19일
Then don't use words not in the dictionary such as ur, qn, ll, k, thx, etc. In other words, you're using a computer with a real keyboard, not a cell phone, so use the keyboard. That's what it's there for.
How many moments do you need? Is there any reason why you're not using mean(), std(), and var()? Do you need moments higher than 2? If so, why? I've rarely, if ever, found that I needed some higher moment to do anything meaningful.
harjan
2011년 9월 20일
Jan
2011년 9월 20일
Please write a comment to proecsm's answer. Does it solve your problem? If not, why? What modifications are needed?
harjan
2011년 9월 20일
채택된 답변
추가 답변 (1개)
heba ahmed
2020년 2월 23일
0 개 추천
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]);
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!