Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

作者你好,你的matlab代码有一处地方报错 #2

Open
MnYangs opened this issue Jul 31, 2022 · 5 comments
Open

作者你好,你的matlab代码有一处地方报错 #2

MnYangs opened this issue Jul 31, 2022 · 5 comments

Comments

@MnYangs
Copy link

MnYangs commented Jul 31, 2022

报错的提示为:
_位置 1 处的索引无效。数组索引必须为正整数或逻辑值。

出错 GLOH

出错 Log_polar_descriptors

出错 LPSO_demo (第 42 行)
descriptors_1=Log_polar_descriptors(gradient_1,angle_1,(KeyPts_1),Path_Block);_

因为您的GLOH.m的代码被加密成了.p文件,所以我无法进行修改和查看。
这个错误在函数文件Hist_Oritation.m中也出现过,,具体的语句为sub_gradient=gradient(radius_y_up:radius_y_down,radius_x_left:radius_x_right);
报错的提示为:

位置 1 处的索引无效。数组索引必须为正整数或逻辑值。

出错 Hist_Oritation (第 31 行)
sub_gradient=gradient(radius_y_up:radius_y_down,radius_x_left:radius_x_right);

我将radius_y_up、radius_y_down和radius_x_left、radius_x_right都强制转化为uint8型后解决了问题。
所以我怀疑上面的错误也是相同的问题,但是我无法对GLOH.p文件进行操作,所以请您修改一下,或者将GLOH.m的代码分享出来。

@liyemei
Copy link
Owner

liyemei commented Jul 31, 2022

这是matlab版本问题 我的版本2018a是正常的,我已经更新了GLOH.m,你可以根据你的报错修改

@liyemei liyemei mentioned this issue Jul 31, 2022
@WGY-RS
Copy link

WGY-RS commented Sep 2, 2022

感谢作者的代码,我查阅了代码以后发现,问题应该是提取的特征点不是整型,这导致在sub_gradient和sub_angle上索引值出现错误。需要在hist_oritation和gloh开头将特征点转为整型数字

1 similar comment
@WGY-RS
Copy link

WGY-RS commented Sep 2, 2022

感谢作者的代码,我查阅了代码以后发现,问题应该是提取的特征点不是整型,这导致在sub_gradient和sub_angle上索引值出现错误。需要在hist_oritation和gloh开头将特征点转为整型数字

@liyemei
Copy link
Owner

liyemei commented Sep 2, 2022 via email

@liyemei
Copy link
Owner

liyemei commented Sep 20, 2022

感谢作者的代码,我查阅了代码以后发现,问题应该是提取的特征点不是整型,这导致在sub_gradient和sub_angle上索引值出现错误。需要在hist_oritation和gloh开头将特征点转为整型数字

你好 可以将你改的贴在这里 方便其他人阅读 谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants