
opencv
luoganttcc
微信:luogantt2
展开
-
解决opencv-python 在2k采集模式下,录制问题
问题:opencv-python 在2k采集模式下,画面卡顿厉害,而且录制成功后出现加速播放的效果,实际时常和录制时长相差太大。1:很多摄像头在高分辨率的情况下都不到15帧,以MJPG格式解码能达到30帧。经过几天的研究,发现只要设置几个地方,就能解决这个问题。2:保存的格式要和设置的格式一致。原创 2022-10-19 16:17:17 · 975 阅读 · 0 评论 -
opencv2 python 读取摄像头数据 修改视屏尺寸
【代码】opencv2 python 读取摄像头数据 修改视屏尺寸。转载 2022-10-16 21:34:06 · 1506 阅读 · 0 评论 -
Ubuntu 16.04 中安装 cmake 3.17.0
在对 SLAM 学习的过程当中,有可能遇到 cmake 版本太低而报错的问题,这里教你们如何简单快速的在 Ubuntu 上安装新版 cmake。学习。转载 2022-09-28 15:31:47 · 1777 阅读 · 1 评论 -
opencv_contrib安装出现无法打开包括文件: “opencv2/xfeatures2d/cuda.hpp”: 解决方法
与opencv_contrib版本不匹配等。不匹配的话cmake会直接报错。后来干看错误直接改代码得了。其他还有2出错误也是这样修改就好。修改为:(自己按自己目录来)做个记录,免得自己忘了。转载 2022-09-28 15:29:01 · 119 阅读 · 0 评论 -
Ubuntu系统安装opencv详细操作及具体应用--亲测可用
由于ubuntu系统近日被不小心整崩溃了,所以早期安装的一些东西又要重新安装,闲来无事,为提高重装人的效率,将一些东西写成博客。转载 2022-09-27 12:29:17 · 256 阅读 · 0 评论 -
OpenCV 加载 ONNX 模型
OpenCV 不适合用于搭建模型,通常使用其他框架训练模型。ONNX 作为通用的模型描述格式被众多框架支持,这里推荐使用 ONNX 作为模型保存格式。学习模型的推理,如果在项目中使用了 OpenCV,那么很容易添加深度学习支持。在工业视觉领域 OpenCV 使用较为广泛,其 DNN 模块支持。...原创 2022-08-27 21:27:42 · 4217 阅读 · 0 评论 -
安装OpenCV时提示缺少boostdesc_bgm.i文件的问题解决方案
安装OpenCV时,会遇到下面的错误/home/zhang/slam/opencv-3.4.5/opencv_contrib/modules/xfeatures2d/src/boostdesc.cpp:653:20: fatal error: boostdesc_bgm.i: 没有那个文件或目录#include “boostdesc_bgm.i”^~~~~~~~~~~~~~~~~compilation terminated.把下列压缩包解压到目录opencv_contrib/modules/xfe原创 2021-11-25 13:00:03 · 2719 阅读 · 0 评论 -
ubuntu删除OpenCV
cd opencv-3.4.5 cd buildsudo make uninstallcd .. sudo rm -rf buildsudo rm -r \/usr/local/include/opencv\/usr/local/include/opencv2 \/usr/include/opencv \/usr/include/opencv2 \/usr/local/bin/opencv* \/usr/local/lib/libopencv* \/usr/local/share原创 2021-11-25 12:48:58 · 1130 阅读 · 0 评论 -
ubuntu 18.04 安装 opencv3.4.1 以及 opencv_contrib 3.4.1] 亲测可用
1、首先下载opencv和opencv_contrib的库contrib库:https://github.com/opencv/opencv_contrib/releasesopencv版本:https://opencv.org/releases.html我下载的是3.4.12、把这两个包解压并且把opencv_contrib-3.4.1这整个文件夹拷贝到opencv-3.4.1文件夹里面去unzip opencv-3.4.1.zip unzip opencv_contrib-3.4.1.zip原创 2021-11-25 12:29:26 · 1671 阅读 · 1 评论 -
This tutorial code needs the xfeatures2d contrib module to be run.
This tutorial code needs the xfeatures2d contrib module to be run.原创 2021-11-25 10:56:34 · 352 阅读 · 0 评论 -
ubuntu opencv c++ 读取摄像头
代码在gitmain.cppclude <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>#include <opencv2/core/core.hpp>using namespace cv;int main(){ VideoCapture cap(0); if(!cap.isOpened()) { return -1;原创 2021-11-25 10:55:48 · 750 阅读 · 0 评论 -
opencv 显示图片(直接)
├── build├── CMakeLists.txt├── hani.jpeg└── main.cppmain.cpp#include <iostream>#include <opencv2/opencv.hpp> using namespace cv;using namespace std; int main(void){ Mat image = imread("../hani.jpeg"); //MAT是原创 2021-11-24 18:25:48 · 882 阅读 · 0 评论 -
opencv 显示图片
代码结构├── build├── CMakeLists.txt├── hani.jpeg└── main.cppmain.cpp#include <stdio.h>#include <opencv2/opencv.hpp>using namespace cv;int main(int argc, char** argv ){ if ( argc != 2 ) { printf("usage: DisplayImage.out &l转载 2021-11-24 18:15:50 · 369 阅读 · 0 评论 -
opencv官方文档
原文原创 2021-11-24 15:09:54 · 527 阅读 · 0 评论 -
opencv 裁切边框
import cv2import numpy as npimg = cv2.imread('sofwin.png')gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)_,thresh = cv2.threshold(gray,1,255,cv2.THRESH_BINARY)contours,hierarchy = cv2.findContours(thresh,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)cnt = co原创 2021-10-28 17:12:35 · 1670 阅读 · 0 评论 -
E: Unable to locate package libjasper-dev的解决办法(亲测可以解决)
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"原创 2021-10-15 11:31:47 · 1063 阅读 · 0 评论 -
PIL 转opencv
PIL.Image转换成OpenCV格式import cv2from PIL import Imageimport numpy image = Image.open("plane.jpg")image.show()img = cv2.cvtColor(numpy.asarray(image),cv2.COL...转载 2020-04-03 19:35:35 · 510 阅读 · 1 评论 -
coco 数据集
添加链接描述原创 2019-06-16 21:25:39 · 243 阅读 · 0 评论 -
opencv 标记有数字的区域
#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Thu Mar 21 12:42:15 2019@author: lg"""import cv2import numpy as np # 形态学处理def Process(img): # 高斯平滑 gaussian = cv2.GaussianBlu...原创 2019-03-26 11:30:08 · 1168 阅读 · 0 评论 -
图像编程
#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Wed Sep 26 12:41:46 2018@author: luogan"""import numpy as npfrom matplotlib import pyplot as plttt=np.array([[[2, 1, 225], ...原创 2018-09-26 12:43:52 · 540 阅读 · 0 评论 -
标注工具
添加链接描述原创 2019-06-15 20:50:24 · 265 阅读 · 0 评论 -
face_recognition 实现实时人脸识别
#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Sat Jun 1 19:40:03 2019@author: lg"""# -*- coding: utf-8 -*-import face_recognitionimport cv2video_capture = cv2.VideoCapture(0)...原创 2019-06-02 11:48:12 · 1129 阅读 · 0 评论 -
opencv 打开摄像头
# 打开摄像头并灰度化显示import cv2capture = cv2.VideoCapture(0)while(True): # 获取一帧 ret, frame = capture.read() # 将这帧转换为灰度图# gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.imshow('f...原创 2019-06-01 22:26:30 · 13792 阅读 · 3 评论 -
opencv 通过颜色提取显示屏数字
hsv原理原创 2019-03-25 10:37:07 · 1000 阅读 · 0 评论 -
opencv画直线,矩形
opencv 画直线要画一条线,你只需要告诉函数这条线的起点和终点。我们下面会画一条从左上方到右下角的蓝色线段。import numpy as npimport cv2# Create a black imageimg = np.zeros((512,512,3), np.uint8)# Draw a diagonal blue line with thickness of 5 px...原创 2019-03-24 22:35:44 · 1452 阅读 · 0 评论 -
opencv 中文文档
opencv 中文文档原创 2019-03-24 22:23:04 · 7704 阅读 · 0 评论 -
彩色图如何转换成灰度
RGB转换成灰度图像的一个常用公式是:Gray = R0.299 + G0.587 + B*0.114 对RGB 加权平均原创 2019-03-20 11:20:07 · 799 阅读 · 0 评论 -
opencv 采用 matplot 显示图片
import numpy as npimport cv2from matplotlib import pyplot as pltimg=cv2.imread('tt.png',cv2.IMREAD_COLOR)#method1b,g,r=cv2.split(img)img2=cv2.merge([r,g,b])plt.imshow(img2)plt.show()##meth...原创 2018-09-25 15:44:21 · 410 阅读 · 0 评论 -
安装opencv
ubuntu安装opencv原创 2018-09-25 12:31:06 · 197 阅读 · 0 评论 -
opencv 修改图片尺寸
import cv2# Load an color image in grayscaleimg = cv2.imread('psu.jpeg',3)#cv2.imshow('image',img)res=cv2.resize(img,(1340,1104),interpolation=cv2.INTER_CUBIC)cv2.imwrite('llg.jpg',res)cv2.w...原创 2018-07-01 14:10:07 · 8164 阅读 · 0 评论 -
opencv 卷积神经网络
import numpy as npimport cv2from scipy import ndimagek33=np.array([[-1,-1,-1], [-1,8,-1], [-1,-1,-1]])k33d=np.array([[1,1,1], [1,-8,1], [1,...转载 2018-06-29 11:10:52 · 3582 阅读 · 0 评论 -
opencv sobe 边缘检测算子
#coding=utf-8import cv2import numpy as np img = cv2.imread("jr.png", 0) x = cv2.Sobel(img,cv2.CV_16S,1,0)y = cv2.Sobel(img,cv2.CV_16S,0,1) absX = cv2.convertScaleAbs(x) # 转回uint8absY = c...原创 2019-03-18 15:15:26 · 700 阅读 · 0 评论 -
opencv 自适应阈值
import cv2import numpy as npfrom matplotlib import pyplot as pltimg = cv2.imread('cc.jpeg',0)img = cv2.medianBlur(img,5)ret,th1 = cv2.threshold(img,127,255,cv2.THRESH_BINARY)th2 = cv2.adaptive...原创 2019-03-25 11:41:39 · 934 阅读 · 0 评论 -
opencv 入门 demo
这是一段简单的opencv程序,用于显示一张图片,程序名称为DisplayImage.cpp#include <cv.h>#include <highgui.h>#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp>using namespace cv...原创 2019-06-01 21:14:47 · 1339 阅读 · 0 评论 -
ubuntu linux 编译 opencv
将文件命名为 main.cppsudo g++ main.cpp -o main `pkg-config --cflags --libs opencv`./main原创 2019-06-05 10:31:15 · 181 阅读 · 0 评论 -
opencv 仪表数字切割
#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Thu Mar 21 12:42:15 2019@author: lg"""import cv2import numpy as np # 形态学处理def Process(img): # 高斯平滑 gaussian = cv2.GaussianBlu...原创 2019-03-26 13:54:28 · 566 阅读 · 1 评论 -
opencv 车牌切割
#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Thu Mar 21 12:42:15 2019@author: lg"""import cv2import numpy as np # 形态学处理def Process(img): # 高斯平滑 gaussian = cv2.GaussianBlu...原创 2019-03-26 11:37:21 · 548 阅读 · 0 评论 -
opencv 边缘检测
#coding=utf-8import cv2import numpy as np img = cv2.imread("lu.jpeg", 1) img = cv2.GaussianBlur(img,(3,3),0)canny = cv2.Canny(img, 50, 150) cv2.imshow('Canny', canny)cv2.waitKey(0)cv2.des...原创 2019-03-19 14:11:23 · 327 阅读 · 0 评论 -
opencv 转换图像为灰度
import cv2import numpy as npif __name__ == "__main__": img_path = "lu.jpeg" img = cv2.imread(img_path) #获取图片的宽和高 width,height = img.shape[:2][::-1] #将图片缩小便于显示观看 img_resize =...原创 2019-03-19 11:17:53 · 3122 阅读 · 0 评论 -
opencv 霍夫曼变换 直线提取
import cv2import numpy as np img = cv2.imread("hd.jpeg", 0) img = cv2.GaussianBlur(img,(3,3),0)edges = cv2.Canny(img, 50, 150, apertureSize = 3)lines = cv2.HoughLines(edges,1,np.pi/10,118) #这...原创 2019-03-19 11:14:29 · 791 阅读 · 0 评论