Flow_PX4.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 3 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. #pragma once
  14. #include "AP_HAL_Linux.h"
  15. namespace Linux {
  16. class Flow_PX4 {
  17. public:
  18. Flow_PX4(uint32_t width, uint32_t bytesperline,
  19. uint32_t max_flow_pixel,
  20. float bottom_flow_feature_threshold,
  21. float bottom_flow_value_threshold);
  22. uint8_t compute_flow(uint8_t *image1, uint8_t *image2, uint32_t delta_time,
  23. float *pixel_flow_x, float *pixel_flow_y);
  24. private:
  25. uint32_t _width;
  26. uint32_t _search_size;
  27. uint32_t _bytesperline;
  28. float _bottom_flow_feature_threshold;
  29. float _bottom_flow_value_threshold;
  30. uint16_t _pixlo;
  31. uint16_t _pixhi;
  32. uint16_t _pixstep;
  33. uint8_t _num_blocks;
  34. };
  35. }