随笔分类 -  c/c++

上一页 1 ··· 4 5 6 7 8 9 10 下一页

【c++基础】字符数组和string相互转换
摘要:字符数组转化成string类型char ch [] = "ABCDEFG";string str(ch);//也可string str = ch;或者char ch [] = "ABCDEFG";string str;str = ch;//在原有基础上添加可以用str += ch;将string类型 阅读全文

posted @ 2018-11-07 16:54 鹅要长大 阅读(609) 评论(0) 推荐(0)

【c++基础】从json文件提取数据
摘要:前言 标注数据导出文件是json格式的,也就是python的dict格式,需要读取标注结果,可以使用c++或者python,本文使用c++实现的。 JsonCpp简介 JsonCpp是一种轻量级的数据交换格式,是个跨平台的开源库,可以从github和sourceforge上下载源码。查找资料的过程中 阅读全文

posted @ 2018-11-07 10:32 鹅要长大 阅读(5687) 评论(0) 推荐(0)

【机器学习基础】SVM实现分类识别及参数调优(二)
摘要:前言 实现分类可以使用SVM方法,但是需要人工调参,具体过程请参考here,这个比较麻烦,小鹅不喜欢麻烦,正好看到SVM可以自动调优,甚好! 注意 1.reshape的使用; https://docs.opencv.org/3.3.1/d3/d63/classcv_1_1Mat.html#a4eb9 阅读全文

posted @ 2018-11-05 11:10 鹅要长大 阅读(1334) 评论(0) 推荐(0)

【c++基础】ifstream的构造函数
摘要:公共成员函数: mode code 参考 1.cplusplus.com; 完 阅读全文

posted @ 2018-10-24 16:23 鹅要长大 阅读(3042) 评论(0) 推荐(0)

【c++基础】多个txt文件合并到一个文件的几种方式
摘要:参考 1.windows命令; 2.linux-command; 完 阅读全文

posted @ 2018-10-19 11:12 鹅要长大 阅读(1829) 评论(0) 推荐(0)

c++野(wild)指针与悬空(dangling)指针
摘要:re 1.https://www.cnblogs.com/idorax/p/6475941.html end 阅读全文

posted @ 2018-10-18 09:05 鹅要长大 阅读(540) 评论(0) 推荐(0)

leetcode-1-TwoNums
摘要:flag -everyday do leetcode problems at least one and at most three. problem here 需要学习的是c++的map类型,之前竟然完全不了解; 还有unorder_map类型; 阅读全文

posted @ 2018-10-17 09:41 鹅要长大 阅读(155) 评论(0) 推荐(0)

【c++基础】判断是否到文件末尾-eof函数
摘要:前言 读取文件内容时,需要判断是否到文件末尾,此时用到eof函数。 函数定义 Check whether eofbit is set Returns true if theeofbiterror state flag is set for the stream. This flag is set b 阅读全文

posted @ 2018-10-15 15:09 鹅要长大 阅读(4745) 评论(0) 推荐(0)

【c++基础】int转string自动补零
摘要:前言 使用to_string函数可以将不同类型的数据转换为string类,请参考here和here。如果string的位数固定,如何进行自动补零呢?请看本文实例! 代码 确定位数,to_string 自动补零; int a = 5; std::string str = std::to_string( 阅读全文

posted @ 2018-10-15 14:17 鹅要长大 阅读(10181) 评论(0) 推荐(0)

【c++基础】如何获取工程项目当前路径
摘要:工程项目当前路径 参考 1.获取当前路径; 完 阅读全文

posted @ 2018-09-25 11:08 鹅要长大 阅读(1902) 评论(0) 推荐(0)

【error】segmentation fault分析
摘要:前言 调试代码的时候,可能会出现segmentation fault的bug,很难找到原因,在此总结一下可能的原因。 SIGSEGV 原因分析 1.程序中的变量没有进行检查; 比如,没有对变量的大小进行检查,却在之后要用到该变量,如果变量为空,此时便会出错。 完 阅读全文

posted @ 2018-09-12 15:36 鹅要长大 阅读(264) 评论(0) 推荐(0)

【opencv基础】图像翻转cv::flip详解
摘要:前言 在opencv中cv::flip函数用于图像翻转和镜像变换。 具体调用形式 Flips a 2D array around vertical, horizontal, or both axes. 测试代码 参考 1.opencv官网; 2.csdn博客; 完 阅读全文

posted @ 2018-09-10 14:04 鹅要长大 阅读(7377) 评论(0) 推荐(0)

【error】no type named ‘type’ in ‘class std::result_of<void
摘要:Q: A: I could compile your code successfully with MSVC2013. However, thread() works passing copies of its argument to the new thread. This means that 阅读全文

posted @ 2018-08-28 19:11 鹅要长大 阅读(1727) 评论(0) 推荐(0)

【c++基础】accumulate
摘要:accumulate RE 1.accumulate-example; End 阅读全文

posted @ 2018-08-07 10:09 鹅要长大 阅读(402) 评论(0) 推荐(0)

【c++基础】vector中按照Point类型某一个变量进行排序
摘要:code 完 阅读全文

posted @ 2018-07-05 17:14 鹅要长大 阅读(2178) 评论(0) 推荐(0)

【c++基础】vector初始化的几种方式
摘要:前言 STL中的vector有几种初始化方式,根据不同的需求选择合适的初始化方式。 源码 参考 1.cplusplus.com-vector-construct; 完 阅读全文

posted @ 2018-06-27 13:49 鹅要长大 阅读(858) 评论(0) 推荐(0)

opencv-原图基础上添加指定颜色
摘要:前言 项目中需要将某些区域使用不同的颜色表示出来,同时能够看到原图作为底色。 代码 参考 1.roi-and-add; 2.imread的flag参数; 3.opencv中设置某点的颜色; 4.opencv-add; 完 阅读全文

posted @ 2018-06-26 17:21 鹅要长大 阅读(552) 评论(0) 推荐(0)

Segmentation fault (core dumped)
摘要:Segmentation fault (core dumped)一般是对内存操作不当造成的,常见的有: 数组超出范围; 修改了只读内存; RE 1.Segmentation fault (core dumped); End 阅读全文

posted @ 2018-06-19 09:59 鹅要长大 阅读(12269) 评论(0) 推荐(0)

suggest parentheses around comparison in operand of &|
摘要:error discription: why: 该警告希望你在&(逻辑与)表达式左右加上括号。有的时候&&(逻辑且)少写了一个&,也会产生该警告。 因为&运算符的优先级较低,低于==和!=运算符。 RE 1.cnblogs-here; End 阅读全文

posted @ 2018-06-19 09:51 鹅要长大 阅读(1431) 评论(0) 推荐(0)

opencv图像读取-imread
摘要:前言 图像的读取和保存一定要注意imread函数的各个参数及其意义,尽量不要使用默认参数,否则就像数据格式出现错误(here)一样,很难查找错误原因的; re: 1.opencv图像的读取与保存; 完 阅读全文

posted @ 2018-06-14 15:07 鹅要长大 阅读(185) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 下一页

导航