
c++
Bigshow末日快乐
把每一天过好!
展开
-
ubuntu 编译opencv
1. 下载xxx.tar.gz ,网址如下opencv下载地址2. 解压:tar -xvfxxx.tar.gz3. 创建build文件夹 mkdir build4. 创建install文件夹 mkdir install5. 进入build文件夹 cd build/ -->产生中间文件6. 开始编译cmake -D CMAKE_BUILD_TYPE=Release ...原创 2020-05-06 20:08:29 · 204 阅读 · 0 评论 -
基于opencv透视变换
using namespace std;using namespace cv;vector<cv::Point3f> Generate3DPoints();int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); const string fileName = "cam.xml"; File...原创 2020-01-21 20:01:59 · 345 阅读 · 0 评论 -
不知道干嘛的
cv::Vec3b getColorSubpix(const cv::Mat& img, cv::Point2f pt);cv::Vec3b getColorSubpix1(const cv::Mat& img, cv::Point2f pt){ cv::Mat patch; cv::getRectSubPix(img, cv::Size(1, 1), pt, patch...原创 2020-01-21 20:00:59 · 209 阅读 · 0 评论 -
lambda
auto L = [] { std::cout << "Hello lambda" << std::endl; }; //调用lambdas函数 L(); //int id = 0; //auto f = [id]() mutable { // std::cout << "id:" << id << std::e...原创 2019-11-18 16:47:57 · 121 阅读 · 0 评论 -
subokita/FAsT-Match
FAsTMatch.cpp//// FAsTMatch.cpp// FAsT-Match//// Created by Saburo Okita on 23/05/14.// Copyright (c) 2014 Saburo Okita. All rights reserved.//#include "FAsTMatch.h"#include <iomanip&g...转载 2018-04-08 01:40:44 · 684 阅读 · 2 评论 -
c++ 修改序列操作-复制(copy copy_n copy_if copy_backward)
https://blog.youkuaiyun.com/baidu_34884208/article/details/87891466转载 2019-09-15 21:08:29 · 285 阅读 · 0 评论 -
C++ STL算法系列2---find ,find_first_of , find_if , adjacent_find的使用
转载自:https://yq.aliyun.com/articles/359442一.find运算假设有一个int型的vector对象,名为vec,我们想知道其中是否包含某个特定值。二.find_first_of的使用除了find之外,标准库还定义了其他一些更复杂的查找算法。当中的一部分类似string类的find操作,其中一个是find_first_of函数。这个...转载 2019-09-15 21:00:09 · 333 阅读 · 0 评论 -
for_each
函数原型:std::for_eachtemplate <class InputIterator, class Function> Function for_each (InputIterator first, InputIterator last, Function fn);///////////////////////////////////////////////...转载 2019-09-15 20:09:13 · 210 阅读 · 0 评论 -
all_of any_of & none_of
auto IsOdd(int n) ->bool{ return n % 2 != 0;}int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); std::vector<int> v0{ 1,3,5,7,9,10 }; std::vector<int> v1{ 2,3,6,...原创 2019-09-15 20:03:15 · 183 阅读 · 0 评论 -
string::size_type & string::npos
#include <QtCore/QCoreApplication>#include <string>#include <iostream>using namespace std;int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); string szStr = ...原创 2019-09-15 19:49:34 · 205 阅读 · 0 评论 -
STL----- nth_element
#include <QtCore/QCoreApplication>#include <algorithm>#include <iostream>using namespace std;int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); int b[] = { 1...原创 2019-09-14 14:05:17 · 107 阅读 · 0 评论 -
opencv-fitLine
§fitLine()void cv::fitLine ( InputArray points, OutputArray line, int distType, double param, double reps, doub...原创 2019-09-16 14:35:32 · 1411 阅读 · 0 评论 -
点积 叉积
1.向量的点积: 向量点积是其各个分量乘积的和a*b = |a||b|cosθ几何意义:点积的结果是一个标量,等于向量大小与夹角的cos值的乘积。2.向量叉积:两个向量a和b的叉积写作a×b(有时也被写成a∧b,避免和字母x混淆)。它的运算结果是一个向量。叉乘的几何意义:|c|=|a×b|=|a| |b|sinα(α为a,b向量之间的夹角)https://www....转载 2019-09-19 15:55:22 · 285 阅读 · 0 评论 -
calcHist
Mat img = (Mat_<uchar>(9, 12) << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 3, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 2, 3, 4, 5, 6, 7, 8, 9, 10...原创 2019-09-20 15:54:05 · 287 阅读 · 0 评论 -
qt down file
https://download.qt.io/archive/原创 2019-09-23 14:20:40 · 210 阅读 · 0 评论 -
foreach every pixel
Mat img = (Mat_<uchar>(3, 4) << 1, 2, 3, 10, 4, 5, 6, 11, 7, 8, 9, 12);int step = img.step;1./////////////////////////////////for (int i = 0; i <1; i++...原创 2019-08-29 18:10:09 · 155 阅读 · 0 评论 -
变量的存储类别
静态存储区 & 动态存储auto static register externauto int b, c=3;int b, c=3;两者等价f(int a){atuo b = 0;static c = 3;b = b + 1;c = c + 1;return(a + b + c);}main(){int a = 2, i;for(i = 0; i < 3...原创 2018-05-04 10:48:54 · 175 阅读 · 0 评论 -
SFCS
由于近期需要进行(C# DLL-->C++ DLL -->MFC):1.创建c# DLL a. 新建工程 a.创建工程内容:using System;using System.Collections.Generic;using System.Text;using WebServiceForCSharpDll.WebReference;namespace W...原创 2018-05-10 10:57:49 · 561 阅读 · 0 评论 -
CRC_IBM
uint16_t calculatecrc(void){ uint16_t crc = 0, i; for (i = 0; i < sizeof(data) / sizeof(data[0]); i++) { crc = crc16_update(crc, data[i]); } return crc; //returns checksum over all elements...原创 2018-05-10 09:47:14 · 826 阅读 · 0 评论 -
查看dll函数
dumpbin -exports (dll地址)转载 2018-05-08 21:39:28 · 2709 阅读 · 0 评论 -
each for serial port
void COptotuneControlDlg::GetComportList(CStringList* pszlistComportList){ HKEY hkRegistryPath = NULL; // A pointer which stored whole path of registry pszlistComportList->RemoveAll(); // In...原创 2018-04-18 21:27:43 · 144 阅读 · 0 评论 -
c/c++字符串处理大集合
rember this strncpy(a,b,5); a[5]='\0'; char a[10]; memset(a,'#',sizeof(a)); a[10]='\0'; 刚开始学C/C++时,一直对字符串处理函数一知半解,这里列举C/C++字符串处理函数 ,希望对初学者有一定的帮助。 C: char st[100]; ...转载 2018-04-16 10:20:00 · 139 阅读 · 0 评论 -
C/C++ typedef用法详解
点击打开链接 https://blog.youkuaiyun.com/sruru/article/details/7916296/点击打开链接 http://www.cnblogs.com/seventhsaint/archive/2012/11/18/2805660.html点击打开链接 https://blog.youkuaiyun.com/helaisun/article/details/54845891第一...转载 2018-04-15 06:12:24 · 173 阅读 · 0 评论 -
#if, #ifdef, #ifndef, #else, #elif, #endif的用法
#if, #ifdef, #ifndef, #else, #elif, #endif的用法: 这些命令可以让编译器进行简单的逻辑控制,当一个文件被编译时,你可以用这些命令去决定某些代码的去留, 这些命令式条件编译的命令。常见的条件编译的三种形式: ①第一种形式: #if defined(或者是ifdef)<标识符(条件)> <程序段1> [...转载 2018-04-15 06:00:57 · 267 阅读 · 0 评论 -
路径转换
#include "stdafx.h"#include "OpencvHead.h"#include <iostream>using namespace std;using namespace cv;string& replace_all(string & str, const string &old_value, const string &am...原创 2018-04-08 17:53:41 · 348 阅读 · 0 评论 -
C++中for循环的5种语法
#include <algorithm>#include <vector>//////////////////////////////////////////////int nArray[] = {0, 1, 2, 3, 4, 5};std::vector<int> vecNum(nArray, nArray + 6);CString strText;...转载 2018-03-18 12:08:42 · 1196 阅读 · 0 评论 -
类与对象之正数的反转
class Integer{private: int _num;//getLength()函数获取_num长度 int getLength(){ }public: Integer(int num){ _num = num; }//反转_num int inversed(){ int nIversed = 0; // 将整数倒序 ...原创 2018-03-04 22:20:23 · 205 阅读 · 0 评论 -
类与对象之最大公约数练习
题目:求两个正整数a 和 b的最大公约数。class Integer {private: int _num;public://构造函数 Integer(int num)//形参赋值给类的对象 { _num = num; }//计算当前Integer 和 b之间的最大公约数 int gcd(Integer b) { ...原创 2018-03-04 21:39:52 · 294 阅读 · 0 评论 -
C++ 导出DLL
.h文件:#pragma once#include <iostream>using namespace std;#ifdef IM_EXPORT_API#else#define IM_EXPORRT_API extern "C"_declspec(dllimport)#endif.cpp文件:#define IM_EXPORT_API extern "C" _declsp...原创 2018-03-04 16:19:30 · 481 阅读 · 0 评论 -
构造函数
其作用: 对类进行初始化(如规则,算法)class Complex { private : double m_real; double m_imag; public: // 无参数构造函数 // 如果创建一个类你没有写任何构造函数,则系统会自动生成默认的无参构造函数,函数为空,什么都不做 // 只要你写了一个下面的某一种构造函...转载 2018-03-04 16:19:48 · 240 阅读 · 0 评论 -
物向导向的精髓 多型与虚拟 chapter 1
int _tmain(int argc, _TCHAR* _targc[]){ cout<<"all your keyboard input in monitor" <<"will into copy.txt. \n" <<"terminate by ^z\n\n"; ofstream outFile("copy.txt");原创 2018-03-14 21:17:54 · 237 阅读 · 0 评论 -
FOP
int _tmain(int argc, _TCHAR* _targc[]){ for(char thisMan = 'A'; thisMan < 'E'; thisMan++) { int count = 0; count += (thisMan != 'A'); count += (thisMan == 'C'); count += (thisMan == 'D')...原创 2018-03-07 00:14:01 · 379 阅读 · 0 评论 -
C++ 类的继承
class B{ int b;public: B() { b = 0; cout<<"B's default constructor called"<<endl; } B(int i){ b = i; cout<<"B's constructor called."<<endl; } ~B(){ cout<&原创 2018-03-06 19:41:00 · 130 阅读 · 0 评论 -
file read & write
1.数据流创建文件.txt#include <iostream>.........#define numberImg 112 //picture number#define nArray 8 //colsstring filePath = ".\\1"; //the picture in file pathstring imgType = ".bmp"; /...原创 2018-05-10 21:14:45 · 423 阅读 · 0 评论 -
预处理命令
预处理功能有以下三种:宏定义:#define PI 3.1415926.........#undef PI //终止宏文件包含#include “ ”或include < >条件编译#ifdef 标识符程序段1#else程序段2#endif(作用:当所指定的标识符已经被#define命令定义过,则在程序编译阶段只编译程序段1,否则编译程序段2)#ifdef ...原创 2018-05-04 15:40:56 · 126 阅读 · 0 评论 -
指针 结构体 共用体
指针数组:int *p[4];指向指针的指针:char **p;指针数组作mian函数的形参:mian(int argc, char* argv[]){ while(argv > 1) { ++argv; printf("%s\n", *argv); --argv; }}输入的命令行参数为:file...原创 2018-05-04 17:00:13 · 369 阅读 · 0 评论 -
CSingleLock
DWORD CThreadSafeBuffer::GetCount(DWORD dwIndex, DWORD* pdwNotify, int* pnBatchNo){ CSingleLock singleLock(&m_csDataAccess); singleLock.Lock(); *pdwNotify = m_adwNotify[dwIndex]; ...原创 2018-12-01 12:45:19 · 692 阅读 · 0 评论 -
OCCC
利用jTessBoxEditor工具进行Tesseract3.02.02样本训练,提高识别率1 . 下载Tesseract-OCR(相关版本自行选择) 得到目录结构如下: tessdata目录为相关的语言包文件目录2 .下载jTessBoxEditor(运行环境为Java虚拟机)得到目录结构如下: 打开方式如下: 工具都安装完成了,我们接下来测试下tesseract ...转载 2018-11-05 22:34:22 · 257 阅读 · 0 评论 -
Opencv函数确认
void callback1(int pos, void*){ std::cout << "hmin" << pos << std::endl;}void callback2(int pos, void*){ std::cout << "smin" << pos << std::endl;}voi转载 2018-10-03 12:04:02 · 144 阅读 · 0 评论 -
convert to hex
int transform(CString szTmp){ szTmp = szTmp.Trim().MakeUpper(); CString szTable = "0123456789ABCDEF"; int nSum = 0; for(int i = 0; i < szTmp.GetLength(); i++) { char ch = szTmp.GetAt(i);...转载 2018-09-24 08:23:20 · 598 阅读 · 0 评论