local mean and standard deviation
3 ビュー (過去 30 日間)
古いコメントを表示
sir is there any difference between local mean and mean of a pixel?????????? i need to calculate the local mean and standard deviation of a pixel..... how to do it.... please do reply.....
0 件のコメント
採用された回答
Matt J
2013 年 1 月 19 日
編集済み: Matt J
2013 年 1 月 19 日
For example, if you want sliding means and stds in all 3x3 neighborhoods
slidingmean=conv2(A,ones(3)/9,'same');
slidingstd=stdfilt(A);
or if you don't have the Image Processing Toolbox
slidingstd=sqrt( conv2(A.^2,ones(3)/9,'same') - slidingmean.^2 );
0 件のコメント
その他の回答 (1 件)
Image Analyst
2013 年 1 月 19 日
I'm not sure you got the terminology right, but the mean of a pixel is just the value of the pixel, because a pixel has a single value unless you're talking about the pixel going across different color channels (in a true color or multispectral image) or across the z dimension in a volumetric image where each slice or plane is the image at a different depth. I don't think you're talking about such images and that you're talking about a normal gray scale 2D image. Correct me if I'm wrong.
The local mean is the mean of several pixels in a region (for example a rectangular 3 by 3 window) around the pixel. The code Matt gave you will do that.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!