Motion tracking for research

2 次查看(过去 30 天)
Hi All,
First, thanks for any help in advance. I appreciate it. Alright, so I am looking for a way to plot the displacement of the larynx as someone is speaking over time. I have a high-speed camera where I am recording someone speak (their neck/larynx) at 300 FPS. I've imported the video into MATLAB, converted the frames to BW with nice thresholding so that I have just the edge of the neck including the larynx and nothing else, but am stuck at finding a way to identify the peak of the larynx and then tracking this displacement from frame to frame. Again, any help is greatly appreciated.
  4 个评论
David Young
David Young 2011-9-1
The image posted looks like a synthetic image, not the real thing. It's very likely that techniques developed using it will fail on the real images from the video - a version of the "toy-worlds" problem familiar to AI researchers. I think it would be better to post an example (or several) from the actual data.
Chris Garry
Chris Garry 2011-9-9
Will do. I've been quite busy lately but will post when I have some time.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2011-8-31
Row-wise, find() the location of the first black pixel. That list of pixels will have a minima in it, where minima is defined as the number on both sides being larger, which is a fairly simple logical test.
Let's see... if the white pixels are 1 and the black are 0, then you can find the location of the black area as cumsum() along rows.
  5 个评论
Walter Roberson
Walter Roberson 2011-9-1
The only reason I can think of at the moment why you might want to do curve fitting would be if you have a mathematical model of the larynx as a curve that has a phase component to it and you want to do a phase correction.
Your curve looked fairly smooth in the test image. If there is some noise in it so that there are multiple peaks, then do some standard filtering to reduce the noise, such as doing median filtering on the heights before doing the logical test. Or use one of the MATLAB File Exchange peak-finding routines.
Ashish Uthama
Ashish Uthama 2011-9-1
The use of sum on the thresholded image is neat! I scratched a bit about the cumsum and headed down a different rabbit hole :)

请先登录,再进行评论。

更多回答(1 个)

Ashish Uthama
Ashish Uthama 2011-8-31
Here is one attempt using something Walter suggested. You might be able to modify this to generalize it enough for your application.
im = imread('l.png');
% assume its logical (since you mentioned a threshold)
bw = im(:,:,1)<1;
numRows = size(bw,1);
% Compute the 'length' from the left to the neck
lengths = zeros(numRows,1);
for rowInd = 1: numRows
lengths(rowInd) = find(bw(rowInd,:),1,'first');
end
% You ought to see the bump as the local minima:
figure;plot(lengths);
% You might be able to code something logically to get the bump from
% the above (what Walter alludes to as 'fairly simple logic test'
% Since I am having fun, I am just gonna try something fancy. Try to fit a smooth polynomial to the curve, the bump would turn up as a
% residual.
p = polyfit(1:numRows,lengths',3);
fittedCurve = polyval(p, 1:numRows);
figure; plot(fittedCurve);
% see the differences
residuals = fittedCurve - lengths';
figure; plot(residuals);
% The chin is messing things up...find a way to discount it:
chinOffset = 50;
[junk bumpInd] = max(residuals(chinOffset:end));
bumpInd = bumpInd+chinOffset;
%Show on the image
imagesc(bw);colormap gray;hold on;
plot(lengths(bumpInd), bumpInd, 'R*','markerSize',10);

类别

Help CenterFile Exchange 中查找有关 Image Processing and Computer Vision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by