我正在开发一个检测身份证的应用程序,我正在尝试使用ios内置的CIDetector来检测实时预览中的矩形形状对象.我在这里使用CoreImage Detectors中解释的解决方案
我得到了流动的结果 图像
我的问题:有没有办法提取和裁剪检测到的矩形?
我需要通过在 url 路径中提供其名称来访问图像,我尝试使用此代码但图像未显示
/**
*
* @Route("images/{imgname}",name="workflow_image")
*/
public function WorkflowImageAction(Request $request,$imgname){
$filepath = $this->get('kernel')->getRootDir().'/../web/images/workflow/'.$imgname;
$file = readfile($filepath);
$headers = array(
'Content-Type' => 'image/png',
'Content-Disposition' => 'inline; filename="'.$file.'"');
return $file;
}
Run Code Online (Sandbox Code Playgroud)