01 2024 档案
摘要:#include <QApplication> #include <QLineEdit> #include <QDoubleValidator> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLineEdit li
阅读全文
摘要:#include <QApplication> #include <QLineEdit> #include <QIntValidator> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLineEdit lineE
阅读全文
摘要:2 0.301,0.020,1.238,1.0,0.0,0.0,0.0 151.34,377.43,629.57,-175.3,-6.96,86.03 3 0.329,0.103,1.214,1.0,0.0,0.0,0.0 109.51,391.63,629.55,-175.3,-6.96,82.2
阅读全文
摘要:import numpy as np # 定义x轴和y轴的单位向量 i = np.array([1, 0, 0]) j = np.array([0, 1, 0]) # 计算叉积,得到z轴的单位向量 k = np.cross(i, j) print("Z轴的方向是:", k) ############
阅读全文
摘要:cd catkin_ws bim@bim-Vostro-7570:~$ bim@bim-Vostro-7570:~$ ls catkin_ws Downloads Public Videos catkin_ws_backup_2024012601tar.gz examples.desktop REA
阅读全文
摘要:创建ROS工作空间 mkdir -p ~/catkin_ws/src cd ~/catkin_ws/ catkin_make bim@bim-Vostro-7570:~/catkin_ws$ bim@bim-Vostro-7570:~/catkin_ws$ catkin_make Base path
阅读全文
摘要:#include <opencv2/opencv.hpp> int main() { // 创建一个空的图片,宽度为500像素,高度为500像素,通道数为3(RGB),数据类型为8位无符号整数 cv::Mat image = cv::Mat::zeros(500, 500, CV_8UC3); //
阅读全文
摘要:osg给节点添加材质 #include <osg/Material> #include <osg/Geode> #include <osgDB/ReadFile> #include <osgViewer/Viewer> int main(){ // 创建一个场景节点 osg::ref_ptr<osg
阅读全文
摘要:osg绘制粗线条 #include <osg/Geometry> #include <osg/Geode> #include <osgViewer/Viewer> #include <osg/LineWidth> int main() { // 创建几何体对象 osg::ref_ptr<osg::G
阅读全文
摘要:Page({ /** * 页面的初始数据 */ data: { showUploadTip: false, haveGetOpenId: false, envId: '', openId: '' }, onLoad(options) { this.setData({ envId: options.e
阅读全文
摘要:Page({ /** * 页面的初始数据 */ data: { }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.repeatRun(); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周
阅读全文
摘要:*/5 * * * * * * 表示每5秒触发一次 0 0 2 1 * * * 表示在每月的1日的凌晨2点触发 0 15 10 * * MON-FRI * 表示在周一到周五每天上午10:15触发 0 0 10,14,16 * * * * 表示在每天上午10点,下午2点,4点触发 0 */30 9-1
阅读全文
摘要:C++ opencv计算两个cv::Rect的重复面积 #include <opencv2/opencv.hpp> #include <iostream> int main() { // 创建两个矩形 cv::Rect rect1(10, 10, 50, 50); // (x, y, width,
阅读全文
摘要:#include <osg/Material> #include <osg/Geode> #include <osgDB/ReadFile> #include <osgViewer/Viewer> int main() { // 创建一个场景节点 osg::ref_ptr<osg::Node> ro
阅读全文
摘要:opencv转qimage #include <opencv2/opencv.hpp> #include <QImage> #include <QColor> QImage MatToQImage(const cv::Mat &mat) { // 获取图像尺寸和通道数 int width = mat
阅读全文
摘要:osg::ref_ptr<osg::Node> root = ...; // 获取场景根节点 // 遍历场景图并删除所有节点 osg::Node::Children::iterator it; for (it = root->getChildren().begin(); it != root->ge
阅读全文
摘要:import torch # 加载模型参数 model_path = 'model.pth' model_state_dict = torch.load(model_path) # 创建模型实例 input_size = 10 # 输入层大小,根据实际情况调整 hidden_size1 = 32 #
阅读全文
摘要:#include <QTcpSocket> #include <QDataStream> #include <QByteArray> void sendObjectList(QTcpSocket *socket, const QList<QObject *> &objectList) { QByte
阅读全文
摘要:python socket服务端 import socket # 创建 socket 对象 server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 绑定 IP 地址和端口号 server_socket.bind(('12
阅读全文
摘要:#include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace cv; int main(int argc, cha
阅读全文
摘要:#include <QTcpSocket> #include <QDataStream> #include <QByteArray> void receiveObjects(QTcpSocket *socket) { QByteArray serializedData; QDataStream in
阅读全文
摘要:QMap深度拷贝 #include <QMap> #include <QPair> #include <QDebug> QMap<int, QString> deepCopyQMap(const QMap<int, QString>& source) { QMap<int, QString> tar
阅读全文
摘要:using System.Collections; using System.Collections.Generic; using UnityEngine; public class VCCameraWorkerController : MonoBehaviour { public Vector3
阅读全文
摘要:osg设置节点材质 #include <osg/Geode> #include <osg/Material> #include <osgDB/ReadFile> int main() { // 创建一个 Geode 对象 osg::ref_ptr<osg::Geode> geode = new os
阅读全文
摘要:#include <QMap>#include <QString>#include <iostream>int main() { QMap<QString, int> map; map["apple"] = 1; map["banana"] = 2; map["orange"] = 3; QStri
阅读全文
摘要:QCheckBox* indexCheckBox = new QCheckBox(); connect(indexCheckbox,SIGNAL(stateChanged(int)),this,SLOT(slotStateChangedAction(int))); void slotStateCha
阅读全文
摘要:wx.request({ url: 'https://example.com/api/data', // 替换为你的目标URL method: 'POST', data: { key1: 'value1', // 提交的数据 key2: 'value2' }, success(res) { cons
阅读全文
摘要:Qt随机生成颜色 QColor #include <QColor> #include <QRandomGenerator> // 创建一个随机颜色 QColor randomColor() { QRandomGenerator generator; int r = generator.bounded
阅读全文
摘要:在三维空间中,给定x轴和z轴的方向,我们可以使用叉乘(Cross Product)来计算y轴的方向。叉乘是向量的运算,表示两个向量垂直的关系。假设有两个向量v1和v2,叉乘的结果是一个向量v3,这个向量v3垂直于v1和v2。以下是一个简单的Java方法,用于根据x轴和z轴的方向计算y轴的方向: pu
阅读全文
摘要:#include <osg/Geode> #include <osgText/Text3D> int main() { // 创建场景图 osg::ref_ptr<osg::Group> root = new osg::Group(); osg::ref_ptr<osg::Geode> geode
阅读全文
摘要:#include <osg/Node> #include <osgViewer/Viewer> #include <osgDB/ReadFile> #include <osg/ShapeDrawable> int main() { // 创建Box对象 osg::ref_ptr<osg::Box>
阅读全文