Strange Effect SURF GPU Keypoints

asked 2013-02-12 11:36:01 -0500

Possede gravatar image

updated 2013-02-12 14:59:40 -0500

I have come across a strange effect when outputting the keypoints found using the GPU implementation of SURF. I am capturing frames (640x480) from a webcam and reducing the ROI before passing them to be SURF function. However, I have found when the ROI is set to anything below 305 pixels in width (with a static height of 480 pixels), there is a band of keypoints found on the right hand side of the frame. The keypoints around the area of the band change every iteration (i.e. they are not static), however they remain in the same area. This band remains there even when I cover up the lens of the webcam (i.e. when there should be no keypoints found). This effect can be seen here:

Here is my code:

  // Capture an image from the webcam
  cam_0 >> img;

  // Convert to grayscale

  img_roi = img_grey(Rect(0, 0, 304, HEIGHT));

  // Upload greyscale images

  // Perform GPU SURF and obtain keypoints and descriptors
  surfGPU(imgGPU, GpuMat(), keypGPU, descriptorsGPU);

  // Download the keypoints
  surfGPU.downloadKeypoints(keypGPU, keyp);

  // Draw the keypoints
  drawKeypoints(img_grey, keyp, outImgGPU, Scalar(255, 255, 255), DrawMatchesFlags::DEFAULT);

  // Show the keypoints on the image
  imshow("Show Keypoints", outImgGPU);

EDIT: Also, sometimes when I block the lens of the webcam for long enough, I get the following error:

I am just wondering if anyone can point out what is going on.


edit retag flag offensive close merge delete


Try to move your camera a bit. If the keypoints stay on the same area of the wall, it's probably a low-contrast crack in the wall there. If the points stay in the same area of the image (as you say they do when you cover the lens) it may be some dust/crack in the lens or a bug in the library. Try changing the lens, or the camera, to see whether the effect is still there.

sammy gravatar imagesammy ( 2013-02-13 00:43:00 -0500 )edit

Thanks for your input. I am trying to achieve real-time image stitching using three Logitech C600 webcams to create a video panorama. They are mounted as shown here:

Unfortunately the effect is present in all of the webcams when selecting anything below 305 pixels in width and can be seen here:

The ROI is the overlap region between the left and right webcams and the centre webcam. I have tried dusting the lens but to no avail. It looks like a bug to me.

Possede gravatar imagePossede ( 2013-02-13 11:18:56 -0500 )edit