上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 18 下一页
摘要: 1、读取图像基本信息:长、宽、通道数、灰度最大值、最小值、均值、方差值和灰度直方图 #include<opencv2/opencv.hpp> using namespace cv; using namespace std; int main(int argc, char** argv) { // 读 阅读全文
posted @ 2023-09-04 11:32 阿坦 阅读(1064) 评论(0) 推荐(0)
摘要: 安装完CUDA后,系统变量会自动增加CUDA_PATH CUDA的使用 1、打开VS,新建C++空项目 2、右击源文件->添加->新建项,选择CUDA C/C++ File,名称为main.cu 3、把下面的示例源码复制到main.cu中 #include "cuda_runtime.h" #inc 阅读全文
posted @ 2023-08-28 13:48 阿坦 阅读(1269) 评论(0) 推荐(0)
摘要: 一维傅里叶功率谱的计算 #include <stdio.h> #include <math.h> #define pi 3.1415926 #define rows 3 #define colums 5 typedef struct { float re;// really float im;// 阅读全文
posted @ 2023-07-12 10:34 阿坦 阅读(310) 评论(0) 推荐(0)
摘要: CUDA中threadldx、blockldx、blockDim和gridDim的全程 threadIdx是thread index 线程索引缩写 blockIdx是block index 块索引缩写 blockDim是block dimension 块维度缩写 gridDim是grid dimen 阅读全文
posted @ 2023-07-10 09:28 阿坦 阅读(76) 评论(0) 推荐(0)
摘要: 有三种方向可提高C++运行速度:语言、算法和硬件 1、语言方向:函数调用使用指针传递代替向量拷贝(节约数据拷贝时间) 皮尔逊相关系数函数调用指针传递版如下 #include <iostream> #include <iomanip> #include <vector> #include <cmath 阅读全文
posted @ 2023-07-03 10:40 阿坦 阅读(300) 评论(0) 推荐(0)
摘要: 相关系数(皮尔逊相关系数)公式如下 相关系数代码如下 #include <iostream> #include <vector> #include <cmath> using namespace std; // 计算平均值 double mean(vector<double> v) { double 阅读全文
posted @ 2023-06-28 16:05 阿坦 阅读(348) 评论(0) 推荐(0)
摘要: 一:单片机的BootLoader Bootloader部分移植ST官网的例程,官网例程的IAP有多个文件,为了移植方便我把多个文件合成了一个ymodem.c文件和ymodem.h文件 /* * ymodem.c * * Created on: Jun 6, 2023 * Author: MingYi 阅读全文
posted @ 2023-06-07 10:52 阿坦 阅读(2584) 评论(2) 推荐(0)
摘要: __HAL_UART_FLUSH_DRREGISTER(&huart1);//清空串口数据寄存器 __set_FAULTMASK(1);//关闭总中断 NVIC_SystemReset();//请求单片机重启 阅读全文
posted @ 2023-06-05 15:17 阿坦 阅读(160) 评论(0) 推荐(0)
摘要: #include <iostream> #include <windows.h> #include <thread> class SerialPort { public: //构造函数,打开串口并设置参数 SerialPort(const char* portName) { std::string 阅读全文
posted @ 2023-06-01 11:40 阿坦 阅读(62) 评论(0) 推荐(0)
摘要: C++代码傅里叶变换如下 #include <stdio.h> #include <math.h> #define pi 3.1415926 #define rows 3 #define colums 5 typedef struct { float re;// really float im;// 阅读全文
posted @ 2023-05-18 14:07 阿坦 阅读(79) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 18 下一页