opencv安装路径以及使用

1. opencv各自算法的使用以及原理(杂合版本)

1.1 计算LK光流

官网链接:OpenCV: Object Tracking

1.1.1 光流法的三个基本假设:

(1)灰度不变假设

(2)时间连续小运动假设

(3)空间一致假设(领域内所有像素点的运动一致)

1.1.2 稀疏光流和稠密光流的区别

稀疏光流是只跟踪特征点,稠密光流是跟踪所有像素

1.1.3 关于代码存在的疑问

光流怎么实际应用呢?计算出来之后

输出数据的格式是什么?误差是什么?

1.2 追踪特征

goodFeaturesToTrack函数详细注释_xdfyoga1的博客-CSDN博客_goodfeaturestotrack

注意最后一个参数mask,表示尽可能在感兴趣的区域进行特征提取

1.3. 求解PnP问题

cv::solvePnP详解_Amelie_xiao的博客-CSDN博客_cv::solvepnp

1.4 triangulatePoints函数

2. 访问像素的三种方法

2.1. ptr (最快)

cv::Mat img;

// 1. 图像是灰度图
uchar value = img.ptr<uchar>(i)[j]; // 获取第i行第j列的像素值
// 2. 图像是RGB图
cv::Vec3b vector = img.ptr<cv::Vec3b>(i)[j];  // 获取第i行第j列的3个通道的像素值
uchar value = img.ptr<cv::Vec3b>(i)[j][0/1/2];

2.2. 迭代器访问

cv::Mat img;

//    图像是rgb图像
it = img.begin<cv::Vec3b>();

(*it)[0/1/2] // 依次获取像素点的通道值
it++

2.3. at访问

cv::Mat img;

//    RGB
img.at<cv::Vec3b>(row,col)[0/1/2]

//    Gray
img.at<uchar>(row, col)

Cmake使用

find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(CLionTest ${OpenCV_LIBS})

别看了,我只是为了记住安装路径,好卸载或者多版本兼容

/usr/local/share/licenses/opencv3

/usr/local/include/opencv2

/usr/local/lib/pkgconfig/opencv.pc

/usr/local/share/OpenCV

/usr/local/bin/setup...

/usr/local/share/licemse..

/usr/local/include/opencv/...

 Installing: /usr/local/share/licenses/opencv3/opencl-headers-LICENSE.txt
-- Installing: /usr/local/include/opencv2/cvconfig.h
-- Installing: /usr/local/include/opencv2/opencv_modules.hpp
-- Installing: /usr/local/lib/pkgconfig/opencv.pc
-- Installing: /usr/local/share/OpenCV/OpenCVModules.cmake
-- Installing: /usr/local/share/OpenCV/OpenCVModules-release.cmake
-- Installing: /usr/local/share/OpenCV/OpenCVConfig-version.cmake
-- Installing: /usr/local/share/OpenCV/OpenCVConfig.cmake
-- Installing: /usr/local/bin/setup_vars_opencv3.sh
-- Installing: /usr/local/share/OpenCV/valgrind.supp
-- Installing: /usr/local/share/OpenCV/valgrind_3rdparty.supp
-- Installing: /usr/local/share/licenses/opencv3/libjpeg-turbo-README.md
-- Installing: /usr/local/share/licenses/opencv3/libjpeg-turbo-LICENSE.md
-- Installing: /usr/local/share/licenses/opencv3/libjpeg-turbo-README.ijg
-- Installing: /usr/local/share/licenses/opencv3/libtiff-COPYRIGHT
-- Installing: /usr/local/share/licenses/opencv3/jasper-LICENSE
-- Installing: /usr/local/share/licenses/opencv3/jasper-README
-- Installing: /usr/local/share/licenses/opencv3/jasper-copyright
-- Installing: /usr/local/share/licenses/opencv3/libpng-LICENSE
-- Installing: /usr/local/share/licenses/opencv3/libpng-README
-- Installing: /usr/local/share/licenses/opencv3/openexr-LICENSE
-- Installing: /usr/local/share/licenses/opencv3/openexr-AUTHORS.ilmbase
-- Installing: /usr/local/share/licenses/opencv3/openexr-AUTHORS.openexr
-- Installing: /usr/local/share/licenses/opencv3/protobuf-LICENSE
-- Installing: /usr/local/share/licenses/opencv3/protobuf-README.md
-- Installing: /usr/local/share/licenses/opencv3/quirc-LICENSE
-- Installing: /usr/local/share/licenses/opencv3/ittnotify-LICENSE.BSD
-- Installing: /usr/local/share/licenses/opencv3/ittnotify-LICENSE.GPL
-- Installing: /usr/local/include/opencv/cv.h
-- Installing: /usr/local/include/opencv/cv.hpp
-- Installing: /usr/local/include/opencv/cvaux.h
-- Installing: /usr/local/include/opencv/cvaux.hpp
-- Installing: /usr/local/include/opencv/cvwimage.h
-- Installing: /usr/local/include/opencv/cxcore.h
-- Installing: /usr/local/include/opencv/cxcore.hpp
-- Installing: /usr/local/include/opencv/cxeigen.hpp
-- Installing: /usr/local/include/opencv/cxmisc.h
-- Installing: /usr/local/include/opencv/highgui.h
-- Installing: /usr/local/include/opencv/ml.h
-- Installing: /usr/local/include/opencv2/opencv.hpp
-- Installing: /usr/local/lib/libopencv_core.so.3.4.9
-- Installing: /usr/local/lib/libopencv_core.so.3.4
-- Set runtime path of "/usr/local/lib/libopencv_core.so.3.4.9" to "/usr/local/lib"
-- Installing: /usr/local/lib/libopencv_core.so
-- Installing: /usr/local/include/opencv2/core/opencl/ocl_defs.hpp
-- Installing: /usr/local/include/opencv2/core/opencl/opencl_info.hpp
-- Installing: /usr/local/include/opencv2/core/opencl/opencl_svm.hp
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值