毕设编程问题总结

**CDialogEx::UpdateData() 函数的原型为:**BOOL UpdateData(BOOL bSaveAndValidate = TRUE);

​ 参数:bSaveAndValidate 用于指示数据传输的方向,TRUE 表示从 控件 传给 变量FALSE 表示从 变量 传给 控件默认值是 TRUE,即从 控件 传给 变量。

ui->lineedit->text();

获取combox所选内容

ui->comboBox->currentText();

获取textedit文本内容

ui->textEdit->toPlainText();

QString 转double,double转QString 互转
将double数据写入excel 去除科学计数法

1.double 转QString 小数点问题

double data = 40.215586810458;
QString str = QString::number(data,‘f’,10); // f 表示非科学记数法 10表示小数点后保留10位

2.QString 转 double 小数点问题

#include
QString num(“12.3456789”);
double d = num.toDouble();
qDebug()<<fixed<<qSetRealNumberPrecision(7)<<d; // fixed 表示非科学记数法,7表示小数点位数。

qt要先搞好ocx

D:\Windows Kits\10\bin\10.0.18362.0\x86用这个查看uuid

uuid:46C2CB81-382F-409F-B933-24FA4F797AD4

‘qaxobject.h’ file not found

在pro里面添加

QT += axcontainer

qt路径不能有中文,好坑

qt用oax要注意是不是32位的,太坑了

qt发布的时候,要注意create里面和命令行是一个东西,然后命令行要搞一下类似这样的命令:windeployqt myTest.exe

删除槽函数要重新编译,按Shift+F2

qtlabel添加边框

border-width: 1px;
border-style: solid;
border-color: rgb(0, 0, 0)

改变字体大小

torch

conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forge

import torch
#检查cuda是否可以使用
torch.cuda.is_available()
#查看当前gpu索引号
torch.cuda.current_device()
#查看当前cuda流
torch.cuda.current_stream(device=0)
#选择device
torch.cuda.device(1)
#查看有多少个GPU设备
torch.cuda.device_count()
#查看gpu的容量
torch.cuda.get_device_capability(device=0)

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "detect.py",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "args": [
                "--source", "D:\\大学资料\\毕设\\图像处理\\yolov5\\yolov5-master\\NEU-DET\\val\\images\\图片5.jpg",
                "--weights", "D:\\大学资料\\毕设\\图像处理\\yolov5\\yolov5-master\\yolov5-master\\runs\\train\\exp23\\weights\\best.pt",
                "--conf", "0.1"
            ]
        },
        {
            "name": "train.py",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "args": [
                "--data",
                "../NEU-DET/data.yaml",
                "--cfg",
                "./models/yolov5s.yaml",
                "--batch-size",
                "1",
                "--resume"
            ]
        }
    ]
}

__int64 does not name a type

#include <inttypes.h>加这个

mfc获取编辑框内容

CString str;
GetDlgItem(IDC_EDIT)->GetWindowText(str);
AfxMessageBox(str);

opencv 硬拼接

int i = 0,j=0;
Mat combine;
Mat row[5][5], column[5];
Mat com_row[5][5], con_column[5];

row[0][0] = imread(“C:\test\pic_div\1-1.jpg”);
row[0][1] = imread(“C:\test\pic_div\1-2.jpg”);
row[0][2] = imread(“C:\test\pic_div\1-3.jpg”);
row[0][3] = imread(“C:\test\pic_div\1-4.jpg”);
row[0][4] = imread(“C:\test\pic_div\1-5.jpg”);

row[1][0] = imread(“C:\test\pic_div\2-1.jpg”);
row[1][1] = imread(“C:\test\pic_div\2-2.jpg”);
row[1][2] = imread(“C:\test\pic_div\2-3.jpg”);
row[1][3] = imread(“C:\test\pic_div\2-4.jpg”);
row[1][4] = imread(“C:\test\pic_div\2-5.jpg”);

row[2][0] = imread(“C:\test\pic_div\3-1.jpg”);
row[2][1] = imread(“C:\test\pic_div\3-2.jpg”);
row[2][2] = imread(“C:\test\pic_div\3-3.jpg”);
row[2][3] = imread(“C:\test\pic_div\3-4.jpg”);
row[2][4] = imread(“C:\test\pic_div\3-5.jpg”);

row[3][0] = imread(“C:\test\pic_div\4-1.jpg”);
row[3][1] = imread(“C:\test\pic_div\4-2.jpg”);
row[3][2] = imread(“C:\test\pic_div\4-3.jpg”);
row[3][3] = imread(“C:\test\pic_div\4-4.jpg”);
row[3][4] = imread(“C:\test\pic_div\4-5.jpg”);

row[4][0] = imread(“C:\test\pic_div\5-1.jpg”);
row[4][1] = imread(“C:\test\pic_div\5-2.jpg”);
row[4][2] = imread(“C:\test\pic_div\5-3.jpg”);
row[4][3] = imread(“C:\test\pic_div\5-4.jpg”);
row[4][4] = imread(“C:\test\pic_div\5-5.jpg”);

//cv::resize(a, a, cv::Size(1984, 1488), 0, 0, CV_INTER_LINEAR);
//cv::resize(b, b, cv::Size(1984, 1488), 0, 0, CV_INTER_LINEAR);
//cv::resize(c, c, cv::Size(1984, 1488), 0, 0, CV_INTER_LINEAR);
//cv::resize(d, d, cv::Size(1984, 1488), 0, 0, CV_INTER_LINEAR);
//水平拼接
com_row[0][0] = row[0][0];
com_row[1][0] = row[1][0];
com_row[2][0] = row[2][0];
com_row[3][0] = row[3][0];
com_row[4][0] = row[4][0];
for (i = 0; i < 5; i = i + 1)
{
for (j = 0; j < 4; j = j + 1)
{
hconcat(com_row[i][j], row[i][j+1], com_row[i][j+1]);
}
column[i] = com_row[i][4]; //产生的每一行的拼接图片
}
//垂直拼接
con_column[0] = column[0];
for (i = 0; i < 4; i = i + 1)
{
vconcat(con_column[i], column[i + 1], con_column[i + 1]);
}
combine = con_column[4];
namedWindow(“Combine”, CV_WINDOW_AUTOSIZE);
imshow(“Combine”, combine);
imwrite(“Combine.png”, combine);

folderPath.Format(“%s%s%s”, m_file,“\”, str);

houshouhari.xyz

443

/slwsray

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值