I have a set of images split in train and test and I'm trying to detect features using SIFT from the train set. The problem is that with my code I'm getting:
TypeError: image is not a numpy array, neither a scalar
Here's my code:
import glob
from cv2 import SIFT
import numpy as np
#creating a list of images
images = []
for infile in glob.glob('path'):
images.append(infile)
np.random.shuffle(images)
my_set = images
#splitting my set in test and train parts
train = my_set[:120]
test = my_set[120:]
#get descriptors of train part
for image in train:
SIFT().detect(image)
I've tried to change the variables train and test like this:
train = np.array(my_set[:120])
but I get the same error.