当前位置:网站首页>21. Hoff circle transformation
21. Hoff circle 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/circle.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::medianBlur(src, src, 3);
cv::Mat gray;
cv::cvtColor(src, gray, cv::COLOR_BGR2GRAY);
std::vector<cv::Vec3f> vec_circle;
cv::HoughCircles(gray, vec_circle, cv::HOUGH_GRADIENT, 1, 10, 100, 30, 5, 50);
for(int i = 0; i < vec_circle.size(); i++){
cv::Vec3f cc = vec_circle[i];
cv::circle(src, cv::Point(cc[0], cc[1]), cc[2], cv::Scalar(0, 255, 255), 2, cv::LINE_AA);
cv::circle(src, cv::Point(cc[0], cc[1]), 2, cv::Scalar(128, 128, 255), 2, cv::LINE_AA);
}
cv::imshow("result", src);
cv::waitKey();
}

边栏推荐
- SPI protocol
- idea配置
- Sword finger offer II 096 String interleaving
- I2C protocol
- Idempotence of interfaces -- talk about idempotence of interfaces in detail, that is, solutions
- C disk cleaning strategy of win10 system
- New library launched | cnopendata China new house information data
- 数据分析——切片器、数据透视表与数据透视图(职场必备)
- Recognize map
- **MySQL例题一(根据不同问题,多条件查询)**
猜你喜欢

Obtain WiFi password through computer (only connected WiFi)

Handling of @charset UTF-8 warning problems during vite packaging and construction;

智慧家——全家具功能

快速生成1~20自然数,并轻松复制

生信周刊第34期

Online gadget sharing (updated from time to time, current quantity: 2)

Shell regular expression

Technical foreword - metauniverse

马斯克 VS 乔布斯,谁是21世纪最伟大的创业家

在FreeBSD中安装MySQL数据库
随机推荐
在FreeBSD中安装MySQL数据库
Embedded C first learning notes
新库上线 | CnOpenDataA股上市公司IPO申报发行文本数据
--SQL of urban cultivation manual -- Chapter 1 basic review
填鸭数据即时收集解决方案资源
《网络是怎么样连接的》读书笔记 - 集线器、路由器和路由器(三)
Essence and thoughts of 30 lectures on product thinking
集合集合!!快来复习--mysql增删改查,内、左右连接 复习笔记
剑指 Offer II 096. 字符串交织
走 迷 宫
Multiple interface calls, using promise all、Promise. Race and promise any
黑盒测试 — 测试用例 之 判定表法看这一篇就够了
Obtain WiFi password through computer (only connected WiFi)
网上开通证券账户安全吗 证券网上开户
马斯克 VS 乔布斯,谁是21世纪最伟大的创业家
FIFO code implemented in C language
多接口调用,使用Promise.all、Promise.race和Promise.any
Shengxin weekly issue 34
Sword finger offer II 096 String interleaving
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"