0

I am using SURF features for image registration. I have images of type uint16.

pts1 = detectSURFFeatures(image)

When I used the above function on uint16 images, the function returned 0 SURF points. As a workaround, I used to convert the images to uint8, after which the function was returning a good amount of detected SURF points. Thus, the function worked on uint8 images, but not on uint16.

Note, that the function doesn't show any error. It executes successfully, but the SURFPoints object returned has 0 SURFPoints.

Why does this happen? The documentation of the above function says that the image can be single, double, uint8, uint16, int16 and logical. Then why is the function not working on the uint16 images I am using?

I experimented by converting the image to double data type. It didn't work. It worked only when I convert the image to uint8.

Sorry I cannot share the images since they are confidential data, but did anybody here faced similar issues?

I could have continued with the conversion to uint8, but that is posing some other problem, hence I want to know the solution to the fundamental issue.

I am using MATLAB 2017.

Nancy
  • 315
  • 1
  • 5
  • 16
  • 1
    try a different threshold value, hope it works !!! – user8190410 Nov 01 '18 at 09:51
  • 2
    converting the image to double as `im2double()` did not work? Remember, double images need to be scaled [0-1], just casting to double is not enough. – Ander Biguri Nov 01 '18 at 10:18
  • @user8190410 I tried different threshold values. Sadly, it didn't work. – Nancy Nov 02 '18 at 10:47
  • @AnderBiguri I tried converting to `double` again, simply by doing `double(img)`. Surprisingly, this time it worked. I must have done something else wrong previously or must have missed something. Also, I used `im2double(img)`, but with that, again no `SURFPoints` were detected. Do you have any explanation of why points are getting detected in some datatypes? – Nancy Nov 02 '18 at 10:51
  • No because I can not read the source code. The most likely thing is the expected range of the data types, maybe SURF assumes you get in an image with specific scale. But it is just a guess. If you want more info you may get it if you provide a [mcve] – Ander Biguri Nov 02 '18 at 10:55

0 Answers0