pixel based classification .

I have to do pixel based classification. for that I have used texture feature of entire image (like wavelet,lows). now I have to get neighbourwood sliding window(3,5,7) of this image and replace central pixel with the avg of neighbour and calulate mean,varience, energy of this and make a feature vector where rows are sample space and column are feature space. So far I have got the wavelet trasform how to procced for windowing process?
my approch- calculate texture (wavelet trasform) take nxn(3,5,7) neighbourhood calculate energy,mean,skewness,kurtosis in nXn neighbourhood(dont know how to get?)

 採用された回答

Adam
Adam 2016 年 8 月 31 日
編集済み: Adam 2016 年 8 月 31 日

0 投票

doc nlfilter
should help for a 2d image. It contains an example for median. Mean, variance, etc will be similar.

5 件のコメント

ashu
ashu 2016 年 8 月 31 日
編集済み: ashu 2016 年 9 月 1 日
Thanks adam, I am going to try it , I got matrix after nlfilter how to get feature space of every pixel by calculating mean,var of nlfilter output,I need to get sample and feature space of it.
Image Analyst
Image Analyst 2016 年 9 月 1 日
I'm going to assume you really didn't mean "replace the avg of neighbour with central pixel" and actually meant "replace the central pixel with the average of its neighbours."
For that, you can use imfilter() or conv2():
windowSize = 5;
kernel = one(windowSize)/ windowSize^2;
meanImage = conv2(grayImage, kernel, 'same');
meanImage = imfilter(grayImage, kernel); % Alternative
That will be much faster than nlfilter. For the others you'll still need nlfilter.
ashu
ashu 2016 年 9 月 1 日
編集済み: ashu 2016 年 9 月 1 日
I will edit that, thanks for your comment Image analyst. I have calculated mean,varience of the meanImage which is coming row vector 1x1480 for 42 Image, I am using 42 images so the feature vector for (mean,var feature)it will be 42x1480 right? am I doing something wrong I need this feat vec for classification (I have read about pixel based classification that rows should be sample space of pixels whereas cols should be feature space),the feat vec I am getting too big feat_vec,is it wrong approach for pixel based feature extraction? please suggest
Image Analyst
Image Analyst 2016 年 9 月 1 日
You need to give a dimension/direction. See the help. If you don't, they give the computations on a "per column" basis, which is why you ended up with a row vector.
To get the value for an entire image:
meanOfEntireImage = mean(grayImage(:)); % or
meanOfEntireImage = mean2(grayImage);
For a 2D array you can use mean2(), std2(), medfilt2().
ashu
ashu 2016 年 9 月 1 日
Thanks for instant reply Image analyst I am going to try this.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImage Processing Toolbox についてさらに検索

質問済み:

2016 年 8 月 31 日

編集済み:

2016 年 9 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by