摘要: string转QString: string str = "Doublearmy"; QString qstr = QString::fromStdString(str) ; QString转string: QString qstr = "Doublearmy"; string str = qstr 阅读全文
posted @ 2021-03-26 09:54 doublearmy 阅读(258) 评论(0) 推荐(0) 编辑
摘要: //Mat与halcon类型的转换cv::Mat HObject2Mat(HObject Hobj){ HTuple htCh; HString cType; cv::Mat Image; ConvertImageType(Hobj, &Hobj, "byte"); CountChannels(Ho 阅读全文
posted @ 2021-01-15 17:22 doublearmy 阅读(767) 评论(0) 推荐(0) 编辑
摘要: //纵向拼图 Mat vsource1 = imread("1.bmp"); Mat vsource2 = imread("2.bmp"); Mat vResultSrc; vconcat(vsource1, vsource2 , vResultSrc); //横向拼图 Mat hsource1 = 阅读全文
posted @ 2021-01-14 08:52 doublearmy 阅读(383) 评论(0) 推荐(0) 编辑
摘要: //计算两点之间的距离 double getDistance (Point2f point1, Point2f point2) { double distance = sqrtf(powf((point1.x - point2.x),2) + powf((point1.y - point2.y),2 阅读全文
posted @ 2021-01-14 08:29 doublearmy 阅读(3775) 评论(0) 推荐(0) 编辑
摘要: Mat rotateImg(Mat img, double angle, Point Center) { Mat M = getRotationMatrix2D(Center, angle, 1.0); Mat dst; warpAffine(img, dst, M, Size(img.cols, 阅读全文
posted @ 2021-01-14 08:26 doublearmy 阅读(526) 评论(0) 推荐(0) 编辑
摘要: //进行图像平移 Mat ImageTranslation(Mat srcImage, int xOffset, int yOffset) { Size dst_sz = srcImage.size(); //定义平移矩阵 Mat t_mat = Mat::zeros(2, 3, CV_32FC1) 阅读全文
posted @ 2021-01-14 08:24 doublearmy 阅读(1515) 评论(0) 推荐(1) 编辑
摘要: //计算两个点的角度 double CalculateAngle(Point Mar1Point, Point Mar2Point) { double k = (double)(Mar2Point.y - Mar1Point.y) / (Mar2Point.x - Mar1Point.x); //计 阅读全文
posted @ 2021-01-14 08:23 doublearmy 阅读(1612) 评论(0) 推荐(0) 编辑
摘要: //文件时间比对 bool mtime_compare(QString ser_file, QString local_file) { QFileInfo fileInfo_local(local_file); QFileInfo fileInfo_server(ser_file); if(file 阅读全文
posted @ 2021-01-14 08:20 doublearmy 阅读(1021) 评论(0) 推荐(0) 编辑