当前位置: 首页 > wzjs >正文

资格证网站怎么做wordpress 添加用户登录

资格证网站怎么做,wordpress 添加用户登录,wordpress login_head,韩国网站建设下面是一个完整的 使用 OpenCV 进行相机内参标定(Camera Calibration) 的示例,包括 C 和 Python 两个版本,基于棋盘格图案标定。一、目标:相机标定 通过拍摄多张带有棋盘格图案的图像,估计相机的内参&#…

下面是一个完整的 使用 OpenCV 进行相机内参标定(Camera Calibration) 的示例,包括 C++ 和 Python 两个版本,基于棋盘格图案标定。


一、目标:相机标定

通过拍摄多张带有棋盘格图案的图像,估计相机的内参:

  • 相机矩阵(内参) K
  • 畸变系数 distCoeffs
  • 可选外参(R, T)
  • 标定精度指标(如重投影误差)

二、棋盘格参数设置(根据自己的棋盘格设置):

  • 棋盘格角点数:9 x 6(内角点,9列×6行);
  • 每个格子实际尺寸为:25.0 mm(自定义);
  • 图像列表已存为多张 JPG /或者其他格式图片。

三、Python 示例(

import cv2
import numpy as np
import glob# 设置棋盘格参数
chessboard_size = (9, 6)
square_size = 25.0  # mm# 生成世界坐标系下的 3D 点
objp = np.zeros((np.prod(chessboard_size), 3), np.float32)
objp[:, :2] = np.indices(chessboard_size).T.reshape(-1, 2)
objp *= square_size# 储存所有图像的角点
objpoints = []  # 3D points
imgpoints = []  # 2D points# 读取图片
images = glob.glob("calib_images/*.jpg")for fname in images:img = cv2.imread(fname)gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)# 检测角点ret, corners = cv2.findChessboardCorners(gray, chessboard_size, None)if ret:objpoints.append(objp)corners2 = cv2.cornerSubPix(gray, corners, (11,11), (-1,-1),criteria=(cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001))imgpoints.append(corners2)# 可视化角点cv2.drawChessboardCorners(img, chessboard_size, corners2, ret)cv2.imshow('img', img)cv2.waitKey(100)cv2.destroyAllWindows()# 标定相机
ret, K, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1], None, None)print("相机内参矩阵 K:\n", K)
print("畸变系数 dist:\n", dist)
print("重投影误差:", ret)

四、C++ 示例

#include <opencv2/opencv.hpp>
#include <vector>
#include <iostream>
#include <filesystem>using namespace cv;
using namespace std;int main() {Size boardSize(9, 6);float squareSize = 25.0f;vector<vector<Point3f>> objectPoints;vector<vector<Point2f>> imagePoints;vector<Point3f> objp;for (int i = 0; i < boardSize.height; ++i)for (int j = 0; j < boardSize.width; ++j)objp.emplace_back(j * squareSize, i * squareSize, 0);vector<String> imageFiles;glob("calib_images/*.jpg", imageFiles);for (const auto& fname : imageFiles) {Mat img = imread(fname);Mat gray;cvtColor(img, gray, COLOR_BGR2GRAY);vector<Point2f> corners;bool found = findChessboardCorners(gray, boardSize, corners);if (found) {cornerSubPix(gray, corners, Size(11,11), Size(-1,-1),TermCriteria(TermCriteria::EPS + TermCriteria::MAX_ITER, 30, 0.001));imagePoints.push_back(corners);objectPoints.push_back(objp);drawChessboardCorners(img, boardSize, corners, found);imshow("Corners", img);waitKey(100);}}destroyAllWindows();Mat K, distCoeffs;vector<Mat> rvecs, tvecs;calibrateCamera(objectPoints, imagePoints, Size(640, 480),K, distCoeffs, rvecs, tvecs);cout << "Camera Matrix K:\n" << K << endl;cout << "Distortion Coefficients:\n" << distCoeffs << endl;
}

五、输出参数解释

参数含义
K / cameraMatrix相机内参矩阵 (fx, fy, cx, cy)
distCoeffs畸变参数 [k1, k2, p1, p2, k3]
rvecs每张图像的旋转向量
tvecs每张图像的平移向量
ret平均重投影误差(数值越小越好)

六、应用建议

  • 拍摄图像时应尽量覆盖各个角度、不同距离;
  • 建议图像 >10 张以上;
  • 标定结果可用于 cv::undistortcv::initUndistortRectifyMap 做图像矫正;
  • 也可以用 fisheye 模型标定 (cv::fisheye::calibrate),适用于广角相机。


文章转载自:

http://942AN2iU.zrhhb.cn
http://7fvfwZfv.zrhhb.cn
http://QtmHz2aG.zrhhb.cn
http://UiJoVV4j.zrhhb.cn
http://7jrNV0IE.zrhhb.cn
http://FVtCC8A5.zrhhb.cn
http://YqIYziQe.zrhhb.cn
http://TxQivqS8.zrhhb.cn
http://eIPsPYfg.zrhhb.cn
http://2rZ6ynpr.zrhhb.cn
http://tiLnAcu4.zrhhb.cn
http://m0aaBZL0.zrhhb.cn
http://2oO1Jgha.zrhhb.cn
http://ljaTg58U.zrhhb.cn
http://WUpZFqEG.zrhhb.cn
http://3QdACCl6.zrhhb.cn
http://Jxs0dO85.zrhhb.cn
http://p0j1LUyU.zrhhb.cn
http://rNX7Xy1o.zrhhb.cn
http://VOKefaGz.zrhhb.cn
http://ixyNEl20.zrhhb.cn
http://Mez6FQsR.zrhhb.cn
http://zQJOPRKu.zrhhb.cn
http://FdiA7wJS.zrhhb.cn
http://uEwj5EY5.zrhhb.cn
http://iE4NiJhC.zrhhb.cn
http://Km0wra8A.zrhhb.cn
http://He7i75Vk.zrhhb.cn
http://7FmIPn5H.zrhhb.cn
http://UKkprjgO.zrhhb.cn
http://www.dtcms.com/wzjs/771783.html

相关文章:

  • 鹤壁seo公司超云seo优化
  • 建设网站的条件网站建设当中的技术解决方案
  • 沈阳网站建设培训外贸网络推广哪个好
  • 建设医院的网站泰安优化公司
  • asp网站建设课程设计搜索引擎整合营销
  • 网站建设中英版品牌营销咨询机构
  • 南宁网络营销网站生态旅游网站的建设
  • 银川怎么做网站网站开发的未来展望
  • 网站数据库查询怎么做北京州网站建设公司
  • 网站备案流程是什么附子seo
  • 用h5做网站首页代码wordpress文章页实现图片幻灯展现
  • 佛山市三山新城建设局网站ipad 设计网站
  • 网站设计 北京店临清建设局网站
  • 如何免费做网站推广的力杨网站建设
  • 网站站长登录方式公司免费建网站
  • 网站一级域名和二级域名区别成都网站建设制作公司
  • 网站换模板要怎么做地方网站名称
  • wordpress网站添加阅读全文给小说网站做编辑
  • 做论坛网站需要备案惠州营销网站建设
  • 佛山北京网站建设公司电话外呼系统
  • 内部门户网站建设方案东莞网页设计费用
  • 长沙正规制作网站公司wordpress 添加角色
  • 建网站基础知识做特卖的网站雅美盛典
  • 瑞丽网站建设在哪个网站上做实验仪器比较好
  • 句容住房和城乡建设局网站百度词条优化工作
  • 西宁网站建设推广东莞网站建设价格价格
  • 东莞外贸网站推广建设专业东莞网站建设报价
  • 做一个商城网站多少钱知名品牌形象策划公司
  • 网站没有备案是假的吗重庆做网站建设的公司
  • 青岛的网站建设公司北京建设工程二级市场网站