/ocr/ocrservice/jni/opticalflow/feature_detector.h

http://eyes-free.googlecode.com/ · C Header · 44 lines · 25 code · 9 blank · 10 comment · 0 complexity · 36d68e4748728d5d8c40d621b5769e0e MD5 · raw file

  1. // Copyright 2010 Google Inc. All Rights Reserved.
  2. // Author: andrewharp@google.com (Andrew Harp)
  3. #ifndef JAVA_COM_GOOGLE_ANDROID_APPS_UNVEIL_JNI_OPTICALFLOW_FEATURE_DETECTOR_H_
  4. #define JAVA_COM_GOOGLE_ANDROID_APPS_UNVEIL_JNI_OPTICALFLOW_FEATURE_DETECTOR_H_
  5. namespace flow {
  6. // Add features along a regular grid.
  7. int32 seedFeatures(const Image<uint8>& frame,
  8. const int32 num_x, const int32 num_y,
  9. const float32 left, const float32 top,
  10. const float32 right, const float32 bottom,
  11. const int32 type, Point2D* const features);
  12. // Compute the corneriness of a point in the image.
  13. float32 harrisFilter(const Image<int32>& I_x, const Image<int32>& I_y,
  14. const int32 x, const int32 y);
  15. // Scan the frame for potential features using the FAST feature detector.
  16. int32 findFastFeatures(const Image<uint8>& frame,
  17. const int32 max_num_features,
  18. Point2D* const features,
  19. Image<uint8>* const best_feature_map);
  20. // Score a bunch of candidate features. Assigns the scores to the input
  21. // candidate_features array entries.
  22. void scoreFeatures(const Image<int32>& I_x, const Image<int32>& I_y,
  23. const int32 num_candidates,
  24. Point2D* const candidate_features);
  25. // Copy the best features (with local non-max suppression) from
  26. // candidate_features to final_features.
  27. // Returns the number of features copied.
  28. int32 sortAndSelect(const int32 num_candidates,
  29. const int32 max_features,
  30. const Image<bool>& interest_map,
  31. Point2D* const candidate_features,
  32. Point2D* const final_features,
  33. Image<uint8>* const best_feature_map);
  34. } // namespace flow
  35. #endif // JAVA_COM_GOOGLE_ANDROID_APPS_UNVEIL_JNI_OPTICALFLOW_FEATURE_DETECTOR_H_