Ask Your Question
0

What is the best format to use with SIFT?

asked Dec 5 '16

lovaj gravatar image

Is there any difference in terms of precision and speed in using SIFT with JPEG, PNG or PGM images? Obviously supposing the same image size.

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Dec 5 '16

Vintez gravatar image

updated Dec 5 '16

Not really, because you always have to convert the Image into a grayscale Image for the SIFT algorithm. But beside that, a format which has a lossless conversion from the raw camera data would be good (e.g. JPEG is no lossless conversion of the original raw data).

On the other hand, if you use a JPEG as reference Image and just try the recognition also in JPEG, the conversion of JPEG is nonrelevant.

For some calrification opencv's SIFT checks for a CV_8U Type Image and throws an error if the Image is not that type:

void SIFT_Impl::detectAndCompute(InputArray _image, InputArray _mask,
                  std::vector<KeyPoint>& keypoints,
                  OutputArray _descriptors,
                  bool useProvidedKeypoints)
{
int firstOctave = -1, actualNOctaves = 0, actualNLayers = 0;
Mat image = _image.getMat(), mask = _mask.getMat();

if( image.empty() || image.depth() != CV_8U )
    CV_Error( Error::StsBadArg, "image is empty or has incorrect depth (!=CV_8U)" );
Preview: (hide)

Question Tools

1 follower

Stats

Asked: Dec 5 '16

Seen: 3,447 times

Last updated: Dec 05 '16