微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在OpenCV {Python}上使用AKAZE时,Get_MLDB_Full_Descriptor断言失败

如何解决在OpenCV {Python}上使用AKAZE时,Get_MLDB_Full_Descriptor断言失败

我在Python 3.8的{​​{1}}和OpenCV 4.4.0.44上使用AKAZE构造函数

我试图在构造函数中组合不同的参数,并计划在数据集上执行它们。 构造函数可以使用其认参数正常工作。

查看代码和传递的不同值:

PIP

当我使用 # [ options is the argparser ] grayscale_image = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) grayscale_image = cv2.resize(grayscale_image,(256,256),interpolation=cv2.INTER_AREA) if mask is not None: mask = cv2.resize(mask,interpolation=cv2.INTER_AREA) mask = (mask == 0).astype(np.uint8) * 255 # Options of the constructor # - descriptor_type Type of the extracted descriptor: DESCRIPTOR_KAZE,# DESCRIPTOR_KAZE_UPRIGHT,DESCRIPTOR_MLDB or DESCRIPTOR_MLDB_UPRIGHT. # - descriptor_size Size of the descriptor in bits. 0 -> Full size # - descriptor_channels Number of channels in the descriptor (1,2,3) # - threshold Detector response threshold to accept point # - nOctaves Maximum octave evolution of the image # - nOctaveLayers Default number of sublevels per scale level # - diffusivity Diffusivity type. DIFF_PM_G1,DIFF_PM_G2,DIFF_WEICKERT or DIFF_CHARBONNIER # Assuring type is the expected for each one descriptor_size = int(options.ak_desc_size) ## 0 = full size descriptor_type = int(options.ak_desc_type) ## 5 or 4 or 3 or 2 descriptor threshold = float(options.ak_threshold) ## variable (0.001) channels = int(options.ak_desc_chan) ## with 3 works,not with 1 or 2 num_octaves = int(options.ak_num_octav) ## 4 octave_layers = int(options.ak_oct_layer) ## 4 difussivity = int(options.ak_diffusivt) ## 0..3 akaze = cv2.AKAZE_create(descriptor_size=descriptor_size,descriptor_type=descriptor_type,threshold=threshold,descriptor_channels=channels,nOctaves=num_octaves,nOctaveLayers=octave_layers,diffusivity=difussivity) keypoints = akaze.detect(grayscale_image,mask=mask) 执行参数组合时,正在处理以下异常:

descriptor_channels == 2 or ==1

我已经查看过Documentation,但我不知道自己缺少什么。

有关可能是什么错误的任何指导?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。