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.
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
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 Exchange에서 Image 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