TypeError When Got No Descriptors in ImageClass.py
ERROR: object of type 'NoneType' has no len()
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\1.py", line 22, in
around line 7370:
elif( new_version >=1 and flavor in ["ORB", "SIFT", "SURF"] ):
FeatureDetector = cv2.FeatureDetector_create(flavor)
DescriptorExtractor = cv2.DescriptorExtractor_create(flavor)
self._mKeyPoints = FeatureDetector.detect(self.getGrayNumpy())
self._mKeyPoints,self._mKPDescriptors = DescriptorExtractor.compute(self.getGrayNumpy(),self._mKeyPoints)
if( len(self._mKPDescriptors) == 0 ):
return None, None
self._mKPFlavor = flavor
I have changed if( len(self._mKPDescriptors) == 0 ): to if( self._mKPDescriptors == None or len(self._mKPDescriptors) == 0 ): and now it works well
Does the above code still exists in the latest version? I tried to fix it but I cannot find any such code in ImageClass.py
This issue has been resolved.