Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 图像中眩光的检测_Ios_Swift_Opencv_Image Processing_Core Image - Fatal编程技术网

Ios 图像中眩光的检测

Ios 图像中眩光的检测,ios,swift,opencv,image-processing,core-image,Ios,Swift,Opencv,Image Processing,Core Image,我正在我的iOS应用程序中添加一个卡片扫描功能,并尝试添加眩光检测。因此,当扫描时检测到眩光时,会提示用户重新定位卡 我已经尝试过使用OpenCV实现它 但考虑到我在OpenCV和计算机视觉方面的背景知识非常少,我无法获得理想的结果 请指导我如何使用OpenCV/CoreImage/GPUImage实现眩光检测 到目前为止我的代码 + (bool) imageHavingGlare:(CMSampleBufferRef)buffer { cv::Mat matImage = [OpenC

我正在我的iOS应用程序中添加一个卡片扫描功能,并尝试添加眩光检测。因此,当扫描时检测到眩光时,会提示用户重新定位卡

我已经尝试过使用OpenCV实现它

但考虑到我在OpenCV和计算机视觉方面的背景知识非常少,我无法获得理想的结果

请指导我如何使用OpenCV/CoreImage/GPUImage实现眩光检测

到目前为止我的代码

+ (bool) imageHavingGlare:(CMSampleBufferRef)buffer {
 cv::Mat matImage = [OpenCVWrapper matFromBuffer:buffer];
 cv::Mat matImageGrey;
 cv::cvtColor(matImage, matImageGrey, CV_BGRA2GRAY);

 GaussianBlur(matImageGrey, matImageGrey, cvSize(11,11), 0);

 cv::Mat matImageBinarized;
 cv::threshold(matImageGrey, matImageBinarized, 30, 255, CV_THRESH_BINARY | CV_THRESH_OTSU);

 double min, max;
 cv::Point min_loc, max_loc;
 cv::minMaxLoc(matImageBinarized, &min, &max, &min_loc, &max_loc);    

 if(((max_loc.x > 0) && (max_loc.y > 0)))
 {
    return true;
 }

 return false;
}

你能在你试图检测的图像中添加眩光示例吗?向我们展示你的代码我已经添加了我的代码@user1241暗示使用拉普拉斯算子来检测帧有多模糊并提示用户相应地你能在你试图检测的图像中添加眩光示例吗?向我们展示你的代码我已经添加了我的代码@user1241暗示使用拉普拉斯算子来检测帧有多模糊检测帧的模糊程度,并相应地提示用户