
C++
highoooo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C/C++ (public、private、protected)
(public、private、protected)原创 2022-11-29 11:47:41 · 608 阅读 · 0 评论 -
C/C++ 虚函数
virtual原创 2022-11-29 09:59:44 · 121 阅读 · 0 评论 -
YOLOV4-tiny WIN10 部署
# YOLOV4-tiny WIN10 部署原创 2022-11-09 17:54:26 · 1104 阅读 · 0 评论 -
WIN10 VS2019 yaml
yaml原创 2022-09-23 13:25:06 · 921 阅读 · 0 评论 -
部署记录 win10 trt yolov4-tiny
v4-tiny win部署原创 2022-09-22 14:26:31 · 1153 阅读 · 0 评论 -
C/C++ 从多重路径获取img名字
C/C++从多重路径获取img名字。原创 2022-07-22 10:45:52 · 358 阅读 · 0 评论 -
tensorrt 打印网络shape
tensorrt原创 2022-07-12 17:03:23 · 686 阅读 · 0 评论 -
TensorRTX 生成Engine笔记 Alexnet
tensorrtx-alexnet原创 2022-06-22 11:15:57 · 993 阅读 · 0 评论 -
C/C++ MMOCR C调用python简单部署
C原创 2022-06-07 09:17:56 · 353 阅读 · 0 评论 -
C/C++ 地址作为参数在函数内malloc后返回没有成功修改值
必须要在外面malloc原创 2022-06-01 14:52:18 · 161 阅读 · 0 评论 -
TX2 读取海康/大恒工业摄像头 显示/保存
1 MVS下载或SDK下载在海康机器人官网,服务支持-软件下载中间中,下载相应的客户端安装包。2 放到TX2目录下解压并安装sudo tar –xvf MVS-2.1.1_aarch64_20220511.tarsudo ./setup.sh3.c/c++ 库文件和头文件都在opt/MVS/下4.samples里面可以直接make就可以玩了5.读取工业摄像头并用转为cv::Mat用yolov5-trt推理5.1 cmakelistscmake_minimum_required(VER原创 2022-05-30 09:16:21 · 1611 阅读 · 4 评论 -
C/C++ 自定义sort方法
转#include<iostream>#include<algorithm>#include<vector>#include<opencv2\opencv.hpp>using namespace std;using namespace cv;vector<cv::Point2d> po; //自定义排序函数 bool sortFun(const cv::Point2d &p1, const cv::Point2d &a原创 2022-05-24 13:31:51 · 423 阅读 · 1 评论 -
C/C++ YAML玩法
配置文件width : 640height : 360framerate : 25.0faces_active: [5,6,7,1] cameras_active: [1,2,3] channels: - rtsp: rtsp://admin:[email protected]:554/Streaming/Channels/102 chn: 1 - rtsp: rtsp://admin:[email protected]:554/Streaming/Ch原创 2022-04-26 15:10:02 · 678 阅读 · 0 评论 -
C/C++ std::mem_fn
#include <functional>#include <iostream> struct Foo { void display_greeting() { std::cout << "Hello, world.\n"; } void display_number(int i) { std::cout << "number: " << i << '\n'; }转载 2022-04-25 09:54:57 · 164 阅读 · 0 评论 -
C/C++ 数组作为参数并改值
inference(hasface,lastface_pts,lastPts,img);void inference(bool hasface[],int64_t lastface_pts[], int64_t lastPts,cv::Mat img) inference(&hasface,&lastface_pts,lastPts,img);void inference(bool &hasface[0],int64_t &lastface_pts[0], int64_原创 2022-04-22 14:26:36 · 3853 阅读 · 0 评论 -
C/C++ linux 时间戳
struct timeval pts;gettimeofday(&pts,NULL);int64_t ptsTime = (int64_t)pts.tv_sec * 1000 + (int64_t)pts.tv_usec / 1000;原创 2022-04-22 09:14:39 · 1902 阅读 · 0 评论 -
C/C++ std::string
替换replace(str.begin(),str.end(),'/',' ');查找std::string a = "1234456";std::cout<<a.find("12345")<<std::endl;std::cout<<a.find("4")<<std::endl;原创 2022-04-12 09:56:24 · 973 阅读 · 0 评论 -
C/C++ YAML配置文件读取
不能嵌套结构体 mmp会报错typedef struct _VideoWrapper{public: std::string video; //mp4 bool active; int chn; std::vector<int> times; std::vector<cv::Rect> rois;}VideoWrapper;typedef struct _VideoStaticWrapper{ char filetype[.原创 2021-11-30 14:53:49 · 1239 阅读 · 0 评论 -
C/C++ 安全队列封装 conqueue.h
#ifndef __CONCURRENCEQUEUE_H__#define __CONCURRENCEQUEUE_H__#include <mutex>#include <condition_variable>#include <deque>#include <queue>#include <memory>template<typename DATATYPE, typename SEQUENCE = std::deque<原创 2022-03-29 13:21:13 · 913 阅读 · 0 评论 -
C/C++ 图片拼接
// TODO 1 merge frame(background)/face(tmp_ptr->frame) into one image cv::Mat background; cap.read(background); cv::Mat dst(720,1280,CV_8UC3); cv::Rect rect_face(0,0,640,720); cv::resize(tmp_pt原创 2022-03-29 10:30:36 · 5733 阅读 · 0 评论 -
C/C++ new,malloc
#include <thread>#include <vector>#include <iostream>#include <stdio.h>#include <unistd.h>#include <thread>#include <list>using namespace std;class cla{public: int h; cla();};cla::cla(){ h=1原创 2022-03-25 14:59:55 · 1319 阅读 · 0 评论 -
pytorch转TensorRT 模型转换 (以retinaface为例)
Trail 1 :.pth->.wts->.engine1.1 pth文件转为key value的字典文件便于c++解析 (.pth->.wts)def main(): print('cuda device count: ', torch.cuda.device_count()) device = 'cuda:0' net = torch.load('retinaface.pth') net = net.to(device) net.eval()原创 2022-03-07 15:51:40 · 1867 阅读 · 0 评论 -
基于c++的人脸检测识别NVIDIA边缘设备部署
基于c++的人脸检测识别NVIDIA边缘设备部署效果展示:1.检测识别模型retinaface+arcface(mobilenet)2.部署(以下步骤直接参考readme)https://github.com/axxx-xxxa/Insightface-arcface-retinaface2.1 模型转换2.2 tensorrt推理2.3 集成两个模型到主函数2.4 opencv抓流送入推理2.5 显示+保存...原创 2022-03-01 09:01:45 · 2740 阅读 · 0 评论 -
C/C++ TensorRT引擎多线程推理多个rtsp流并显示或保存
文章目录主要思路一、超参数和常量二、简易的WrapData类三、opencv获取rtsp流四、.engine 推理部分五、主函数流程主要思路每个thread负责一个rtsp流,主线程里定义WrapData类型的消息队列(目的是包含frame和对应的rtsp信息),传到每个线程里面去通过opencv获取frame,将frame和rtsp信息包装到WrapData后push到队列中,主函数中捕捉到队列长度大于1则进行.front()推理并在推理结束后.pop()一、超参数和常量#define NMS_原创 2021-11-24 09:21:13 · 5191 阅读 · 20 评论 -
c++ 笔记
1.std::cout/cerrcerr只在终端输出 cout会在log输出2.char** argv二级指针 [1,2,3,4] argv存放首个地址3.fstream/ofstream/ifstream如果想以输入方式(只写)打开,就用ifstream来定义;如果想以输出方式(只读)打开,就用ofstream来定义;如果想以输入/输出方式来打开,就用fstream来定义。4.seekg/ tellg/ ios.end/ ios.begfile.seekg(0,file.end);si原创 2021-11-18 14:15:53 · 612 阅读 · 0 评论 -
Yolov5 TensorRT .engine文件的生成和推理过程,以及如何从GPU中得到图片进行自定义(根据任务需求的)后处理
文章目录一、create a model using the API directly and serialize it to a stream二、deserialize the .engine and data prepare三、run inference四、get image一、create a model using the API directly and serialize it to a stream//如果不存在wts_name //create a model using the原创 2021-11-18 11:33:06 · 3489 阅读 · 0 评论 -
yolov5-deepstream
一、pytorch模型转为tensorrt模型1.yololayer.h中修改class_num2.Cmakelist中修改cuda路径3.build中编译生成yolov5文件4.sudo ./yolov5 -s [.wts] [.engine] [s/m/l/x/s6/m6/l6/x6 or c/c6 gd gw] // serialize model to plan file 生成.engine文件5.sudo ./yolov5 -d yolov5.engine …/samples 确定原创 2021-11-09 17:21:38 · 3292 阅读 · 0 评论 -
c++ onnx running
#include <opencv2/dnn.hpp>#include <opencv2/imgproc.hpp>#include <opencv2/highgui.hpp>using namespace cv;using namespace cv::dnn;#include <fstream>#include <iostream>#include <cstdlib>using namespace std;int m原创 2021-09-13 11:28:19 · 298 阅读 · 0 评论 -
左移右移运算符<< >>
左移 << 左移一位扩大两倍右移 >> 右移一位缩小两倍原创 2021-08-20 08:46:37 · 147 阅读 · 0 评论 -
c++ new
new其实就是告诉计算机开辟一段新的空间,但是和一般的声明不同的是,new开辟的空间在堆上,而一般声明的变量存放在栈上。通常来说,当在局部函数中new出一段新的空间,该段空间在局部函数调用结束后仍然能够使用,可以用来向主函数传递参数。另外需要注意的是,new的使用格式,new出来的是一段空间的首地址...原创 2021-08-19 14:37:20 · 87 阅读 · 0 评论 -
CMakeLists
cmake_minimum_required(VERSION 3.0)项目名称project(boltDetect)c++11标准set(CMAKE_CXX_FLAGS “–std=c++11”)opencv库find_package(OpenCV)include_directories(${OpenCV_INCLUDE_DIRS})python库include_directories(/usr/inlcude/python3.8)link_directories(usr/lib/x86原创 2021-08-19 11:03:54 · 143 阅读 · 0 评论 -
static and dynamic linking
静态链接 :c++/general: addtional include directory (附加包含目录):添加include路径 (.h头文件)linker/input: addtional dependencies(附加依赖):添加lib(静态库 *.lib) 动态链接:linker/input: addtional dependencies(附加依赖):添加lib(动态库 *dll.lib) 编译后将 *.dll放在与exe同目录下多项目建立静态链接右键main项目,添加(add原创 2021-08-18 18:18:23 · 132 阅读 · 0 评论 -
lib\dll
*.lib 静态链接库 较大,无需链接dll.lib+.dll 动态链接库 较小,需要链接include -> addtional include_ -> .h文件library -> addtional library_ -> 链接库lib文件原创 2021-08-18 17:20:25 · 81 阅读 · 0 评论 -
c++:opencv
配置环境变量计算机——右键——属性——高级系统设置——高级(标签)——环境变量——系统变量栏里双击path——新建——添加路径工程包含目录配置打开VS软件,新建一个项目,建立一个windows控制台应用程序。在建完程序之后,在菜单栏里找视图——其他窗口——属性管理器,点击后窗口会发生变化,如下显示在Debug|x64里右键Microsoft.Cpp.x64.user或者在Debug|Win32里右键Microsoft.Cpp.Win32.user注意:选择哪个和你想配的的编译环境有关,64位原创 2021-08-16 08:52:07 · 392 阅读 · 0 评论 -
C++编译
编译:.cpp(源文件) -> .i(预处理/将所有include paste到源文件中) {-> .asm(转为可读的汇编语言)} -> .obj(转为十六进制汇编语言)链接:将所有的obj联通 -> .exe通过cmakelist.txt来描述整个编译过程example:project(main)add_excutable(main main.cpp)project(main)include_directories(include)file(GLOB_SOU原创 2021-08-14 17:33:56 · 116 阅读 · 0 评论