3rdparty/OpenCV-2.3.0/modules/features2d/src/sift.cpp
static IplImage* convert_to_gray32( IplImage* img )
{
  IplImage* gray8, * gray32;

  gray32 = cvCreateImage( cvGetSize(img), IPL_DEPTH_32F, 1 );
  if( img->nChannels == 1 )
    gray8 = (IplImage*)cvClone( img );
  else
    {
      gray8 = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 1 );
      cvCvtColor( img, gray8, CV_BGR2GRAY );
    }
  cvConvertScale( gray8, gray32, 1.0 / 255.0, 0 );

  cvReleaseImage( &gray8 );
  return gray32;
}
/*
  Converts an image to 32-bit grayscale

  @param img a 3-channel 8-bit color (BGR) or 8-bit gray image

  @return Returns a 32-bit grayscale image
*/
Converts an image to 32-bit grayscale
Converts an image to 32 - bit grayscale
static IplImage* convert_to_gray32( IplImage* img )
{
  IplImage* gray8, * gray32;
  gray32 = cvCreateImage( cvGetSize(img), IPL_DEPTH_32F, 1 );
  if( img->nChannels == 1 )
    gray8 = (IplImage*)cvClone( img );
  else
    {
      gray8 = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 1 );
      cvCvtColor( img, gray8, CV_BGR2GRAY );
    }
  cvConvertScale( gray8, gray32, 1.0 / 255.0, 0 );
  cvReleaseImage( &gray8 );
  return gray32;
}
static IplImage * convert_to_gray32 ( IplImage * img ) { IplImage * gray8 , * gray32 ; gray32 = cvCreateImage ( cvGetSize ( img ) , IPL_DEPTH_32F , 1 ) ; if ( img -> nChannels == 1 ) gray8 = ( IplImage * ) cvClone ( img ) ; else { gray8 = cvCreateImage ( cvGetSize ( img ) , IPL_DEPTH_8U , 1 ) ; cvCvtColor ( img , gray8 , CV_BGR2GRAY ) ; } cvConvertScale ( gray8 , gray32 , 1.0 / 255.0 , 0 ) ; cvReleaseImage ( & gray8 ) ; return gray32 ; }
Converts an image to 32-bit grayscale
Converts an image to 32 - bit grayscale