필터 지우기
필터 지우기

How do I find the function corresponding to a graph image?

조회 수: 51 (최근 30일)
Karam Chehade
Karam Chehade 2020년 4월 7일
편집: Mehmed Saad 2020년 4월 8일
Dear MATLAB community,
I am trying to find the mathematical function corresponding to the following green curve (although I would be most thankful for suggestions for the blue one also). Unfortunately, I don't have the underlying data with which it was created. Can anyone help?
Thanks a lot in advance!

채택된 답변

Mehmed Saad
Mehmed Saad 2020년 4월 7일
Extract Data
After that you can find mathematical function
  댓글 수: 4
Karam Chehade
Karam Chehade 2020년 4월 8일
Thanks a lot! Could you tell me how you converted it, in case I need to repeat the work with another file?
Mehmed Saad
Mehmed Saad 2020년 4월 8일
편집: Mehmed Saad 2020년 4월 8일
This is the code, but you have to convert the picture to this format i.e. remove the other parts ( i used microsoft word for that xD)
this is a long method, i copied this code i don't remeber from where
fullFileName ='C:\Users\PROJECT PC\Pictures\data1.png';
rgbImage = imread(fullFileName);
rgbImage = imresize(rgbImage,10);
[rows, columns, numberOfColorBands] = size(rgbImage);
fontSize = 36
subplot(2, 2, 1);
imshow(rgbImage);
axis on;
title('Original Color Image', 'FontSize', fontSize);
set(gcf, 'Units', 'Normalized', 'Outerposition', [0, 0, 1, 1]);
greenChannel = rgbImage(:, :, 2);
binaryImage = greenChannel < 200;
%
subplot(2, 2, 2);
imshow(binaryImage);
axis on;
title('Binary Image', 'FontSize', fontSize);
verticalProfile = sum(binaryImage, 2);
lastLine = find(verticalProfile, 1, 'last')
for col = 1 : columns
yy = lastLine - find(binaryImage(:, col), 1, 'first');
if isempty(yy)
y(col) = 0;
else
y(col) = yy;
end
end
subplot(2, 2, 3);
plot(1 : columns, y, 'b-', 'LineWidth', 3);
grid on;
title('Y vs. X', 'FontSize', fontSize);
ylabel('Y', 'FontSize', fontSize);
xlabel('X', 'FontSize', fontSize);
%%
y2 = y(174:5213);
t = 0:1/length(y2):1-1/length(y2);
y_norm = y2/max(y2);
figure,plot(t(1:100:end),y_norm(1:100:end))

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by