Motion tracking for research
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
David Young
am 1 Sep. 2011
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.
Akzeptierte Antwort
Walter Roberson
am 31 Aug. 2011
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 Kommentare
Walter Roberson
am 1 Sep. 2011
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
am 1 Sep. 2011
The use of sum on the thresholded image is neat! I scratched a bit about the cumsum and headed down a different rabbit hole :)
Weitere Antworten (1)
Ashish Uthama
am 31 Aug. 2011
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);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Image Processing and Computer Vision finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!