how to get the function of a curve in an image by matlab

hi all
id like to know if there is any way if I have the photo of a lets say sinusoidal curve and need to extract its function , how is it possible to do in matlab ? also i need to know how to let matlab distinguish the curve of the function in the image

 채택된 답변

Image Analyst
Image Analyst 2014년 3월 5일

0 개 추천

Yes, it is. You can threshold the image and use find() to find the top-most pixel in the curve. So that will be your signal. You can then get the period and amplitude and thus define the equation.

추가 답변 (1개)

farzad
farzad 2014년 3월 6일

0 개 추천

thank you so much but please can you elaborate it ? what did you mean by threshold the image ? and in the find , I should enter the x,y value of the point that i already know ?

댓글 수: 1

Let's say the curve is black on a white background. And there is nothing else in the image, like you've cropped it so no axes are there, it's just the signal. You can do
binaryImage = grayImage < 128; % or whatever value works.
[rows, columns, numberOfColorChannels] = size(grayImage);
% For each column, find the pixel that's highest -
% that will be the y signal value for that column.
for c = 1 : columns
y(c) = rows - find(binaryImage(:,c), 1, 'first') + 1;
end

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

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2014년 3월 5일

댓글:

2014년 3월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by