/ocr/ocrservice/jni/opticalflow/feature_detector.h
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 4#ifndef JAVA_COM_GOOGLE_ANDROID_APPS_UNVEIL_JNI_OPTICALFLOW_FEATURE_DETECTOR_H_ 5#define JAVA_COM_GOOGLE_ANDROID_APPS_UNVEIL_JNI_OPTICALFLOW_FEATURE_DETECTOR_H_ 6 7namespace flow { 8 9// Add features along a regular grid. 10int32 seedFeatures(const Image<uint8>& frame, 11 const int32 num_x, const int32 num_y, 12 const float32 left, const float32 top, 13 const float32 right, const float32 bottom, 14 const int32 type, Point2D* const features); 15 16// Compute the corneriness of a point in the image. 17float32 harrisFilter(const Image<int32>& I_x, const Image<int32>& I_y, 18 const int32 x, const int32 y); 19 20// Scan the frame for potential features using the FAST feature detector. 21int32 findFastFeatures(const Image<uint8>& frame, 22 const int32 max_num_features, 23 Point2D* const features, 24 Image<uint8>* const best_feature_map); 25 26// Score a bunch of candidate features. Assigns the scores to the input 27// candidate_features array entries. 28void scoreFeatures(const Image<int32>& I_x, const Image<int32>& I_y, 29 const int32 num_candidates, 30 Point2D* const candidate_features); 31 32// Copy the best features (with local non-max suppression) from 33// candidate_features to final_features. 34// Returns the number of features copied. 35int32 sortAndSelect(const int32 num_candidates, 36 const int32 max_features, 37 const Image<bool>& interest_map, 38 Point2D* const candidate_features, 39 Point2D* const final_features, 40 Image<uint8>* const best_feature_map); 41 42} // namespace flow 43 44#endif // JAVA_COM_GOOGLE_ANDROID_APPS_UNVEIL_JNI_OPTICALFLOW_FEATURE_DETECTOR_H_