C++
edgelee
这个作者很懒,什么都没留下…
展开
-
OpenCV Tutorials Optical Flow
GoalIn this chapter,We will understand the concepts of optical flow and its estimation using Lucas-Kanade method. We will use functions likecv.calcOpticalFlowPyrLK()to track feature points in a...转载 2020-01-11 14:44:08 · 532 阅读 · 0 评论 -
Learn OpenCV Video Stabilization Using Point Feature Matching in OpenCV
In this post, we will learn how to implement a simple Video Stabilizer using a technique called Point Feature Matching in OpenCV library.We will discuss the algorithm and share the code(in python) to...转载 2019-12-31 23:38:38 · 1374 阅读 · 0 评论 -
Learn OpenCV Deep Learning based Text Recognition (OCR) using Tesseract and OpenCV
In today’s post, we will learn how to recognize text in images using an open source tool calledTesseractand OpenCV. The method of extracting text from images is also called Optical Character Recogni...转载 2019-12-31 18:40:59 · 682 阅读 · 0 评论 -
Learn OpenCV Deep Learning based Text Detection Using OpenCV (C++/Python)
There is a common saying,“A picture is worth a thousand words“. In this post, we are going to take that literally and try to find the words in a picture! In an earlier post aboutText Recognition, we...转载 2019-12-31 17:26:58 · 346 阅读 · 0 评论 -
Windows Using Condition Variables
The following code implements a producer/consumer queue. The queue is represented as a bounded circular buffer, and is protected by a critical section. The code uses two condition variables: one used ...转载 2019-12-26 22:11:18 · 209 阅读 · 0 评论 -
Windows Using Critical Section Objects
The following example shows how a thread initializes, enters, and releases acritical section. It uses theInitializeCriticalSectionAndSpinCount,EnterCriticalSection,LeaveCriticalSection, andDelete...转载 2019-12-26 20:51:58 · 132 阅读 · 0 评论 -
Windows Using Mutex Objects
You can use amutex objectto protect a shared resource from simultaneous access by multiple threads or processes. Each thread must wait for ownership of the mutex before it can execute the code that ...转载 2019-12-26 20:41:02 · 137 阅读 · 0 评论 -
Windows Using Semaphore Objects
The following example uses asemaphore objectto limit the number of threads that can perform a particular task. First, it uses theCreateSemaphorefunction to create the semaphore and to specify init...转载 2019-12-26 20:29:02 · 159 阅读 · 0 评论 -
Windows Waiting for Multiple Objects
The following example uses theCreateEventfunction to create two event objects and theCreateThreadfunction to create a thread. It then uses theWaitForMultipleObjectsfunction to wait for the threa...转载 2019-12-26 20:26:59 · 193 阅读 · 0 评论 -
Windows CreateThread function
Creates a thread to execute within the virtual address space of the calling process.To create a thread that runs in the virtual address space of another process, use theCreateRemoteThreadfunction....转载 2019-12-26 20:21:51 · 284 阅读 · 0 评论 -
Windows Creating Threads
TheCreateThreadfunction creates a new thread for a process. The creating thread must specify the starting address of the code that the new thread is to execute. Typically, the starting address is th...转载 2019-12-26 20:07:08 · 269 阅读 · 0 评论 -
C++编译期多态与运行期多态
阅读目录前言运行期多态编译期多态运行期多态与编译期多态优缺点分析运行期多态优点运行期多态缺点编译期多态缺点关于显式接口与隐式接口 正文回到顶部前言今日的C++不再是个单纯的“带类的C”语言,它已经发展成为一个多种次语言所组成的语言集合,其中泛型编程与基于它的STL是C++发展中最为出彩的那部分。在面向对象C++编程中,多态是OO三大特性之一,这种多态称为运行期多态,也称为动态多态;在泛型编程中,多...转载 2018-02-27 17:20:16 · 216 阅读 · 0 评论 -
串口之COMMTIMEOUTS结构体详解
COMMTIMEOUTS主要用于串口超时参数设置。COMMTIMEOUTS结构如下: typedef struct _COMMTIMEOUTS { DWORD ReadIntervalTimeout; DWORD ReadTotalTimeoutMultiplier; DWORD ReadTotalTimeoutConstant; DWORD WriteTotalTimeo转载 2018-01-11 17:06:51 · 892 阅读 · 0 评论 -
fstream获得文件大小
ifstream fsRead; fsRead.open(srcFilePath.c_str(), ios::in|ios::binary); if (!fsRead) { sec_error("Uncompress processing: can not open source file! [%s]",src_file_name); return转载 2017-12-27 13:20:43 · 7816 阅读 · 0 评论 -
c++获取屏幕大小
//以下两个函数获取的是显示屏幕的大小,不包括任务栏等区域 int screenwidth=GetSystemMetrics(SM_CXFULLSCREEN); int screenheight=GetSystemMetrics(SM_CYFULLSCREEN); //以下两个函数获取的是真正屏幕的大小,即实际的大小 int screenwidth_real=GetSystemMetric转载 2017-11-06 16:17:01 · 3005 阅读 · 1 评论 -
C++继承中关于子类构造函数
转载于:http://www.cnblogs.com/kaige/p/cplusplus_virtual_inheritance_derived_class_constructor.html构造方法用来初始化类的对象,与父类的其它成员不同,它不能被子类继承(子类可以继承父类所有的成员变量和成员方法,但不继承父类的构造方法)。因此,在创建子类对象时,为了初始化从父类继承来的数据成员,系统需要调用转载 2017-11-07 16:48:27 · 2204 阅读 · 0 评论 -
fstream读到文件尾,如何返回文件头
C++ I/O系统管理两个与一个文件相联系的指针。一个是读指针,它说明输入操作在文件中的位置;另一个是写指针,它下次写操作的位置。每次执行输入或输出时,相应的指针自动变化。所以,C++的文件定位分为读位置和写位置的定位,对应的成员函数是 seekg()和 seekp(),seekg()是设置读位置,seekp是设置写位置。它们最通用的形式如下: istream &seekg(stre转载 2017-10-10 15:43:11 · 5811 阅读 · 0 评论 -
C++二维动态数组的创建与删除
C++中用new动态创建二维数组的格式一般是这样:TYPE (*p)[N] = new TYPE [][N];其中,TYPE是某种类型,N是二维数组的列数。采用这种格式,列数必须指出,而行数无需指定。在这里,p的类型是TYPE*[N],即是指向一个有N列元素数组的指针。还有一种方法,可以不指定数组的列数:int **p;p = newint*[10]; /转载 2016-12-27 14:44:18 · 946 阅读 · 1 评论 -
ubuntu下使用Eclipse搭建C++开发环境
ubuntu下使用Eclipse下搭建开发环境基本上网上教程一大堆,但是复杂度太大,因为很多教程都是从JDK开始安装一直到最后,而且很多都是从别的linux发行版上弄来的方法,各种编译直接吓死人有木有,其实ubuntu的方便之处很大程度上在于atp的使用,抹杀了atp的ubuntu那就太鸡肋了。 OK,正题,再ubuntu下搭建Eclipse C++开发环境。转载 2017-01-05 13:32:10 · 9576 阅读 · 0 评论 -
C++ 双线程通信(通过event实现)
#include "stdafx.h"#include "afxmt.h"#include#include #includeusing namespace std;#define MT_INTERVAL 500CEvent event;//定义一个通信介质,通过event实现两个线程的通信unsigned int __stdcall Thread1(LPVO转载 2016-12-21 12:45:41 · 1009 阅读 · 0 评论 -
高并发网络编程之epoll详解
在linux 没有实现epoll事件驱动机制之前,我们一般选择用select或者poll等IO多路复用的方法来实现并发服务程序。在大数据、高并发、集群等一些名词唱得火热之年代,select和poll的用武之地越来越有限,风头已经被epoll占尽。本文便来介绍epoll的实现机制,并附带讲解一下select和poll。通过对比其不同的实现机制,真正理解为何epoll能实现高并发。select转载 2016-12-30 13:50:40 · 278 阅读 · 0 评论 -
Ubuntu Eclipse进行C/C++开发
如果楼主要用Eclipse进行C/C++开发,向楼主提供一个方法:第一步,卸载当前的Eclipse,一种方法是:apt-get remove eclipse第二步,去Eclipse官网下载最新的专门版本,32位版本的下载页面是:http://www.eclipse.org/downloads/download.php?file=/technology/epp转载 2017-01-10 14:17:39 · 2556 阅读 · 0 评论 -
C++中的线程函数如何访问类中的成员变量
1. C++ 中如何定义线程函数 有两种方法:a. 定义线程函数为全局函数 b. 定义线程函数为类的静态成员函数2. C++中的线程函数如何访问类中的成员变量 针对线程函数为类的静态成员进行说明。如果是静态数据成员,当然可以直接访问,但是如果要访问非静态数据成员,直接访问是做不到的。如果要想在线程函数中访问和操作类的非静态成员变量,可以把线程函数作为一个适配器,在适转载 2017-01-10 15:39:37 · 4039 阅读 · 0 评论 -
编写Makefile(简要介绍)
相信很多朋友都有过这样的经历,看着开源项目中好几页的makefile文件,不知所云。在日常学习和工作中,也有意无意的去回避makefile,能改就不写,能用ide就用ide。其实makefile并没有想象的那么难写,只要你明白了其中的原理,自己实践几次。你也可以自己写makefile,让别人对你头来羡慕的目光。 下面本人介绍一下自己的学习成果,初学阶段,欢迎大家多多指正。 简单的说,m转载 2017-01-16 14:41:53 · 230 阅读 · 0 评论 -
Socket UDP疑惑梳理
1 UDP的传输方式:面向报文面向报文的传输方式决定了UDP的数据发送方式是一份一份的,也就是应用层交给UDP多长的报文,UDP就照样发送,即一次发送一个报文。那么UDP的报文大小由哪些影响因素呢?UDP数据包的理论长度是多少,合适的UDP数据包应该是多少呢?(1)UDP报文大小的影响因素,主要有以下3个[1] UDP协议本身,UDP协议中有16位的UDP报文长度,那么UDP报文长度不转载 2017-01-12 14:17:43 · 2069 阅读 · 0 评论 -
32位64位操作系统基本数据类型字节大小
int型字长问题:① C/C++规定int字长和机器字长相同;② 操作系统字长和机器字长未必一致;③ 编译器根据操作系统字长来定义int字长; 由上面三点可知,在一些没有操作系统的嵌入式计算机系统上,int的长度与处理器字长一致;有操作系统时,操作系统的字长与处理器的字长不一定一致,此时编译器根据操作系统的字长来定义int字长:"比如你在64位机器上运行DOS16系统转载 2017-01-17 16:45:21 · 421 阅读 · 0 评论 -
变量的声明与定义以及关键字extern的用法
变量的声明与定义:A of a variable allocatesstorage for the variable and may also specify an initial value for the variable.There must be one and only one definition of a variable in a program.A declarati转载 2017-03-09 17:31:51 · 467 阅读 · 0 评论 -
虚函数,多态性,回调函数 简述
0. object based, object oriented. 都是用对象机制对数据进行封装,提高代码复用率,缩知问题空间与解空间之间的距离。1. 基于对象编程语言 (Object_based program); VC++;只是简单的数据封装,合成, 而没有面向对象那种继承导致的类层次结构,也就不能体现多态性。1.1 多态性从语法角度上讲就是通过基类的指针、引用、句柄来操纵大量派生转载 2017-03-13 14:27:50 · 1465 阅读 · 0 评论 -
在VC/MFC中响应键盘按键
首先,简介一下键盘消息:(1)系统消息:(系统键Alt,F10等),由系统内部处理WM_SYSKEYDOWNWM_SYSKEYUPWM_SYSCHAR(2)非系统消息:WM_KEYDOWNWM_KEYUPWM_CHAR二、添加消息(一般WM_KEYDOWN),在消息响应函数OnKeyDown(UINT nChar, UINT nRepCnt, UINT nF转载 2017-04-26 13:30:25 · 2188 阅读 · 0 评论 -
C/C++读写csv文件
#include #include #include #include #include using namespace std;int main(){ // 写文件 ofstream outFile; outFile.open("data.csv", ios::out); // 打开模式可省略 outFile << "name" << ',' << "age" <<转载 2017-10-08 16:32:10 · 769 阅读 · 0 评论 -
C++读写二进制文件
摘要:使用C++操作文件,是研发过程中比较频繁的,因此进行必要的总结和封装还是十分有用的。今天在网上找到一篇,遂进行了部分的试验,以记之,备后用。 本文读写文件均使用文件流进行操作,主要使用的类是ifstream, ofstream, 使用时,请务必包含文件fstream。如下:#include 写二进制文件写二进制文件应该使用ofstream类,文件的转载 2016-12-23 14:55:06 · 549 阅读 · 0 评论