2

I want to use SIFT in my processing using opencv in python. I have a gray level image of tissue, I have segmented that image into Patches and I want to find key points on each Patch (here Patch1) using SIFT.

here is part of my code for this:

sift = cv2.xfeatures2d.SIFT_create()
kp,des = sift.detectAndCompute(Patch1,None)

However, when running, it give me the error of image depth:

error:(-5) image is empty or has incorrect depth (!=CV_8U) in function detectAndCompute

Then when I try to convert the image again to gray scale it gives this error:

error: depth == CV_8U || depth == CV_16U || depth == CV_32F in function cvtColor 

The same errors happen when I try to use ORB too.

My original images have .png format. I did lots of processing on the original image to get i.e. Patch1. May it be because I have done some changes during my processing? Do you know what I should do? or what is wrong?

user6352340
  • 107
  • 2
  • 10
  • Possible duplicate of [python opencv SIFT doesn't work for 8 bit images (JPEG)](http://stackoverflow.com/questions/28597580/python-opencv-sift-doesnt-work-for-8-bit-images-jpeg) – Nickil Maveli May 19 '16 at 12:31

0 Answers0