在OpenCV上执行模糊功能时EXC_BAD_ACCESS

时间:2015-01-26 18:57:55

标签: c++ opencv exception exc-bad-access

任何人都可以帮助我,因为我似乎无法弄清楚这里发生了什么。我试图使用OpenCV中的模糊函数进行模糊和图像处理,但是当执行到达模糊函数时,我得到EXC_BAD_ACCESS(代码= EXC_i386_GPFTL) 这是代码

void Efekte::Blur_Or_Smooth(Mat &source, Mat &Destination)
{
namedWindow("Blurred / Smoothed", CV_WINDOW_NORMAL);
int blurSliderValue = 1;
createTrackbar("Blur", "Blurred / Smoothed", &blurSliderValue, 41);
while (true)
{
    int KernelSize;
    if (blurSliderValue%2 == 0)
        KernelSize = blurSliderValue+1;
    else KernelSize = blurSliderValue;

    blur(source,Destination,Size(KernelSize,KernelSize)); // this generates exception

    imshow("Blurred / Smoothed", Destination);
    int key = waitKey(50);
    if (key == 27)
        break;
}
return;

}

0 个答案:

没有答案