Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Strange Effect SURF GPU Keypoints

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:

http://i1276.photobucket.com/albums/y475/sesj13/KeypointsBand_zpsb89bc245.png http://i1276.photobucket.com/albums/y475/sesj13/KeypointsBandBlack_zps5539d2b4.png

Here is my code:

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

  // Convert to grayscale
  cvtColor(img,img_grey,CV_RGB2GRAY);

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

  // Upload greyscale images
  imgGPU.upload(img_roi);

  // 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);

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

Cheers

Strange Effect SURF GPU Keypoints

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:

http://i1276.photobucket.com/albums/y475/sesj13/KeypointsBand_zpsb89bc245.png http://i1276.photobucket.com/albums/y475/sesj13/KeypointsBandBlack_zps5539d2b4.png

Here is my code:

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

  // Convert to grayscale
  cvtColor(img,img_grey,CV_RGB2GRAY);

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

  // Upload greyscale images
  imgGPU.upload(img_roi);

  // 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:

http://i1276.photobucket.com/albums/y475/sesj13/Error_zpsade6146c.png

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

Cheers