필터 지우기
필터 지우기

Savitsky-Golay Filter Problem - Smoothing 3D line

조회 수: 4 (최근 30일)
William
William 2015년 4월 22일
댓글: William 2015년 4월 23일
I wanted to smooth a 3d line using the Savitzky-Golay filter, but for this example is seems to not work properly. Any ideas why, and how to fix it?
% Savitzky–Golay filter (sgolayfilt) - smoothing individual axes
windowWidth = 27; %Standard example values
polynomialOrder = 3;
xsg=sgolayfilt(points(:,1),polynomialOrder, windowWidth);
ysg=sgolayfilt(points(:,2),polynomialOrder, windowWidth);
zsg=sgolayfilt(points(:,3),polynomialOrder, windowWidth);
xyzsg = [xsg,ysg,zsg];
clf()
hold on
plot3(points(:,1),points(:,2),points(:,3),'bo')
plot3(xyzsg(:,1),xyzsg(:,2),xyzsg(:,3),'gx')
hold off
Green crosses show the smoothed version - blue circles is the original data
Cheers

채택된 답변

Image Analyst
Image Analyst 2015년 4월 22일
How many elements are in your array? 27 looks like an incredibly wide window for your data. I would have used a width of 5 to 9 elements. Try that and see how it works out.
  댓글 수: 12
Image Analyst
Image Analyst 2015년 4월 23일
That did not happen with the data I used. Is that a new/different set of data?
William
William 2015년 4월 23일
yes - i've attached it to the previous post

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by