随笔分类 -  c/c++

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

OpenCV-bwLabel-实现图像连通组件标记与分析
摘要:OpenCV实现图像连通组件标记与分析- matlab bwLabel; code: #include <opencv2/opencv.hpp> #include <iostream> using namespace cv; using namespace std; RNG rng(12345); 阅读全文

posted @ 2018-06-12 16:19 鹅要长大 阅读(1449) 评论(0) 推荐(0)

How to convert int [12] to array<int, 12>
摘要:code: Re:1.cplusplus.com; End 阅读全文

posted @ 2018-06-04 16:57 鹅要长大 阅读(168) 评论(0) 推荐(0)

ubunttu-sh: 1: pause: not found
摘要:old code: error discription: right code in ubuntu: Re: 1.what-is-sh-1-pause-not-found; 2. what-is-the-linux-equivalent-to-dos-pause; End 阅读全文

posted @ 2018-06-04 16:52 鹅要长大 阅读(1091) 评论(0) 推荐(0)

linux下sprintf_s函数的替代
摘要:error code: error discription: windows平台下线程安全的格式化字符串函数sprint_s并非标准C函数,因此linux下无法使用,但可以使用snprintf函数代替。 right code: Re: 1.linux下sprintf_s函数的替代; End 阅读全文

posted @ 2018-06-04 16:48 鹅要长大 阅读(1727) 评论(0) 推荐(1)

c++跨文件变量声明
摘要:常量是内部链接的,可以直接定义; 变量是外部链接,如果在头文件定义的话,如果出现多次引用同一个头文件的编译单元,就会引发multi redifine错误, 这个时候就要只是声明变量来解决:extern type_t variable_name,并且只需要在其中一个源文件中对变量进行定义; 阅读全文

posted @ 2018-05-22 15:00 鹅要长大 阅读(899) 评论(0) 推荐(0)

memcpy - how to copy float* to float* variable
摘要:how to copy float* to float* End 阅读全文

posted @ 2018-05-22 14:57 鹅要长大 阅读(439) 评论(0) 推荐(0)

How to return NULL string
摘要:Q: std::string get_file_contents(const char *filename) { std::ifstream in(filename, std::ios::in | std::ios::binary); if (in) { std::string contents; 阅读全文

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

c++ 字符数组-print and 写入文件
摘要:1.print char buffer[22][8] = { 0 }; method1: 为了打印出unsigned char数据所对应的数值,可以将其强制转换成int类型,并做打印输出。 std::cout << "buffer[22][0]: " << std::hex << (int)buff 阅读全文

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

opencv数据格式转换
摘要:A.convertTo(A, CV_8UC1); 阅读全文

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

如何释放vector变量
摘要:前言 使用vector时,需要释放内存空间,可以使用clear和swap进行操作。 具体操作 1. 释放vector内存空间 std::vector<cv::Point> probp; std::vector<int> plabel; plabel.clear(); std::vector<int> 阅读全文

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

show point on image
摘要:show point on image... 阅读全文

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

vec2d
摘要:namespace : cv::vec2d; cv::Mat temp = cv::Mat::ones(3, uv.cols, CV_64FC1); save image: char output_path[100]; sprintf(output_path,"./ipmp/00000%05d.pn 阅读全文

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

Size类型如何调用和定义
摘要:cv::Size sz = cv::Size(PROB_W, PROB_H);//Size(srcimage.cols, srcimage.rows) groundtoimage(xylimit, uvgd, sz, h, roll, pitch, camera_param_KK );sz.heig 阅读全文

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

opencv数据类型和格式的坑
摘要://cv::Mat uvp = cv::Mat::zeros(2, probp.size(), CV_8UC1); cv::Mat uvp = cv::Mat::zeros(2, probp.size(), CV_64FC1);//data-type... for (unsigned int i = 阅读全文

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

IplImage 与mat之间的转换及释放内存
摘要:IplImage *x = cvLoadImage(savefilename, 1); Mat img(x,true); cvReleaseImage(&x); cv::Mat数据类型的释放,以及release和clear之间的区别; The cv::release() function relea 阅读全文

posted @ 2018-05-02 15:30 鹅要长大 阅读(425) 评论(0) 推荐(0)

gettimeofday的使用
摘要:前言 好像只能在linux平台使用,在windows平台不能使用。。。。 #include <sys/time.h> long cur_tp, cost_tp, tmp_tp; struct timeval timep; gettimeofday(&timep, NULL); // Start Ti 阅读全文

posted @ 2018-04-20 16:02 鹅要长大 阅读(335) 评论(0) 推荐(0)

can-utils源码解析cansend
摘要:前言 本文主要介绍socketCan中的发送函数cansend的源码解析. 代码 /* * cansend.c - simple command line tool to send CAN-frames via CAN_RAW sockets * * Copyright (c) 2002-2007 阅读全文

posted @ 2018-04-19 14:29 鹅要长大 阅读(3370) 评论(0) 推荐(0)

convert CAN frame
摘要:前言 最近了解了一些socket can的知识点,本文主要介绍如何将数据转换为CAN报文,前提是已经确定CAN的传输协议。 本文使用的CAN报文共有22条,这些报文共用一个can id,每条报文使用序号标志; 报文协议 转换数据程序 char* convert_buf(vector<Point>& 阅读全文

posted @ 2018-04-17 18:41 鹅要长大 阅读(1077) 评论(0) 推荐(0)

camera按键采集图像及waitKey的用法
摘要:前言 项目需要通过摄像头采集图像并保存,主要是用于后续的摄像头标定。实现过程其实很简单,需要注意一些细节。 系统环境 系统版本:ubuntu16.04;opencv版本:opencv2.4.13;编程语言:c++; 实现过程 /************************************ 阅读全文

posted @ 2018-02-26 19:37 鹅要长大 阅读(2873) 评论(0) 推荐(0)

开源库dlib的安装与编译-CMake
摘要:前言 最近项目涉及到关于face alignment的实现,了解到目前主要的算法有ERT、SDM、LBF等,其中由于dlib开源库实现了ERT算法,效果也很不错,故开始研究dlib的使用。而使用的第一步是dlib的安装与编译,本文针对这一内容展开。网上有很多资料,不过也遇到了很多问题,走了一些弯路, 阅读全文

posted @ 2017-11-22 15:27 鹅要长大 阅读(13002) 评论(0) 推荐(0)

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

导航