当前位置:网站首页>20. Hough line transformation
20. Hough line transformation
2022-06-26 01:35:00 【Nightmare satiety】
#include <opencv2/opencv.hpp>
#include <iostream>
int main(int argc, char** argv){
cv::Mat src = cv::imread("../../source/line1.png");
if(src.empty()){
std::cout << "could not load image..." << std::endl;
return -1;
}
cv::namedWindow("src img", cv::WINDOW_AUTOSIZE);
cv::imshow("src img", src);
cv::Mat gray;
cv::cvtColor(src, gray, cv::COLOR_BGR2GRAY);
cv::Mat edge;
cv::Canny(gray, edge, 100, 200);
cv::imshow("edge", edge);
std::vector<cv::Vec4f> vec_lines;
cv::HoughLinesP(edge, vec_lines, 1, CV_PI / 180.0, 10, 0, 10);
for(int i = 0; i < vec_lines.size(); i++){
cv::Vec4f hline = vec_lines[i];
cv::line(src, cv::Point(hline[0], hline[1]), cv::Point(hline[2], hline[3]), cv::Scalar(0, 255, 255), 2, cv::LINE_AA);
}
cv::imshow("result", src);
cv::waitKey();
}

边栏推荐
- When you run the demo using the gin framework, there is an error "listen TCP: 8080: bind: an attempt was made to access a socket in a way forbidden"
- 新库上线 | CnOpenDataA股上市公司IPO申报发行文本数据
- 智慧家——全家具功能
- Oracle数据库开启备份准备工作
- Oracle数据库完全卸载步骤(暂无截图)
- 基金开户安全吗?有没有什么风险?
- 马斯克 VS 乔布斯,谁是21世纪最伟大的创业家
- Native DOM vs. virtual DOM
- Duck feeding data instant collection solution resources
- 100ask seven day IOT training camp learning notes - bare metal program framework design
猜你喜欢

100ask seven day IOT training camp learning notes - bare metal program framework design

Digital circuit - adder

halcon之区域:多种区域(Region)生成(4)

Data analysis slicer, PivotTable and PivotChart (necessary in the workplace)

FIFO code implemented in C language

Camera - 02 image sensor

Essence and thoughts of 30 lectures on product thinking

MySQL图书借阅系统项目数据库建库表语句(组合主键、外键设置)

Technical introduction - detailed explanation of chip manufacturing process

Duck feeding data instant collection solution resources
随机推荐
开窍之问答
leetcode 300. Longest Increasing Subsequence 最长递增子序列 (中等)
MySQL example - comprehensive case (multi condition combined query)
Handling of @charset UTF-8 warning problems during vite packaging and construction;
JSON基本语法
MySQL例题一 综合案例(多条件组合查询)
MySQL book borrowing system project database creation TABLE statement (combined primary key and foreign key settings)
Have you considered going or staying in graduation season
"Hot post" Statistics
多接口调用,使用Promise.all、Promise.race和Promise.any
Flex & bison start
100ask seven day IOT training camp learning notes - bare metal program framework design
The kth largest element in the array
《网络是怎么样连接的》读书笔记 - 集线器、路由器和路由器(三)
15 `bs对象.节点名称.节点名称.string` 获取嵌套节点内容
Design and process analysis of anti backflow circuit for MOS transistor
单选框互斥且可同时取消选中
Oracle database startup backup preparation
Computer network knowledge summary (interview)
Development and monitoring of fusion experiment pulse power supply by LabVIEW