工具代码
各种工具代码
gzr2018
nudt PhD candidate,NeRF/3DGS
展开
-
Qt读取txt文件中int,string等数据
Qt读取txt文本数据网上更多的是一行一行读取QTextStream txtInput(&f); QString lineStr; while (!txtInput.atEnd()) { lineStr = txtInput.readLine(); //读取数据 QMessageBox::about(NULL, "字段...原创 2019-12-10 21:03:00 · 2404 阅读 · 0 评论 -
Python字符串处理和输入输出
Python写一些字符串模拟题还是方便挺多,稍微整理一下,以免遗忘切片操作1.简单切片前闭后开,字符串下标从0开始 s[ start : stop ] s[:a] ->表示开头截取到某个特定的位置 s[a:] ->某一位开始截取到最后一位可以用 索引为为负数:从-1开始,表示最后一位2.带步长切片s [start: stop: stride]当步长为...原创 2020-07-02 18:33:00 · 439 阅读 · 0 评论 -
OJ题目输出的生成
input随机数据生成示例:void data_get_in(){ srand((unsigned int)time(NULL)); freopen("C:\\Users\\gzr2018\\Desktop\\1.in","w",stdout); int len=0; cout<<9<<endl; for(int i=0;...原创 2020-06-16 23:52:00 · 185 阅读 · 0 评论 -
Linux for windos 2
void get_4_bmp_5(int cam,int group){ srand((int)time(0)); // string pre= "/home/gzr/下载/LXF-20200810-50组_1-10/1-1/CCD"+to_string(cam); string pre="/home/gzr/下载/50组1-10/undistortImg"; ...原创 2020-08-19 09:50:00 · 69 阅读 · 0 评论 -
处理txt文件,保存为yml和cal文件
xn提供的标定优化后的内外参格式是txt,不满足生成模板的yml和标定测量的cal,故转换void deal_yml_file() { string datapath = "C:/Users/gzr2018/Desktop/xuening'data/0224"; std::string outpath; outpath = datapath + "/yaml...原创 2021-02-24 10:08:00 · 1767 阅读 · 0 评论 -
欧拉角欧拉矩阵
//计算旋转角double calculateAngle(const Eigen::Vector3d &vectorBefore, const Eigen::Vector3d &vectorAfter){ double ab, a1, b1, cosr; ab = vectorBefore.x()*vectorAfter.x() + vectorBef...原创 2021-02-17 19:43:00 · 660 阅读 · 0 评论 -
OpenCV 图像和ROI去畸变
void calibration_distort(string cur_photo_path) { cv::Mat cameraMatrix[70]; cv::Mat distortionCoeff[70]; std::vector<cv::Mat> undistortImg(70); std::string datapath = "./dat...原创 2021-01-18 16:54:00 · 238 阅读 · 0 评论 -
linux for windows
map<string,rad_err> linemod_match::match_final(string path){ srand((unsigned) time(NULL));//diff color MIPP_test(); time_t begin,end; double duration; begin=clock(); ...原创 2020-08-10 19:32:00 · 229 阅读 · 0 评论 -
Python字符串处理
Python写一些字符串模拟题还是方便挺多,稍微整理一下,以免遗忘切片操作1.简单切片前闭后开,字符串下标从0开始 s[ start : stop ] s[:a] ->表示开头截取到某个特定的位置 s[a:] ->某一位开始截取到最后一位可以用 索引为为负数:从-1开始,表示最后一位2.带步长切片s [start: stop: stride]当步长为负数,反方向的截取部分的字符串,步长的绝对值大于1表示间隔的取数。例如:s[::-1],表示反转字符串。 前两个.原创 2020-07-02 18:34:25 · 276 阅读 · 0 评论 -
Apritag角点代码检测
#import apriltag#import pupil_apriltags as apriltag # for windowsimport cv2import numpy as npimport sysimport pandas as pdfrom pupil_apriltags import Detectorimport osprint('ok')def init...原创 2021-07-07 16:59:00 · 548 阅读 · 0 评论