MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by nadia naji
on 29 Jan 2013

hi i need to delete horizontal velocity vector from output in optical flow is there any way to show special vector from output of optical flow function in matlab r2012a for example vector with special angles can you help me???

*No products are associated with this question.*

Answer by Image Analyst
on 29 Jan 2013

yourOutputArray(rowToDelete, :) = [];

nadia naji
on 31 Jan 2013

i cant understand your answer i use vision.optical flow and work with demo which exist in matlab for optical flow. the output array is out?? and what is rowToDelete? can you explain more pleas?

Image Analyst
on 31 Jan 2013

I thought it was rather self explanatory. See where you say " i need to delete horizontal velocity vector from output"? And where you say "...from output of optical...."? Well what you called "output" is what I called yourOutputArray. And a vector is a 1D array of numbers,in other words a row or a column. Let's say you wanted to delete row #4, then rowToDelete would be equal to 4. Let's try an example. Let's say your array was really called myOpticalFlowMatrix and you wanted to get rid of row #18. So you'd do this:

myOpticalFlowMatrix(18, :) = [];

I think that should explain it very well.

nadia naji
on 2 Feb 2013

ok i explain my problem badly. i don't write any code i only use the demo in matlab r2012a to learn what optical flow work. this demo exist in help of vision.OpticalFlow the output of this demo are some matrices one of them is of which said in demo that is the optical flow for video.this matrix has the same size as video frame(for each frame)i need to know what is it? is it the velocity for each pixel and i need to consider vertical velocity. how can i do this. how can i find for example vertical velocity in this function of matlab for optical flow? what are these lines that shown in the output of demo?? they show the magnitude of velocity. i want to use optical flow for motion detection in fire video. i hope explain good! can you help me?

## 0 Comments