资源简介
配置好相关库 代码直接可用 (多线程读取图像并显示)
代码片段和文件信息
#include “calibration.h“
#include “utils.h“
#include “global.h“
#include
#include
void loadCameraParams(cv::Mat &cameraMatrix cv::Mat &distCoeffs)
{
cv::FileStorage fs(“..\\build\\camera.yaml“ cv::FileStorage::READ);
fs [“camera_matrix“] >> cameraMatrix;
fs [“distortion_coefficients“] >> distCoeffs;
}
cv::Mat calibrator(cv::Mat &view)
{
#if 1
vector imageList;
/*static */bool bLoadCameraParams = false;
static bool bInitMap = false;
static cv::Mat cameraMatrix distCoeffs map1 map2;
static cv::Mat newCameraMatrix;
cv::Mat rview;
cv::Size imageSizenewImageSize;
/*static */double cameraMatrix_1 = 0cameraMatrix_2 = 0cameraMatrix_3 = 0cameraMatrix_4 = 0;
/*static */double distCoeffs_1 = 0 distCoeffs_2 = 0 distCoeffs_3 = 0 distCoeffs_4 = 0 distCoeffs_5 = 0;
if(view.empty() || view.cols == 0 || view.rows == 0)
return cv::Mat();
imageSize.width = view.cols;
imageSize.height = view.rows;
// newImageSize.width = 1.5*imageSize.width;
// newImageSize.height = 1.5*imageSize.height;
newImageSize.width = imageSize.width;
newImageSize.height = imageSize.height;
if(bLoadCameraParams == false)
{
loadCameraParams(cameraMatrix distCoeffs);
bLoadCameraParams = true;
cameraMatrix_1 = cameraMatrix.at(00);
cameraMatrix_2 = cameraMatrix.at(02);
cameraMatrix_3 = cameraMatrix.at(11);
cameraMatrix_4 = cameraMatrix.at(12);
distCoeffs_1 = distCoeffs.at(00);
distCoeffs_2 = distCoeffs.at(10);
distCoeffs_3 = distCoeffs.at(20);
distCoeffs_4 = distCoeffs.at(30);
distCoeffs_5 = distCoeffs.at(40);
}
int middleValue = 100; // 100;
if(bLoadCameraParams == true)
{
cameraMatrix.at(0 0) = (camera_matrix_1_MIN - middleValue) * 1.0 / middleValue * cameraMatrix_1;
cameraMatrix.at(0 2) = (camera_matrix_2_MIN - middleValue) * 1.0 / middleValue * cameraMatrix_2;
cameraMatrix.at(1 1) = (camera_matrix_3_MIN - middleValue) * 1.0 / middleValue * cameraMatrix_3;
cameraMatrix.at(1 2) = (camera_matrix_4_MIN - middleValue) * 1.0 / middleValue * cameraMatrix_4;
distCoeffs.at(0 0) = (distortion_coeff_1_MIN - middleValue) * 1.0 / middleValue * distCoeffs_1;
distCoeffs.at(1 0) = (distortion_coeff_1_MIN - middleValue) * 1.0 / middleValue * distCoeffs_2;
distCoeffs.at(2 0) = (distortion_coeff_1_MIN - middleValue) * 1.0 / middleValue * distCoeffs_3;
distCoeffs.at(3 0) = (distortion_coeff_1_MIN - middleValue) * 1.0 / middleValue * distCoeffs_4;
distCoeffs.at(4 0) = (distortion_coeff_1_MIN - middleValue) * 1.0 / middleValue * distCoeffs_5;
}
// SHOW_TICK();
// 省了15ms左右的消耗
// if (bInitMap == false)
{
newCameraMatrix = cv::getOptimalNewCameraMatrix(cameraMatrix distCoeffs imageSize
1 newImageSize 0);
cv::initUndi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-31 12:54 calibrationRT\
目录 0 2018-03-31 12:56 calibrationRT\Debug\
目录 0 2018-03-21 19:24 calibrationRT\build\
文件 791 2015-12-18 16:49 calibrationRT\build\HKVISION_DEBUG_32.props
文件 791 2015-12-17 14:53 calibrationRT\build\HKVISION_DEBUG_64.props
文件 19522 2016-02-24 18:29 calibrationRT\build\camera.yaml
文件 19530 2016-01-27 23:35 calibrationRT\build\camera_nofisheye.yaml
文件 19523 2016-01-03 15:32 calibrationRT\build\camerabk.yaml
文件 1540 2016-01-05 16:46 calibrationRT\build\opencv3_32.props
文件 1559 2015-12-17 14:53 calibrationRT\build\opencv3_64.props
文件 1559 2015-12-17 14:53 calibrationRT\build\opencv3_debug_32.props
文件 1559 2018-03-22 22:21 calibrationRT\build\opencv3_x86.props
文件 18513 2015-12-17 14:53 calibrationRT\build\param.png
目录 0 2018-03-25 12:29 calibrationRT\caliRt\
目录 0 2018-03-22 21:48 calibrationRT\caliRt\Debug\
文件 2221 2016-02-24 16:18 calibrationRT\caliRt\Debug\caliRt.Build.CppClean.log
文件 15 2018-03-22 21:48 calibrationRT\caliRt\Debug\caliRt.log
目录 0 2018-03-21 21:28 calibrationRT\caliRt\Debug\caliRt.tlog\
文件 355336 2018-03-22 21:48 calibrationRT\caliRt\Debug\caliRt.tlog\CL.read.1.tlog
文件 11566 2018-03-22 21:48 calibrationRT\caliRt\Debug\caliRt.tlog\CL.write.1.tlog
文件 214 2018-03-21 21:29 calibrationRT\caliRt\Debug\caliRt.tlog\caliRt.lastbuildstate
文件 9146 2018-03-22 21:48 calibrationRT\caliRt\Debug\caliRt.tlog\cl.command.1.tlog
文件 4770 2018-03-21 21:30 calibrationRT\caliRt\Debug\caliRt.tlog\li
文件 10252 2018-03-21 21:30 calibrationRT\caliRt\Debug\caliRt.tlog\li
文件 2094 2018-03-21 21:30 calibrationRT\caliRt\Debug\caliRt.tlog\li
文件 0 2018-03-21 21:29 calibrationRT\caliRt\Debug\caliRt.tlog\unsuccessfulbuild
文件 276613 2018-03-21 21:30 calibrationRT\caliRt\Debug\calibration.obj
文件 260176 2018-03-21 21:30 calibrationRT\caliRt\Debug\global.obj
文件 532674 2018-03-22 21:48 calibrationRT\caliRt\Debug\main.obj
文件 746040 2018-03-21 21:30 calibrationRT\caliRt\Debug\readCamera.obj
文件 201857 2018-03-21 21:30 calibrationRT\caliRt\Debug\utils.obj
............此处省略47个文件信息
相关资源
- 海康威视转码使用的 ffmpeg
- 蓝讯SDK开发_工具链及IDE_包含RV32-Too
- 视频监控系统源码 带SDK
- 英伟达 最新的Video_Codec_SDK_9.0.20 sdk
- IPCLinux.zip
- SDK_2.6.1_EVK-MIMXRT1064.zip
- xcode 13.4ios sdk
- nRF51822开发工具包 SDK包 协议栈 全
- Physx sdk 3.2.31
- AC692x_SDK_release_V2.6.1.rar
- 基于ivector的说话人识别SDK
- 海康威视DS-78 88NB-Kx系列V3.4.104 build
- 海康SDK的DEMO
- OPC UA Client SDK 包含WIN32&x64;库及测试程
- imx6x gpu sdk
- Qt开发的海康威视摄像头开发
- physx3.2 sdk(3)
- physx3.2 sdk(2)
- physx3.2 SDK (1)
- NRF52832_SDK_15.0.0
- jdk-8u231-macosx-x64.dmg JDK8最新官方SDK
- 安装HiMobileCam_SDK需要的工具集.rar
- 海康流媒体SDK开发
- 人脸识别sdk,含单目活体检测
- Mac版 dart sdk
- 2019最新版eclipse.rar
- installer_r24.4.1-windows
- Kinect+v2+Examples+with+MS-SDK
- win_sdk_10.0.10586 离线安装版 (part 2)
- X-CUBE-MCSDK-FUL_5.4.3.rar
评论
共有 条评论