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
채택된 답변
추가 답변 (1개)
farzad
2014년 3월 6일
0 개 추천
댓글 수: 1
Image Analyst
2014년 3월 6일
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에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!