3rdparty/OpenCV-2.3.0/modules/features2d/src/orb.cpp
void ORB::computeOrientation(const cv::Mat& image, const cv::Mat& integral_image, unsigned int scale,
                             std::vector<cv::KeyPoint>& keypoints) const
{
  // Process each keypoint
  for (std::vector<cv::KeyPoint>::iterator keypoint = keypoints.begin(), keypoint_end = keypoints.end(); keypoint
      != keypoint_end; ++keypoint)
  {
    //get a patch at the keypoint
    if (integral_image.empty())
    {
      switch (image.depth())
      {
        case CV_8U:
          IC_Angle<uchar, int> (image, half_patch_size_, *keypoint, u_max_);
          break;
        case CV_32S:
          IC_Angle<int, int> (image, half_patch_size_, *keypoint, u_max_);
          break;
        case CV_32F:
          IC_Angle<float, float> (image, half_patch_size_, *keypoint, u_max_);
          break;
        case CV_64F:
          IC_Angle<double, double> (image, half_patch_size_, *keypoint, u_max_);
          break;
      }
    }
    else
    {
      // use the integral image if you can
      switch (integral_image.depth())
      {
        case CV_32S:
          IC_Angle_Integral<int> (integral_image, half_patch_size_, *keypoint, orientation_horizontal_offsets_[scale],
                                  orientation_vertical_offsets_[scale]);
          break;
        case CV_32F:
          IC_Angle_Integral<float> (integral_image, half_patch_size_, *keypoint,
                                    orientation_horizontal_offsets_[scale], orientation_vertical_offsets_[scale]);
          break;
        case CV_64F:
          IC_Angle_Integral<double> (integral_image, half_patch_size_, *keypoint,
                                     orientation_horizontal_offsets_[scale], orientation_vertical_offsets_[scale]);
          break;
      }
    }
  }
}
/** Compute the ORB keypoint orientations
 * @param image the image to compute the features and descriptors on
 * @param integral_image the integral image of the iamge (can be empty, but the computation will be slower)
 * @param scale the scale at which we compute the orientation
 * @param keypoints the resulting keypoints
 */
Compute the ORB keypoint orientations
@param image the image to compute the features and descriptors on
@param integral_image the integral image of the iamge (can be empty, but the computation will be slower)
@param scale the scale at which we compute the orientation
@param keypoints the resulting keypoints
Compute the ORB keypoint orientations @param image the image to compute the features and descriptors on @param integral_image the integral image of the iamge ( can be empty but the computation will be slower ) @param scale the scale at which we compute the orientation @param keypoints the resulting keypoints
void ORB::computeOrientation(const cv::Mat& image, const cv::Mat& integral_image, unsigned int scale,
                             std::vector<cv::KeyPoint>& keypoints) const
{
  for (std::vector<cv::KeyPoint>::iterator keypoint = keypoints.begin(), keypoint_end = keypoints.end(); keypoint
      != keypoint_end; ++keypoint)
  {
    if (integral_image.empty())
    {
      switch (image.depth())
      {
        case CV_8U:
          IC_Angle<uchar, int> (image, half_patch_size_, *keypoint, u_max_);
          break;
        case CV_32S:
          IC_Angle<int, int> (image, half_patch_size_, *keypoint, u_max_);
          break;
        case CV_32F:
          IC_Angle<float, float> (image, half_patch_size_, *keypoint, u_max_);
          break;
        case CV_64F:
          IC_Angle<double, double> (image, half_patch_size_, *keypoint, u_max_);
          break;
      }
    }
    else
    {
      switch (integral_image.depth())
      {
        case CV_32S:
          IC_Angle_Integral<int> (integral_image, half_patch_size_, *keypoint, orientation_horizontal_offsets_[scale],
                                  orientation_vertical_offsets_[scale]);
          break;
        case CV_32F:
          IC_Angle_Integral<float> (integral_image, half_patch_size_, *keypoint,
                                    orientation_horizontal_offsets_[scale], orientation_vertical_offsets_[scale]);
          break;
        case CV_64F:
          IC_Angle_Integral<double> (integral_image, half_patch_size_, *keypoint,
                                     orientation_horizontal_offsets_[scale], orientation_vertical_offsets_[scale]);
          break;
      }
    }
  }
}
void ORB :: computeOrientation ( const cv :: Mat & image , const cv :: Mat & integral_image , unsigned int scale , std :: vector < cv :: KeyPoint > & keypoints ) const { for ( std :: vector < cv :: KeyPoint > :: iterator keypoint = keypoints . begin ( ) , keypoint_end = keypoints . end ( ) ; keypoint != keypoint_end ; ++ keypoint ) { if ( integral_image . empty ( ) ) { switch ( image . depth ( ) ) { case CV_8U : IC_Angle < uchar , int > ( image , half_patch_size_ , * keypoint , u_max_ ) ; break ; case CV_32S : IC_Angle < int , int > ( image , half_patch_size_ , * keypoint , u_max_ ) ; break ; case CV_32F : IC_Angle < float , float > ( image , half_patch_size_ , * keypoint , u_max_ ) ; break ; case CV_64F : IC_Angle < double , double > ( image , half_patch_size_ , * keypoint , u_max_ ) ; break ; } } else { switch ( integral_image . depth ( ) ) { case CV_32S : IC_Angle_Integral < int > ( integral_image , half_patch_size_ , * keypoint , orientation_horizontal_offsets_ [ scale ] , orientation_vertical_offsets_ [ scale ] ) ; break ; case CV_32F : IC_Angle_Integral < float > ( integral_image , half_patch_size_ , * keypoint , orientation_horizontal_offsets_ [ scale ] , orientation_vertical_offsets_ [ scale ] ) ; break ; case CV_64F : IC_Angle_Integral < double > ( integral_image , half_patch_size_ , * keypoint , orientation_horizontal_offsets_ [ scale ] , orientation_vertical_offsets_ [ scale ] ) ; break ; } } } }
Compute the ORB keypoint orientations
 @param image the image to compute the features and descriptors on
 @param integral_image the integral image of the iamge (can be empty, but the computation will be slower)
 @param scale the scale at which we compute the orientation
 @param keypoints the resulting keypoints
Compute the ORB keypoint orientations @param image the image to compute the features and descriptors on @param integral_image the integral image of the iamge ( can be empty but the computation will be slower ) @param scale the scale at which we compute the orientation @param keypoints the resulting keypoints
// Process each keypoint //get a patch at the keypoint // use the integral image if you can