当前位置: 首页 > news >正文

自己做网站还是找网站建设公司好/seo发贴软件

自己做网站还是找网站建设公司好,seo发贴软件,贵州省住房和城乡建设厅门户网站,写资料的网站有哪些要求:寻找图纸零件所有标注的字符,包括位置信息图像信息 方法: 1.利用形态学轮廓信息去查询 这里精度不是很高,计算难度也比较复杂,好处是思想简单。 2.利用模板匹配     这里是保证模板和实际相差不大&#xff0c…

 

 


要求:寻找图纸零件所有标注的字符,包括位置信息+图像信息

方法:

  1.利用形态学+轮廓信息去查询

    这里精度不是很高,计算难度也比较复杂,好处是思想简单。

  2.利用模板匹配    

    这里是保证模板和实际相差不大,不然匹配精度就很差了。

 


 

 1 #include <opencv2/opencv.hpp>
 2 #include <iostream>
 3 #include "math.h"
 4 using namespace cv;
 5 using namespace std;
 6 
 7 typedef struct MyStruct
 8 {
 9     Rect my_rec;
10     Mat my_img;
11 }MyStruct;
12 
13 int main(int argc, char*argv[])
14 {
15     Mat inputImage = imread("1.png");
16     Mat showImage = inputImage.clone();
17     cvtColor(inputImage, inputImage, CV_BGR2GRAY);
18     Mat morph, gray = inputImage.clone(), showGray;
19     showGray.create(inputImage.size(), CV_8UC1);
20     showGray.setTo(0);
21     vector<vector<Point>> contours;
22     vector<Vec4i> hierarchy;
23     findContours(inputImage, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(-1, -1));
24     Rect rec_adapt;
25     for (size_t i = 0; i < contours.size(); i++)
26     {
27         int x = minAreaRect(contours[i]).boundingRect().x;
28         int y = minAreaRect(contours[i]).boundingRect().y;
29         int width = minAreaRect(contours[i]).boundingRect().width;
30         int height = minAreaRect(contours[i]).boundingRect().height;
31         Mat true_image;
32         int true_pix_count;
33         double true_pix_rate;
34         if (x < 0 || y < 0) true_pix_rate = 1;
35         else
36         {
37             true_image = gray(Rect(x, y, width, height));
38             true_pix_count = countNonZero(true_image);
39             true_pix_rate = static_cast<double>(true_pix_count) / static_cast<double>(minAreaRect(contours[i]).boundingRect().area());
40         }             
41         double angle = minAreaRect(contours[i]).angle;
42         bool flag_angle = (angle == 9 ||  angle == 180 || angle == 0 ) ? true : false;//|| angle == 270
43         if (minAreaRect(contours[i]).size.height >= 10 && minAreaRect(contours[i]).size.height <= 20 && minAreaRect(contours[i]).size.width >= 4 && minAreaRect(contours[i]).size.width <= 30  && flag_angle && true_pix_rate <= 0.8)//
44         {
45             drawContours(showGray, contours, static_cast<int>(i), Scalar(255, 255, 255), 1);
46         }
47     }
48     Mat img1;
49     Mat kernel_x = getStructuringElement(MORPH_RECT, Size(20,1));
50     Mat kernel_y = getStructuringElement(MORPH_RECT, Size(1, 28));
51     Mat kernel_x_l = getStructuringElement(MORPH_RECT, Size(20, 1));
52     morphologyEx(showGray, showGray, MORPH_DILATE, kernel_x);
53     morphologyEx(showGray, showGray, MORPH_DILATE, kernel_x);
54     morphologyEx(showGray, img1, MORPH_OPEN, kernel_y);
55     showGray = showGray - img1;
56     morphologyEx(showGray, showGray, MORPH_CLOSE, kernel_x_l);
57     findContours(showGray, contours, hierarchy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(-1, -1));
58     vector<MyStruct> my_class;
59     for (size_t i = 0; i < contours.size(); i++)
60     {    
61         if (boundingRect(contours[i]).width > 60)
62         {
63             int x = minAreaRect(contours[i]).boundingRect().x;
64             int y = minAreaRect(contours[i]).boundingRect().y;
65             int width = minAreaRect(contours[i]).boundingRect().width;
66             int height = minAreaRect(contours[i]).boundingRect().height;
67             MyStruct Struct_temp;
68             Struct_temp.my_rec = boundingRect(contours[i]);
69             Struct_temp.my_img = showImage(Rect(x, y, width, height)).clone();
70             my_class.push_back(Struct_temp);
71             rectangle(showImage, boundingRect(contours[i]), Scalar(0, 0, 255));
72         }        
73     }
74     
75 
76     waitKey(0);
77     return 0;
78 
79 }

 

效果图不上了,不想再去运行了

转载于:https://www.cnblogs.com/wjy-lulu/p/7535891.html

http://www.lbrq.cn/news/829513.html

相关文章:

  • 购物网站 开店/windows优化大师可以卸载吗
  • 物业网站开发/免费个人网站建设
  • 济南网站建设制作公司推荐/长沙seo网站管理
  • 套别人的网站模板/今日热点新闻事件2022
  • 东莞微网站建设/云南网络推广服务
  • 品牌网站建设搭建/百度推送
  • 新网站怎么做seo 风享/网站查询关键词排名软件
  • 自助 建网站/视频号视频下载助手app
  • 知名的网站建设/怎么优化网站关键词的方法
  • 大连市建委培训官方网站/怎样做网络推广挣钱
  • 怎么攻击php做的网站吗/百度关键词搜索工具
  • 咸阳市网站建设/seo软件下载
  • html做校园网站/客服外包
  • 口碑好的番禺网站建设/百度官网登录入口
  • 三端互通传奇手游找服网站/软文推广例子
  • 向客户介绍网站建设的话本/香港疫情最新消息
  • 微网站建设包括哪些方面/seo优化教程下载
  • 哪个网站可以做职业测试/无锡百度竞价公司
  • 长春建站网站/整站排名服务
  • 关于大棚建设的网站/互联网服务平台
  • 网站类型有/软文写作实训总结
  • 贵阳公司网站建立/alexa
  • 网站开发客户需求/手机端关键词排名优化软件
  • wordpress虚拟3d网站/seo投放营销
  • wordpress多站点支付插件/怎么联系地推公司
  • 苍梧网站建设/推广运营是什么工作
  • 国外还有那种做电商的网站/谷歌推广费用
  • 人民大学网站建设/涟源网站seo
  • 做旅游网站宣传/游戏广告联盟平台
  • 黔南网站建设/成都seo培
  • 模型自信度提升:增强输出技巧
  • docker|Linux|以centos基础镜像为基础制作nmap专用镜像(镜像瘦身计划)
  • 【2025/07/19】GitHub 今日热门项目
  • 《每日AI-人工智能-编程日报》--2025年7月18日
  • 广东省省考备考(第四十九天7.18)——资料分析(知识点回顾与练习)
  • 智象科技赋能金融、证券行业 IT 运维