
OpenCV
Mmagic1
自律带来自由!
展开
-
Opencv做形状匹配
#include <iostream>#include <vector>//Opencv库#include <opencv.hpp>void findcontours(cv::Mat &image,std::vector<std::vector<cv::Point>> &contours){ cv::Mat gray,binary; std::vector<cv::Vec4i> hiera.原创 2020-08-11 17:02:13 · 1060 阅读 · 0 评论 -
python opencv报错解决
import cv2 as cvimg = cv.imread("test.jpg")cv.imshow("test",img)cv.waitKey(10000)报错1:module cv2 has no ‘imread’ member原因:VSCode插件检测不到模块, 因为cv2模块下还有cv2模块。解决办法:此段代码运行是没有问题的,但是VSCode会有红色波浪线提示,...原创 2020-05-07 20:12:23 · 21899 阅读 · 1 评论 -
深度学习:1_常用的数据增强 Data Augmentation
深度学习中,通常需要对数据进行增强处理 Data Augmentaion,再训练数据。常用的数据增强方法有1、翻转变换 flip(左右/上下)2、随机修剪 random crop3、色彩抖动 color jittering4、平移变换 shift5、尺度变换 scale6、对比度变换 contrast7、噪声扰动 noise8、旋转变换/反射变换 Rotation/...原创 2020-02-25 22:56:17 · 1609 阅读 · 0 评论 -
OpenCV:13_最大值最小值滤波 MaxMin Filter
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...原创 2020-02-24 00:27:05 · 3512 阅读 · 0 评论 -
OpenCV:11_均值滤波 Mean Filter
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...原创 2020-02-23 23:58:06 · 721 阅读 · 0 评论 -
OpenCV:9_高斯滤波Gauss Filter
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...原创 2020-02-23 17:38:30 · 458 阅读 · 0 评论 -
OpenCV:10_中值滤波 Median Filter
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...原创 2020-02-21 20:52:35 · 1159 阅读 · 0 评论 -
OpenCV:7_平均池化 Average Pooling
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...原创 2019-12-19 15:15:49 · 1323 阅读 · 0 评论 -
OpenCV:3_二值化
#include <QCoreApplication>#include <iostream>//OpenCV#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>int main(int a...原创 2019-11-12 19:28:14 · 675 阅读 · 0 评论 -
OpenCV:2_灰度化
#include <QCoreApplication>#include <iostream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>int main(int argc, char...原创 2019-11-12 14:05:00 · 249 阅读 · 0 评论 -
OpenCV:1_通道互换
#include <iostream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>int main(int argc, char *argv[]){ cv::Mat srcImage = c...原创 2019-11-12 13:49:39 · 758 阅读 · 0 评论 -
VS2015配置OpenCV
版本:VS2015OpenCV3.4.31、下载OpenCV,解压如下:2、打开工程属性,选择VC++目录,选择包含目录3、编辑包含目录,添加头文件路径:F:\OpenCV3\install\build\includeF:\OpenCV3\install\build\include\opencvF:\OpenCV3\install\build\include...原创 2019-11-05 11:11:17 · 339 阅读 · 0 评论 -
Cmakelists关于opencv的配置
# cmake needs this linecmake_minimum_required(VERSION 2.8)# Define project nameproject(video_capture)# Find OpenCV, you may need to set OpenCV_DIR variable# to the absolute path to the directory conta...原创 2018-05-19 10:24:34 · 1442 阅读 · 0 评论 -
Cmakelists关于PCL和OpenCV同时的配置
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)project(Measure_Size)#OpenCvfind_package(OpenCV REQUIRED)include_directories(${OpenCV_INCLUDE_DIRS})message(STATUS " include path: ${OpenCV_INCLUDE_DI...原创 2018-05-19 10:25:23 · 808 阅读 · 0 评论 -
opencv读取图像
//OpenCV#include <opencv2/core.hpp>#include <opencv2/highgui/highgui.hpp>using namespace cv;int main( int argc, char *argv[ ] ){ cv::Mat image; image = cv::im...原创 2018-08-15 11:36:24 · 271 阅读 · 0 评论 -
OpenCV读取文件照片
OpenCV中用imread来实现图像文件读取的,用法:#include <opencv2/highgui,hpp>cv::Mat image;1、双右斜线法:image = cv::imread(” C:\\desktop\\1.bmp “);2、双左斜线法image = cv::imread(” C:\\desktop\\1.bmp “);3、单左斜线...原创 2018-08-18 14:39:25 · 521 阅读 · 0 评论 -
OpenCV之图像拷贝
图像拷贝有两种概念:cv::Mat image;1:浅拷贝当图像之间进行赋值时,图像数据并未发生复制,两个对象指向同一块内存,改变图像2会影响图像1cv::Mat img;img = image;2:深拷贝当图像之间进行赋值时,图像数据发生复制,两个对象指向不同的内存,改变图像2不会影响图像1cv::Mat img;img.copyTo(image);img...原创 2018-08-18 15:00:41 · 13059 阅读 · 0 评论 -
Zbar扫描条形码代码
#include <zbar.h> zbar::ImageScanner scaner; scaner.set_config(zbar::ZBAR_NONE,zbar::ZBAR_CFG_ENABLE,1); int width = img_gray.cols; int height = img_gray.rows; //在ZBar...原创 2018-08-20 09:35:13 · 2342 阅读 · 0 评论 -
Qt配置OpenCV3.4.1
1、OpenCV3.4.1下载地址:https://pan.baidu.com/s/13eZVK_MXUmr0gNw3E9hFqg2、下载完,解压后如下图所示:3、配置环境变量F:\OpenCV3\install\build\x64\vc14\bin4、Pro文件添加库文件路径#OpenCVINCLUDEPATH += "E:/opencv/build/include"\...原创 2019-08-10 09:55:01 · 694 阅读 · 0 评论 -
OpenCV:遍历像素
OpenCV遍历像素常见有三种方式:1、双循环遍历void TraversalPixel_1(cv::Mat& image_in,cv::Mat& image_out,int div){ image_out = image_in.clone(); int rowNumber = image_in.rows; int colNumber = ima...原创 2019-09-11 09:44:40 · 643 阅读 · 0 评论 -
Ubuntu运行OpenCV报错
错误提示如图:原因:没有安装libgtk2.0-dev和pkg-config ,这两依赖项要先于opencv安装安装方式:sudo apt-get install libgtk2.0-dev sudo apt-get install pkg-config安装完成后,再安装opencv即可...原创 2018-05-10 19:09:28 · 513 阅读 · 0 评论