Optical flow lines を説明して欲しい
Afficher commentaires plus anciens
openExample('vision/viptrafficofExample')を使ってオプティカルフローの表示をしています。
simlink上のOptical flow linesブロック内のコードです。
function vel_Lines=OpticalFlowLines(vel_Values, scaleFactor)
% Generates the coordinate points of optical flow lines
persistent first_time;
persistent X;
persistent Y;
persistent RV;
persistent CV;
if isempty(first_time)
first_time = 1;
%% user may change the following three parameters
borderOffset = 5;
borderOffset = 5;
decimFactorCol = 5;
%%
[R C] = size(vel_Values);
RV = borderOffset:decimFactorRow:(R-borderOffset);
CV = borderOffset:decimFactorCol:(C-borderOffset);
[Y X] = meshgrid(CV,RV);
end
tmp = vel_Values(RV,CV);
tmp = tmp.*scaleFactor;
vel_Lines = [Y(:), X(:), Y(:)+real(tmp(:)), X(:)+imag(tmp(:))];
このコードが指し示す意味が分かりません。このブロックは何の操作をしていますか??
1.functionは何の操作をしていますか??
2.persistent、borderOffset、borderOffset等の変数は何の値を指し示していますか?
3.if 内の操作はどういう意味ですか?
4.最後の三行はどの様な操作をしていますか??
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 追跡と動き推定 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!