- Timestamp:
- Feb 21, 2017, 4:37:58 PM (8 years ago)
- Location:
- trunk/lib/FlairVisionFilter/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairVisionFilter/src/OpticalFlowSpeed.cpp
r122 r143 49 49 50 50 input->GetMutex(); 51 for(int i=0;i<input->NbFeatures();i++) 52 { 53 if(input->FoundFeature()[i]!=0) 54 { 51 for(int i=0;i<input->NbFeatures();i++) { 52 if(input->FoundFeature()[i]!=0) { 55 53 deplx+=input->PointsB()[i].x-input->PointsA()[i].x; 56 54 deply+=input->PointsB()[i].y-input->PointsA()[i].y; … … 59 57 } 60 58 input->ReleaseMutex(); 59 Time deltaT=data->DataTime()-output->DataTime(); 60 output->SetDataTime(data->DataTime()); 61 61 62 if(nb_depl!=0) 63 { 64 output->SetValue(0,0,deplx/nb_depl); 65 output->SetValue(1,0,deply/nb_depl); 62 if(nb_depl!=0) { 63 output->SetValue(0,0,deplx/(nb_depl*deltaT)*1000*1000*1000); 64 output->SetValue(1,0,deply/(nb_depl*deltaT)*1000*1000*1000); 66 65 } 67 66 68 output->SetDataTime(data->DataTime());69 67 ProcessUpdate(output); 70 68 } -
trunk/lib/FlairVisionFilter/src/OpticalFlowSpeed.h
r122 r143 31 31 * \brief Optical flow speed calculation 32 32 * 33 * Speed is the mean of all optical flow values .33 * Speed is the mean of all optical flow values divided by the delta time between images. 34 34 */ 35 35 class OpticalFlowSpeed : public core::IODevice … … 67 67 * \brief Output matrix 68 68 * 69 * Matrix is of s ze (2,1). \n69 * Matrix is of size (2,1). \n 70 70 * First line is speed along x axis. \n 71 71 * Second line is speed along y axis. \n
Note:
See TracChangeset
for help on using the changeset viewer.