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!