- 博客(125)
- 资源 (7)
- 收藏
- 关注
转载 RTCM—CRC校验
1、RTCM—CRC校验RTK信息:例子:D3 00 13 3E D0 00 03 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 6D B8 8ED3:引导字00 13:计算消息长度:196D B8 8E:CRC校验int table[]={0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17,0xA1813...
2020-06-05 21:56:36
1558
原创 websocket 测试
#include <boost/algorithm/string.hpp>#include <string>#include <vector>#include <list>#include <iostream>#include <websocketpp/config/asio_no_tls.hpp>#include <websocketpp/server.hpp>//名称与值数据对struct Nam.
2020-05-28 13:45:17
526
转载 美敦力“开源”设计图和源代码
在全球战疫中,呼吸机在康复治疗中起着关键作用。如果没有呼吸机的支持,一些患有严重新冠肺炎的患者可能无法幸存。现在,尽管全球呼吸机企业在加班加点生产,但呼吸机产量仍供不应求。呼吸机告急,给全球抗疫带来巨大挑战。近日,医疗科技巨头美敦力(Medtronic)在其网站上向全球共享了旗下呼吸机Puritan Bennett™ 560的知识产权:包括设计原理图、生产规范、说明书、软件代码等,允许创新...
2020-04-14 12:34:46
616
原创 libyuv对YUV数据处理
#include <libyuv.h>// nv21 --> i420void nv21ToI420(unsigned char* src_nv21_data, int width, int height, unsigned char* src_i420_data){ int src_y_size = width * height; int src_u_size...
2020-04-01 22:36:43
1279
原创 libconfig
#include <libconfig.h++>#include <iostream>using namespace std;void write_test(){ libconfig::Config cfg; //1.声明 Config对象 auto& root = cfg.getRoot(); root.add("name", lib...
2019-11-02 22:49:42
270
原创 curl 获取ip
#include <iconv.h>#include <curl/curl.h>#include <nlohmann/json.hpp>#define GLOG_NO_ABBREVIATED_SEVERITIES#include <glog/logging.h>using namespace std;int char_code_co...
2019-09-11 14:43:54
984
1
原创 C++ static的用法有哪些?
static的用法有哪些?(1)修饰局部变量。局部变量的生存期为声明之后,直至当前代码块结束。若使用static声明,该变量将变为静态持续性,存放在静态存储区,存在于整个程序运行周期。同时保证每个进入该代码块,变量保持上一次退出时的值。(2)修饰全局变量。会改变全局变量的链接性,使用static修饰后,全局变量由外部链接性变为内存链接性,这样其他源文件不能使用extern变量使用该变量,该...
2019-08-23 16:02:28
147
原创 boost asio high_resolution_timer 的正确用法
#include <iostream> #include <boost/asio.hpp>#include <boost/thread.hpp>#include <boost/date_time/posix_time/posix_time.hpp>using namespace std;#define NOW_TICKS_US ch...
2019-07-18 00:20:38
987
原创 std::bind 用法
#include <string>#include <functional>#include <iostream>using namespace std;class Worker{public: static Worker* Get() { static Worker ff; return &ff; } string P...
2019-06-25 20:40:27
371
1
原创 opencv 图像编码
#include "utils/FileOps.h"#include "opencv2/opencv.hpp"using namespace std;int main(){ cv::Mat src = cv::imread("00BB.JPG"); printf("src.cols=%d rows=%d\n", src.cols, src.rows); std::string i...
2019-04-29 20:34:19
1277
原创 opencv 透视变换
cv::Point2f src_pts[4]; src_pts[0] = coners[0]; src_pts[1] = coners[1]; src_pts[2] = coners[2]; src_pts[3] = coners[3]; cv::Mat _dst(60, 180, CV_8UC1);...
2019-04-25 16:23:36
207
原创 C++ STL 实现全排列与组合
#include <algorithm>#include <string>#include <vector>using namespace std;template <typename T>void combine_inner(T &data, int start, int n, int m, int depth, T...
2019-04-25 15:53:16
1231
原创 跨平台的计时函数 支持win/linux
源文件#if defined(WIN32) || defined(_WIN32) // Windows system specific#include <windows.h>#else // Unix based system specific#include <sys/time.h>#endif__int64 getCount()...
2019-03-22 14:38:41
219
原创 c++ windows api 获取文件版本号
#include <string>#include <windows.h>#pragma comment(lib,"version.lib")bool QueryValue(const std::string& ValueName, const std::string& szModuleName, std::str...
2019-03-13 10:31:26
2619
原创 c++ windows 生成 guid
std::string getNewGuid(){ GUID guid; ::CoCreateGuid(&guid); const int len = 36; char dst[len]; memset(dst, 0, len); snprintf(dst, len, "%08x%04x%04x%02x%02x%02x%...
2019-03-12 18:05:18
1456
原创 C++用宏定义实现PROPERTY
#define PROPERTY_RW(T,var) public: \void set_##var(const T& _var){m_##var=_var;}\T get_##var(){return m_##var;}\private: T m_##var;class Test{public: Test(); ~Test(); PROPERTY_RW(int, ...
2019-03-08 00:09:32
428
转载 dll parser
#pragma once#ifndef _DLL_PARSER_H_#define _DLL_PARSER_H_#include <string>#include <map>#include <functional>#include <Windows.h>class DLLParser{public: DLLParse...
2018-12-31 23:27:39
277
原创 C++简单配置文件程序(基于rapidjson)
#include <string>#include <map>#include <algorithm>#ifdef _WIN32#pragma warning(disable:4996)#include <windows.h>#include <io.h>#include <shlwapi.h>#pragm...
2018-12-29 15:24:45
666
转载 rapidjosn 使用
std::string output; readFileContent("dotline.coh", output); printf("%d\n", output.size()); Document doc; doc.Parse(output.c_str()); bool IsObject=doc.IsObject(); auto ...
2018-12-20 11:00:08
352
原创 base64编解码
#include <string>void base64Decode(const std::string &input, std::string &output){ //解码表 const char DecodeTable[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
2018-12-18 16:41:47
327
原创 STL容器和shared_ptr的正确用法
#include <string>#include <vector>#include <memory>#include <map>template <class T>using SPVEC = std::vector<std::shared_ptr<T>>;template <cla
2018-12-16 23:43:00
5212
原创 SHA-256算法
#include <iostream> #include <string>#ifndef SUCCESS#define SUCCESS 0#endif // SUCCESS#ifndef FAIL#define FAIL 0#endif // FAIL#define SHA256_ROTL(a,b) (((a>>(32-b))&(0...
2018-12-16 23:15:15
765
原创 C++11 字符串与数字互转
#pragma once#ifndef _STRING_CONVERT#define _STRING_CONVERT#include <string>template<class T>std::string toString(const T &t){ std::stringstream os; os.precision(16);...
2018-11-22 11:31:43
466
原创 git的诞生
很多人都知道,Linus在1991年创建了开源的Linux,从此,Linux系统不断发展,已经成为最大的服务器系统软件了。Linus虽然创建了Linux,但Linux的壮大是靠全世界热心的志愿者参与的,这么多人在世界各地为Linux编写代码,那Linux的代码是如何管理的呢?事实是,在2002年以前,世界各地的志愿者把源代码文件通过diff的方式发给Linus,然后由Linus本人通过手工...
2018-11-13 15:24:06
104
原创 windows内存监控
#include <thread>#include <memory>#include <Windows.h>#include <Psapi.h>#pragma comment(lib , "psapi.lib")class MemoryWatcher {public: MemoryWatcher(); ~Memory...
2018-11-13 13:42:06
976
原创 windows平台下的高精度定时器
class CHTimerListener{public: virtual void Update() = 0;};class CHTimer{public: CHTimer(); ~CHTimer(); bool start(CHTimerListener *listener, uint32_t _delay); void stop(CHT...
2018-11-03 20:44:18
495
原创 图像处理经典算法及OpenCV程序
基于opencv的use摄像头视频采集程序... 1基于opencv的两个摄像头数据采集... 3能激发你用代码做视频的冲动程序... 6图像反转(就是把黑的变白,白的变黑)... 11图像格式的转换... 12从摄像头或者AVI文件中得到视频流,对视频流进行边缘检测... 13采用Canny算子进行边缘检测... 15角点检测... 18图像的旋转加缩放(效果很拽...
2018-10-15 15:16:39
5752
原创 vgg16介绍
预处理图片的预处理就是每一个像素减去了均值,算是比较简单的处理。卷积核整体使用的卷积核都比较小(3x3),3x3是可以表示「左右」、「上下」、「中心」这些模式的最小单元了。3 × 3 which is the smallest size to capture the notion of left/right, up/down, center还有比较特殊的1...
2018-10-15 15:15:29
47278
4
原创 STL容器的内存管理
class Unit{public: Unit(); Unit(int id); ~Unit();private: int id = -1;};Unit::Unit(){}Unit::Unit(int _id) :id(_id){ printf("Unit construction. id=%d\n", id);}Unit::~Unit(){ prin...
2018-10-07 17:12:20
385
原创 opencv初化化Mat的方法
cv::Mat out = cv::Mat(cv::Size(w, h), CV_8UC(chn), imgBuf);
2018-09-06 14:02:01
179
原创 STL 常用
void read_file(const std::string& path, std::string& out){ std::ifstream fs(path, std::ios_base::binary); fs.seekg(0, std::ios_base::end); auto size = fs.tellg(); fs.seekg(0);...
2018-07-14 21:22:05
268
原创 C++使用foreach any_of all_off none_of
#include <iostream>#include <algorithm>int main(){ int intArr[] = { 1, 2, 3, 4, 5 }; std::cout << "std::for_each ......" << std::endl; std::for_each(std::begin(...
2018-07-05 23:14:51
552
原创 C++ base64 opencv Mat 转换
static std::string base64Decode(const char* Data, int DataByte){ //解码表 const char DecodeTable[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
2018-06-27 16:31:40
5969
原创 linux 下 build opencv
apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev li...
2018-06-26 12:00:54
412
原创 linux 和 windows 下用ffmpeg 操作usb摄像头
windows :列设备 ffmpeg -list_devices true -f dshow -i dummy编码为H.264,保存为本地文件 ffmpeg -f dshow -i video="Integrated Camera" -vcodec libx264 mycamera.mkv播放 ffplay -f dshow -i video="Integrated Camera"linux...
2018-06-21 20:46:35
6957
3
原创 单例模式
class TestClass{public: TestClass(); ~TestClass(); static TestClass *get() { static TestClass ff; return &ff; } void print();private:};void TestClass::print() { printf("TestCla...
2018-06-19 15:55:18
169
原创 cmake中配置MFC
#set MFC#add definitionsif(CMAKE_HOST_WIN32) #ADD_DEFINITIONS(-D_AFXDLL)#如果使用动态库的MFC,则加上_AFXDLL SET(CMAKE_MFC_FLAG 1)endif(CMAKE_HOST_WIN32)ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)...
2018-05-24 13:10:02
1950
原创 std::string startwith endwith split 方法
bool endWith(std::string &str, std::string &tail) { return str.compare(str.size() - tail.size(), tail.size(), tail) == 0;}bool startWith(std::string &str, std::string &head) { ret...
2018-05-07 09:57:23
9719
原创 HObject cv::Mat 互相转换
void Mat2HObject(const Mat &image, HObject &outObj){ HObject Hobj = HObject(); int hgt = image.rows; int wid = image.cols; int i; // CV_8UC3 if (image.type() == CV_8U...
2018-05-02 18:57:50
1708
QAudioTest
2017-08-31
VC++6.0实用技巧汇总
2008-08-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人