C++
去你个锤子
Fear of death is what keeps us alive.
展开
-
指针数组、数组指针
数组原创 2022-06-15 17:31:12 · 147 阅读 · 0 评论 -
C++ 指针与智能指针
NULL,nullptr,0参考:c/c++中的NULL,nullptr,0__ 菜 -∞的博客-CSDN博客内容:1.释放内存表示指针指像的内存不被本程序占用,系统可以重新使用该内存。指针变量所指的地址事不变的,只是不被该程序使用。2.C语言中:#undef NULL #define NULL ((void *)0)//强制类型转换,(C中0表示的含义比较多)其中void*是无类型指针,其他任何指针都可以直接赋值给它。3.C++ 编译器:...原创 2022-05-23 09:26:11 · 627 阅读 · 0 评论 -
单目双目标定
本文用QT调用OpenCV4.5.1进行相机标定。头文件如下#include <QMainWindow>#include <opencv2/opencv.hpp>#include <iostream>#include <math.h>#include <fstream>#include <vector>using namespace cv;using namespace std;1.进行摄像机的读取,用O.原创 2021-03-15 12:21:17 · 621 阅读 · 0 评论 -
虚函数相关断点调试,并注释相关地址
#include <iostream>using namespace std;class cbase{public: virtual char * getname() = 0; //纯虚函数};class cbint :public cbase{public: char f[6]= "cbint"; //0x00a7d3e4 char * getname() { return f; }.原创 2021-02-01 11:30:25 · 210 阅读 · 0 评论 -
C++ 学习1
#ifndef __COMPLEX__#define __COMPLEX__class complex{public: complex(double r = 0, double i = 0)//构造函数必须和类同名complex, //()里是默认值 :re(r), im(i) //初值列,有则设置初值, { } complex& operator += (const complex&);//设置的函数能进行 +=。 //每个成员函数都隐藏一个参数:complex.原创 2020-11-05 16:08:36 · 91 阅读 · 0 评论 -
C++ 和QT遇到知识点
#一、原创 2020-10-28 16:34:44 · 199 阅读 · 0 评论 -
opencv读取多个视频获取当前帧数并阁帧数截图保存
#include <iostream>#include <opencv2/opencv.hpp>#include <opencv2/calib3d/calib3d.hpp>using namespace std;using namespace cv;char image_name[30];int i=1;int main(){ VideoCapture cap; //cap.open(0); //打开摄像头 cap.open("3.原创 2020-07-20 10:59:30 · 1092 阅读 · 0 评论 -
人脸特征点检测opencv+dlib+caffe移植到树莓派。
交叉编译opencv和dlib.注意dlib的lib路径最好在/usr/local不然会找不到。树莓派读取usb摄像头用cap(1),读取排线摄像头是cap(0),(我的排线摄像头用不了,出现错误:如下:)VIDIOC_DQBUF: Resource temporarily unavailableterminate called after throwing an instance o...原创 2020-04-17 10:08:54 · 498 阅读 · 0 评论 -
在嵌入式开发板上用caffe进行人脸识别
再Ubuntu上交叉编译opencv到嵌入式开发板。再用opencv调用caffe模型进行人脸识别并截图。#include <iostream> #include <cstdlib> #include <stdio.h>#include <opencv2/opencv.hpp>#include <opencv2/dnn.h...原创 2020-03-26 15:00:17 · 746 阅读 · 0 评论 -
Linux中断start.s编写
.global _start /* 全局标号 *//* * 描述: _start函数,首先是 中断向量表 的创建 * 参考文档:ARM Cortex-A(armV7)编程手册V4.0.pdf P42,3 ARM Processor Modes and Registers(ARM处理器模型和寄存器) * ARM Cortex-A(armV7)编程手册V4.0.pdf ...原创 2020-01-02 16:45:27 · 328 阅读 · 1 评论 -
opencv人脸识别截图,正点原子ov5640
#include <iostream>#include <opencv2/objdetect/objdetect.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>#include <fstream>#include ...原创 2019-12-27 16:12:41 · 1621 阅读 · 0 评论 -
人脸特征点检测
#include <dlib/opencv.h>#include <opencv2/highgui/highgui.hpp>#include <dlib/image_processing/frontal_face_detector.h>#include <dlib/image_processing/render_face_detections.h&...原创 2019-12-23 13:56:25 · 195 阅读 · 0 评论 -
STL 容器
1、STL(Standard Template Library),即标准模板库,是一个高效的C++程序库,包含了诸多常用的基本数据结构和基本算法。为广大C++程序员们提供了一个可扩展的应用框架,高度体现了软件的可复用性。2、从逻辑层次来看,在STL中体现了泛型化程序设计的思想(generic programming)。在这种思想里,大部分基本算法被抽象,被泛化,独立于与之对应的数据结构,...原创 2019-12-13 10:23:00 · 93 阅读 · 0 评论 -
C++的&与* istringstream sin(s) 函数模板和类
#include<iostream>#include<string>using namespace std;int main(){int a=5,b=10,c=15;int *p1; //int * 是定义p1为指针,int &d=b; //&引用d为b.p1=&a; ...原创 2019-12-12 14:58:36 · 595 阅读 · 0 评论 -
HOG算法
HOG:HOG算法的核心思想就是利用物体表面的光强或边缘方向的分布可以描述整个物体,利用HOG算法提取的特征实质就是图像的光强和边缘方向的分布。HOG算法的具体操作就是将图像分割成很多小的连接区域,在每个小的区域之中生产多个方向梯度直方图或像素点的边缘方向,图像所有的这些区域的方向梯度直方图或像素点边缘方向就构成了图像的描述子HOGDescriptor,这个描述子即可作为识别该图像物...原创 2019-11-02 17:23:44 · 2896 阅读 · 0 评论 -
C++ 3个整数从大到小输出, 指针变量
#include<iostream>using namespace std;int main(){ void exchange(int *q1,int *q2,int *q3); //声明函数 int a,b,c,*p1,*p2,*p3; //定义指针变量 cin>>a>>b>>c; ...原创 2019-08-12 15:07:13 · 943 阅读 · 0 评论 -
C++ 2.0 指针
&是取地址运算符,&1是变量i的地址。i_pointer= &i 地址称为2“指针”,通过它能访问以它为地址的内存单元,一个变量的地址称为该变量的指针。如果一个变量专门用来存放另一个变量的地址(即指针),则称它为指针变量。(用来存放地址的变量,叫指针变量)指针变量 的值是地址,即指针“*” 表示指向* i-pointer = 3指针变量的形...原创 2019-08-12 17:39:02 · 117 阅读 · 0 评论 -
C++ 输入10个学生的姓名,学号,成绩,将其中不及格的输出
#include <iostream>using namespace std;const int n=2;string name[n]; //定义字符串数组int num[n],score[n];int main(){ int i; void input_data(); input_data(); cout<<endl&...原创 2019-08-12 17:42:03 · 7672 阅读 · 0 评论 -
STM32 F1普中开发板 TFT彩屏指针时间显示及闹钟。
在普中RTC时钟上更改,按KEY键可更改时间。指针圆盘显示时钟,可设置闹钟。#include "stm32f10x.h"#include "led.h"#include "key.h"#include "system.h"#include "usart.h"#include "gui.h"#include "flash.h"#include "rtc.h"#inc...原创 2019-08-30 10:20:13 · 3903 阅读 · 3 评论 -
opencv 图像二值化 imread() namedWindow() threshold()
二值化处理#include <iostream>#include <opencv2/opencv.hpp>#include <opencv2/calib3d/calib3d.hpp>using namespace std;using namespace cv;int main(){ Mat imag, result; imag...原创 2019-07-31 17:07:26 · 651 阅读 · 0 评论 -
c++ 100-200 之间的全部素数
#include<iostream>#include<cmath>#include<iomanip>using namespace std;int main() { int m, k, i, n = 0; bool prime; //定义布尔变量prime for (m = 101; m <= 200; m...原创 2019-08-07 17:00:20 · 5848 阅读 · 0 评论 -
C++ 笔记1.7 数组
if(max==a[i][j]) //如果函数返回的是a[i][j]的值{row=i; //记下该元素行号icolum=j; //记下该元素列号j}数组名代表数组首元素的地址,并不代表数组中的全部元素。因此用数组名作函数实参时,不是把...原创 2019-08-09 17:22:18 · 172 阅读 · 0 评论 -
C++ 笔记1.6 函数
在定义函数时函数名后面括号中的变量名称为形式参数(formal parameter,简称形参),在主调函数中调用一个函数时,函数名后面括号中的参数(可以是一个表达式)称为实际参数(actual parameter,简称实参)。形参不占储存单元。实参与形参,个数相等,类型匹配。调用函数在main函数之后要先声明,在编译时将所调用函数的代码直接嵌入到主调函数...原创 2019-08-09 17:05:08 · 289 阅读 · 0 评论 -
opencv 中 cvtcolor detectMultiScale circle ellipse rectangle
cvtColor(InputArray src, OutputArray dst, int code,int dstCn=0 );颜色空间转换. InputArray src: 输入图像即要进行颜色空间变换的原图像,可以是Mat类,输入的 8-bit,16-bit或 32-bit单倍精度浮点数影像。. OutputArray dst: 输出图像即进行颜色空间变换后存储图像,也可以Mat类,...原创 2019-08-01 10:51:09 · 168 阅读 · 0 评论 -
读取系统时间
//============================================================================// Name : sj.cpp// Author : xiaopeng// Version :// Copyright : Your copyright notice// Description...转载 2019-07-23 13:36:55 · 941 阅读 · 0 评论 -
C++笔记1.1
调用的函数先定义,主函数在后。#include <iostream> //预处理命令,文件iostream文件向程序提供输入输出时所需要的信息。using namespace std; //C++中的类和函数是在命名空间std中声明的int max(int x, int y) //定义max函数{ int ...原创 2019-08-05 09:32:11 · 69 阅读 · 0 评论 -
C++ 笔记1.2 包含类的C++程序
#include <iostream>using namespace std;class student //声明一个类,类名为student。// 一个类是由一批数据以及对其操作的函数组成的{private: //以下为类中私有部分 int num; ...原创 2019-08-05 10:37:03 · 183 阅读 · 0 评论 -
Ubuntu 添加行号
sudo vim /etc/vim/vimrc在末尾加 set number 如下56 49 "set showmatch " Show matching brackets. 50 "set ignorecase " Do case insensitive matching 51 "set smartcase " Do ...原创 2019-07-31 15:51:03 · 926 阅读 · 0 评论 -
冒泡排序 C++
//两两比较把大的交换到右面,每一轮都取出数组的一个最大值放在数组的最右面。//所以每一轮之后都会少比较一个数组,以此类推。#include <iostream>//输入输出流using namespace std; //命名空间std内定义的所有标识符都有效void shuchu(int arr[], int n){ for (int j = 0; j<n...原创 2019-07-22 16:41:43 · 137 阅读 · 0 评论 -
C++读出文本内容
#include <iostream>using namespace std;int main(){ FILE* zhizhen = fopen("one.txt","r"); if(zhizhen == NULL) { printf("open error\n"); return -1; } char ...原创 2019-08-02 17:15:30 · 123 阅读 · 0 评论 -
C++ 写入文本
#include <iostream>using namespace std;int main(){ FILE * zhizhen = fopen("one.txt", "w");//这里指针的具体用法是啥意思 //cout<<fp<<endl;//结果是0x55e1ec56ce70 if(zhizhen == NULL) ...原创 2019-08-02 16:38:00 · 816 阅读 · 0 评论 -
C++ 学生姓名学号 字符串
姓名学号输入然后查找#include <iostream>#include<string>using namespace std;string name[50],num[50];int n;int main (){ void input_data(); //函数声明 void search (st...原创 2019-08-09 16:28:43 · 2953 阅读 · 0 评论 -
C++ 笔记1.5
优先级: (贼高)! (高)算数运算符 (中)关系运算符 (中低) &&和|| (低)赋值运算符if(表达式1) 语句1;else if(表达式2)语句2;else if(表达式3)语句3;…else if...原创 2019-08-07 14:47:57 · 106 阅读 · 0 评论 -
C++ 数组 中10个整数从小到大排序
#include <iostream>using namespace std;int main() { void bijiao(int array[], int n); int a[10], i; cout << "请输入数组:"; for (i = 0; i < 10; i++) { cin >> a[i]; } bijiao(a,...原创 2019-08-09 11:29:09 · 8143 阅读 · 0 评论 -
C++ 三角形面积
#include <iostream>#include<cmath> //用到数学函数时要用cmath#include<iomanip> //使用io流控制字符要用iomanipusing namespace std;int main() { double a, b, c, s, m...原创 2019-08-07 10:41:46 · 1850 阅读 · 0 评论 -
C++ 笔记2.1 指针
函数指针变量一个函数在编译时被分配给一个入口地址。这个函数入口地址就称为函数的指针。int (*p) (int,int); //定义指向函数的指针变量p (int): p所指向的函数的形参类型 p:是指向函数的指针变量 第一个 int:...原创 2019-08-13 17:33:13 · 138 阅读 · 0 评论 -
C++ 若干字符串按字母顺序(由小到大)输出
#include<iostream>#include<string.h>using namespace std;int main(){ void sort (char *name[],int n); void print (char *name[],int n); char *name[]={"BASIC","FORTRAN","C++","Pascal"...原创 2019-08-13 16:33:30 · 8250 阅读 · 2 评论 -
Ubuntu18 连网问题
sudo service network-manager stopsudo rm /var/lib/NetworkManager/NetworkManager.state sudo service network-manager start直接输入,就可以解决。原创 2019-08-02 14:30:28 · 633 阅读 · 0 评论 -
C++ 笔记1.4 运算符
C++在运算时对所有float数据按double数据处理混合运算的转换float ——>doublechar,short -->int -->unsigned-->long-->double++i (使用i前,i的值加1)i++ (使用i后,i的值加1)二进制补码:正数=源码负数:符号位不变,取反加一逗号运算符是...原创 2019-08-06 15:02:51 · 336 阅读 · 0 评论 -
9x9乘法表 函数调用
#include <stdio.h>#include <iostream>void chengfabiao(int x) //形参{ for (size_t i=1;i<x;i++) { for (size_t j=1;j<=i;j++) { printf("%d*%d=%d ",i,j,i*j); } printf(...原创 2019-08-02 15:25:00 · 872 阅读 · 0 评论