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

第八个问题高斯滤波,代码运行后出现断言错误 #33

Open
yz151120 opened this issue Jul 19, 2020 · 4 comments
Open

第八个问题高斯滤波,代码运行后出现断言错误 #33

yz151120 opened this issue Jul 19, 2020 · 4 comments

Comments

@yz151120
Copy link

No description provided.

@zjyjshtxdy
Copy link

它几个线性滤波的kernel都是动态申请的大小(cpp),我也不知道哪个神奇编译器支持这种语法,总之把kernel的内存申请改一下就能跑了

@Yz-ing
Copy link

Yz-ing commented Jul 25, 2020

它几个线性滤波的kernel都是动态申请的大小(cpp),我也不知道哪个神奇编译器支持这种语法,总之把kernel的内存申请改一下就能跑了

你好,我在程序前面用了#define进行定义数组大小,之前那个断言错误是因为for循环遍历过程中if语句中出现越界错误。上面说的是有一个补零操作,我直接把程序改成了图像边缘一圈的像素不进行滤波
for(int i=floor((float)(Kernel_size/2));i<imgrow-floor((float)(Kernel_size/2));i++){
for(int j=floor((float)(Kernel_size/2));j<imgcol-floor((float)(Kernel_size/2));j++){
.........
}
}
你可以把内存申请的程序给我看下嘛

@zjyjshtxdy
Copy link

内存就动态申应该就可以了,剩下就51行少两个特判你也提到了

@HANjf0822
Copy link

在原始图像外面进行补零操作就行了

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

4 participants