Optical flow lines を説明して欲しい
Show older comments
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.最後の三行はどの様な操作をしていますか??
Accepted Answer
More Answers (0)
Categories
Find more on 航空宇宙分野への適用 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!