필터 지우기
필터 지우기

How can i convert the first image(Red) like the second one(Black)?

조회 수: 2 (최근 30일)
siet ece
siet ece 2021년 8월 1일
댓글: siet ece 2021년 8월 2일
  댓글 수: 2
Rik
Rik 2021년 8월 1일
You want to fit a certain function to your data. What have you tried so far?
siet ece
siet ece 2021년 8월 1일
cover=imread('Lenna.png');
coverplane1=int32(cover(:,:,1));
for i=1:512
for j=1:511
PixelDiffOriginal(i,1:511)=coverplane1(i,j)-coverplane1(i,j+1);
end
end
[N1,edges1]=histcounts(PixelDiffOriginal);
edges1=edges1(2:end)-(edges1(2)-edges1(1))/2;
plot(edges1,N1);
%% i just tried to plot a graph(black graph) but i got the red graph, how can i obtain the black graph?

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

채택된 답변

Image Analyst
Image Analyst 2021년 8월 1일
Use plot() instead of stem().
  댓글 수: 5
Image Analyst
Image Analyst 2021년 8월 2일
The black curve in your original post doesn't look smooth to me. But anyway, you can smooth the data and then plot the smoothed data with a sliding polynomial fit filter, sgolayfilt() in the Signal Processing Toolbox.
polynomialOrder = 2; % Larger for less smoothing.
windowWidth = 7; % Larger for more smoothing.
smoothedSignal = sgolayfilt(signal, polynomialOrder, windowWidth);
plot(smoothedSignal, 'b-', 'LineWidth', 3);
grid on;
title('Smoothed Signal', 'FontSize', 20);
If you don't have sgolayfilt(), try movmean().
siet ece
siet ece 2021년 8월 2일
its working, thank u so much.

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

추가 답변 (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