![](https://img-blog.csdnimg.cn/2019092715111047.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
opencv
opencv
大米粥哥哥
这货很懒
展开
-
ubuntu18.04 安装opencv_contrib-3.2.0问题总结
1.无法下载ippicv在https://github.com/opencv/opencv_3rdparty左上角下拉,选择下载相应版本的ippicv参考链接:https://blog.csdn.net/weixin_42203839/article/details/107684563 ippicv离线配置过程2.opencv_contrib中缺vgg_generated_48.i之类的文件,且无法下载参考链接:https://www.cnblogs.com/arxive/p/117787.原创 2021-05-11 15:43:41 · 387 阅读 · 3 评论 -
python opencv单层光流法(高斯牛顿法求解)
使用jupyter (参考视觉SLAM十四讲第二版第八章源码)1.使用opencv自带函数import cv2 as cvimport numpy as npfrom matplotlib import pyplot as plt%matplotlib inline# 读取图片im1 = cv.imread('./data/LK1.png',0)im2 = cv.imread('./data/LK2.png',0)# 提取关键点gftt = cv.GFTTDetector_cr原创 2021-03-26 17:50:18 · 605 阅读 · 1 评论 -
python opencv最小化重投影误差求解PnP(高斯牛顿法)
使用jupyter (参考视觉SLAM十四讲第二版第七章源码)1.ORB特征点提取和配准得到3D坐标-2D坐标import cv2 as cvimport numpy as npfrom matplotlib import pyplot as plt# 读取图片 以及深度im1 = cv.imread('./data/1.png')im2 = cv.imread('./data/2.png')im1_d = cv.imread('./data/1_depth.png',-1)..原创 2021-03-23 22:13:11 · 2625 阅读 · 2 评论 -
python opencv实现3D-2DPnP求解位姿
使用jupyter (参考视觉SLAM十四讲版第第二七章源码)1.ORB特征点提取和配准得到3D坐标-2D坐标import cv2 as cvimport numpy as npfrom matplotlib import pyplot as plt# 读取图片 以及深度im1 = cv.imread('./data/1.png')im2 = cv.imread('./data/2.png')im1_d = cv.imread('./data/1_depth.png',-1).原创 2021-03-20 13:09:03 · 3956 阅读 · 22 评论 -
python opencv实现2D-2D对极几何求解位姿以及三角测量
使用jupyter (参考视觉SLAM十四讲第二版第七章源码)# 查看当前kernel下已安装的包 #!pip install opencv-python --user # opencv-python 4.5.1.48#!pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python==3.4.8.29#!pip list --format=columns1.ORB特征点提取和配准import cv2 as原创 2021-03-20 00:20:39 · 5191 阅读 · 17 评论 -
opencv 通过对角检测车牌
//通过对角检测车牌 440x140//输入单通道二值图像 矩形最短边长(窗口大小) 矩形最大偏转角度 存储矩形对角点坐标void serach_chepai_by_opposite_angles(Mat &img, int win, int angle,vector<Vec4i> &rec){ //两个点横竖坐标差值的和小于juli则认为是一个点 cons...原创 2018-04-04 15:29:51 · 269 阅读 · 0 评论 -
opencv 简单的实现HoughLinesP
//两点之间的距离double juli(int x1,int y1,int x2,int y2){ return sqrt(double((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));}//输入经过霍夫变换得到的直线 存储起点和终点的vector 直线最短距离 点之间间隔最长距离void HoughLinesP(Mat &img,vector<...原创 2018-02-22 11:38:22 · 994 阅读 · 0 评论 -
opencv 简单的检测直线
//2.4.0 #include <iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/imgproc...原创 2018-02-19 15:57:19 · 1957 阅读 · 0 评论 -
opencv 使用自己编写的HoughLinesP
//霍夫变换 vector<Vec2f> lines; HoughLines(img, lines, 1, CV_PI/90, 50); //删除一些不需要的直线 for(vector<Vec2f>::iterator it=lines.begin();it!=lines.end();) { //小于5度 大于175度 85-...原创 2018-02-22 11:53:33 · 502 阅读 · 0 评论 -
opencv Sobel函数的使用
void Sobel(Mat &img){ Mat bmp = img.clone(); Sobel( img, bmp ,CV_8U ,0, 1); Sobel( img, img, CV_8U, 1, 0); //整合到一幅图 img = img | bmp; bmp.release(); threshold(img, img, 0, 255, CV_THRESH...原创 2018-02-18 12:00:43 · 1761 阅读 · 0 评论 -
opencv 简单的实现局部阈值处理
//局部阈值处理 3x3void adaptiveThreshold(Mat &img,double b){ Mat im; im = img.clone(); int i,j,k; //行列 int row = img.rows; int col = img.cols; //8邻域、均值 uchar n[9]; double m; //遍历图像 uchar *p0,*原创 2018-02-07 20:35:02 · 1597 阅读 · 1 评论 -
opencv 简单的实现二值化
//灰度图二值化 传入的图像 阈值void erzhi(Mat &img,uchar gray){ //行列 int row = img.rows; int col = img.cols; //遍历图像 int i,j; uchar *p; for( i = 0; i < row; ++i) { p = img.ptr(i);原创 2018-02-07 20:29:36 · 401 阅读 · 0 评论 -
opencv 简单的实现霍夫变换(改进版)
//霍夫变换 输入单通道二值图像 检测直线数量void HoughLines(Mat &img,int n){ int i,j; //行列 int row = img.rows; int col = img.cols; //极径最大值为 对角线+宽 int max_r = col + cvCeil (sqrt(double(row*row+col*col))); /...原创 2018-02-13 13:43:35 · 1748 阅读 · 3 评论 -
opencv 简单的实现霍夫变换
//霍夫变换 输入单通道二值图像 大小640x480 void hough(Mat &img){ //累积和 可以根据图片大小来定 这里就随意了 //注意r 和 theta 的取值范围就好 注意堆栈溢出 我这里调整了默认堆栈大小 int line_cnt[1500][180] = {0}; int r = 0; int theta = 0; //行列 int row...原创 2018-02-12 00:10:45 · 283 阅读 · 1 评论 -
opencv 实现Otsu全局阈值处理
//使用Otsu算法进行灰度图的全局阈值处理 输入灰度图像返回阈值uchar Otsu(Mat &img){ int i,j; //行列 int row = img.rows; int col = img.cols; double rc = row*col; //存储各级灰度的个数 初始为0 int n[256] = {0}; uchar *ptr; for(i = ...原创 2018-01-17 15:50:25 · 418 阅读 · 0 评论