首页 > 编程知识 正文

基于opencv的人脸识别,opencv验证码识别

时间:2023-05-06 03:11:54 阅读:164966 作者:1286

一边制作其他东西,一边用opencv写下了简单粗暴的条形码的检测识别。

需要更多的逻辑识别处理

# include iostream # include opencv2/opencv.HPP # include opencv2/highgui/HPP # include opencv2/core/core . matimage_process(matsrc1 ) resize ) src1、src1、size ) 640、480 ); Mat dst; cvtcolor(src1,dst,COLOR_BGR2GRAY ); Threshold(dst,dst,0,255,THRESH_BINARY_INV ); matelement=getstructuringelement (morph _ ellipse,size (17,17 ) ); dilate(dst,dst,element ); return dst; }int main () mat src=im read (/home/SMS/tu/download.png ); matget_out=image_process(src; imshow (原图)、src; imshow(dst )、get_out ); vectorvectorPoint contours; findcontours(get_out,contours,RETR_TREE,CHAIN_APPROX_SIMPLE ); vectorrectbounding (contours.size ) ); vectorRect Rect_temp; for(size_tI=0; icontours.size (; I ) {bounding[I]=boundingrect(mat ) contours[I] ); 第cout '个轮廓的面积是' bounding[i].area () endl; if(bounding[I].area(5000 ) rect_temp.push_back ) bounding[I]; } } cout '超过500的轮廓面积为' rect_temp.at(0).area ) ) endl; for(size_tI=0; iRect_temp.size (; I ) ) rectangle(src,Rect_temp[i].tl )、Rect_temp[i].br )、scalar (0,0,255 )、10,8; (imshow )、drawing )、src; 维客(0; }! [检查后的图] https://img-blog.csdn img.cn/2020112117582331.png? x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text _ a hr0 CHM6ly9ibg9nlmnzzg4u bmv0l 01 zez

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。